From 61b4610a180d1741563a7b79c84268900baa8e77 Mon Sep 17 00:00:00 2001 From: Dmytro Kashkarov Date: Fri, 6 Oct 2023 12:38:43 +0300 Subject: [PATCH 01/11] add different flash sizes --- examples/lighting-app/telink/CMakeLists.txt | 10 ++++-- .../telink/flash_overlays/1m_flash.overlay | 36 +++++++++++++++++++ .../telink/flash_overlays/2m_flash.overlay | 36 +++++++++++++++++++ .../telink/flash_overlays/4m_flash.overlay | 36 +++++++++++++++++++ src/platform/telink/tlsr9518adk80d.overlay | 36 ------------------- src/platform/telink/tlsr9528a.overlay | 36 ------------------- 6 files changed, 116 insertions(+), 74 deletions(-) create mode 100644 src/platform/telink/flash_overlays/1m_flash.overlay create mode 100644 src/platform/telink/flash_overlays/2m_flash.overlay create mode 100644 src/platform/telink/flash_overlays/4m_flash.overlay diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index f4a0edd1636734..42f91badbb37e1 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -48,13 +48,19 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${USB_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${USB_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${USB_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${USB_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE ${USB_CONF_OVERLAY_FILE} prj.conf) diff --git a/src/platform/telink/flash_overlays/1m_flash.overlay b/src/platform/telink/flash_overlays/1m_flash.overlay new file mode 100644 index 00000000000000..2b23839c445f6b --- /dev/null +++ b/src/platform/telink/flash_overlays/1m_flash.overlay @@ -0,0 +1,36 @@ +&flash { + reg = <0x20000000 0x100000>; + + partitions { + /delete-node/ partition@0; + /delete-node/ partition@20000; + /delete-node/ partition@88000; + /delete-node/ partition@f0000; + /delete-node/ partition@f4000; + /delete-node/ partition@fe000; + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x19000>; + }; + slot0_partition: partition@19000 { + label = "image-0"; + reg = <0x19000 0x6e000>; + }; + factory_partition: partition@87000 { + label = "factory-data"; + reg = <0x87000 0x1000>; + }; + storage_partition: partition@88000 { + label = "storage"; + reg = <0x88000 0x8000>; + }; + slot1_partition: partition@90000 { + label = "image-1"; + reg = <0x90000 0x6e000>; + }; + vendor_partition: partition@fe000 { + label = "vendor-data"; + reg = <0xfe000 0x2000>; + }; + }; +}; diff --git a/src/platform/telink/flash_overlays/2m_flash.overlay b/src/platform/telink/flash_overlays/2m_flash.overlay new file mode 100644 index 00000000000000..1131283f8e7af9 --- /dev/null +++ b/src/platform/telink/flash_overlays/2m_flash.overlay @@ -0,0 +1,36 @@ +&flash { + reg = <0x20000000 0x200000>; + + partitions { + /delete-node/ partition@0; + /delete-node/ partition@20000; + /delete-node/ partition@88000; + /delete-node/ partition@f0000; + /delete-node/ partition@f4000; + /delete-node/ partition@fe000; + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x19000>; + }; + slot0_partition: partition@19000 { + label = "image-0"; + reg = <0x19000 0xee000>; + }; + factory_partition: partition@107000 { + label = "factory-data"; + reg = <0x107000 0x1000>; + }; + storage_partition: partition@108000 { + label = "storage"; + reg = <0x108000 0x8000>; + }; + slot1_partition: partition@110000 { + label = "image-1"; + reg = <0x110000 0xee000>; + }; + vendor_partition: partition@1fe000 { + label = "vendor-data"; + reg = <0x1fe000 0x2000>; + }; + }; +}; diff --git a/src/platform/telink/flash_overlays/4m_flash.overlay b/src/platform/telink/flash_overlays/4m_flash.overlay new file mode 100644 index 00000000000000..b25c2951f623b0 --- /dev/null +++ b/src/platform/telink/flash_overlays/4m_flash.overlay @@ -0,0 +1,36 @@ +&flash { + reg = <0x20000000 0x400000>; + + partitions { + /delete-node/ partition@0; + /delete-node/ partition@20000; + /delete-node/ partition@88000; + /delete-node/ partition@f0000; + /delete-node/ partition@f4000; + /delete-node/ partition@fe000; + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x19000>; + }; + slot0_partition: partition@19000 { + label = "image-0"; + reg = <0x19000 0x1ee000>; + }; + factory_partition: partition@207000 { + label = "factory-data"; + reg = <0x207000 0x1000>; + }; + storage_partition: partition@208000 { + label = "storage"; + reg = <0x208000 0x8000>; + }; + slot1_partition: partition@210000 { + label = "image-1"; + reg = <0x210000 0x1ee000>; + }; + vendor_partition: partition@3fe000 { + label = "vendor-data"; + reg = <0x3fe000 0x2000>; + }; + }; +}; diff --git a/src/platform/telink/tlsr9518adk80d.overlay b/src/platform/telink/tlsr9518adk80d.overlay index c419f8116441e5..7ad86efd5edc0a 100644 --- a/src/platform/telink/tlsr9518adk80d.overlay +++ b/src/platform/telink/tlsr9518adk80d.overlay @@ -78,39 +78,3 @@ pinctrl-0 = <&pwm_ch0_pb4_default &pwm_ch1_pb5_default &pwm_ch2_pe2_default &pwm_ch3_pe0_default>; }; -&flash { - reg = <0x20000000 0x200000>; - - partitions { - /delete-node/ partition@0; - /delete-node/ partition@20000; - /delete-node/ partition@88000; - /delete-node/ partition@f0000; - /delete-node/ partition@f4000; - /delete-node/ partition@fe000; - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x00000000 0x19000>; - }; - slot0_partition: partition@19000 { - label = "image-0"; - reg = <0x19000 0xee000>; - }; - factory_partition: partition@107000 { - label = "factory-data"; - reg = <0x107000 0x1000>; - }; - storage_partition: partition@108000 { - label = "storage"; - reg = <0x108000 0x8000>; - }; - slot1_partition: partition@110000 { - label = "image-1"; - reg = <0x110000 0xee000>; - }; - vendor_partition: partition@1fe000 { - label = "vendor-data"; - reg = <0x1fe000 0x2000>; - }; - }; -}; diff --git a/src/platform/telink/tlsr9528a.overlay b/src/platform/telink/tlsr9528a.overlay index c57cc0eb0341e2..9ba662d284ef37 100644 --- a/src/platform/telink/tlsr9528a.overlay +++ b/src/platform/telink/tlsr9528a.overlay @@ -78,39 +78,3 @@ pinctrl-0 = <&pwm_ch0_pd0_default &pwm_ch1_pd1_default &pwm_ch2_pe2_default &pwm_ch3_pe0_default>; }; -&flash { - reg = <0x20000000 0x200000>; - - partitions { - /delete-node/ partition@0; - /delete-node/ partition@20000; - /delete-node/ partition@88000; - /delete-node/ partition@f0000; - /delete-node/ partition@f4000; - /delete-node/ partition@fe000; - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x00000000 0x19000>; - }; - slot0_partition: partition@19000 { - label = "image-0"; - reg = <0x19000 0xee000>; - }; - factory_partition: partition@107000 { - label = "factory-data"; - reg = <0x107000 0x1000>; - }; - storage_partition: partition@108000 { - label = "storage"; - reg = <0x108000 0x8000>; - }; - slot1_partition: partition@110000 { - label = "image-1"; - reg = <0x110000 0xee000>; - }; - vendor_partition: partition@1fe000 { - label = "vendor-data"; - reg = <0x1fe000 0x2000>; - }; - }; -}; From d78effe5d77f4349c6db76b278060a16db4a7155 Mon Sep 17 00:00:00 2001 From: Dmytro Kashkarov Date: Mon, 9 Oct 2023 13:07:08 +0300 Subject: [PATCH 02/11] add different flash sizes in exampe's CMake --- config/telink/chip-module/CMakeLists.txt | 23 ++++++++++++++++++- .../all-clusters-app/telink/CMakeLists.txt | 12 ++++++++-- .../telink/CMakeLists.txt | 12 ++++++++-- examples/bridge-app/telink/CMakeLists.txt | 12 ++++++++-- examples/chef/telink/CMakeLists.txt | 12 ++++++++-- .../contact-sensor-app/telink/CMakeLists.txt | 12 ++++++++-- .../light-switch-app/telink/CMakeLists.txt | 12 ++++++++-- examples/lighting-app/telink/CMakeLists.txt | 10 ++++---- examples/lock-app/telink/CMakeLists.txt | 12 ++++++++-- .../ota-requestor-app/telink/CMakeLists.txt | 12 ++++++++-- examples/pump-app/telink/CMakeLists.txt | 12 ++++++++-- .../pump-controller-app/telink/CMakeLists.txt | 12 ++++++++-- .../telink/CMakeLists.txt | 12 ++++++++-- examples/shell/telink/CMakeLists.txt | 12 ++++++++-- .../smoke-co-alarm-app/telink/CMakeLists.txt | 12 ++++++++-- .../telink/CMakeLists.txt | 12 ++++++++-- examples/thermostat/telink/CMakeLists.txt | 12 ++++++++-- examples/window-app/telink/CMakeLists.txt | 12 ++++++++-- 18 files changed, 188 insertions(+), 37 deletions(-) diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 6946aa64b11498..f7f4d5e6e332f3 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -189,10 +189,31 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD) endif() if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE) - add_custom_target(merge_factory_data ALL + if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + if(${FLASH_SIZE} MATCHES 1m) + add_custom_target(merge_factory_data ALL COMMAND + dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=540 + ) + elseif(${FLASH_SIZE} MATCHES 2m) + add_custom_target(merge_factory_data ALL + COMMAND dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1052 + ) + elseif(${FLASH_SIZE} MATCHES 4m) + add_custom_target(merge_factory_data ALL + COMMAND + dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=2076 + ) + endif() + else() + add_custom_target(merge_factory_data ALL + COMMAND + dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1052 ) + endif() + + if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_dependencies(merge_factory_data merge_mcuboot) else() diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index fbc0b756eda8c3..1662d4a5c1a6b0 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -32,13 +32,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/all-clusters-minimal-app/telink/CMakeLists.txt b/examples/all-clusters-minimal-app/telink/CMakeLists.txt index ec296891479d16..c3df35f25a0fbd 100644 --- a/examples/all-clusters-minimal-app/telink/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/telink/CMakeLists.txt @@ -32,13 +32,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/bridge-app/telink/CMakeLists.txt b/examples/bridge-app/telink/CMakeLists.txt index 588b4f7bbdf5b1..880c19bb9c624d 100644 --- a/examples/bridge-app/telink/CMakeLists.txt +++ b/examples/bridge-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/chef/telink/CMakeLists.txt b/examples/chef/telink/CMakeLists.txt index 10b2eec74c8961..da859bbd7839fb 100755 --- a/examples/chef/telink/CMakeLists.txt +++ b/examples/chef/telink/CMakeLists.txt @@ -38,13 +38,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/contact-sensor-app/telink/CMakeLists.txt b/examples/contact-sensor-app/telink/CMakeLists.txt index 154cfcc18678dc..8ebe6f44783fde 100755 --- a/examples/contact-sensor-app/telink/CMakeLists.txt +++ b/examples/contact-sensor-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/light-switch-app/telink/CMakeLists.txt b/examples/light-switch-app/telink/CMakeLists.txt index 5312e902907138..2b7ddca286fc59 100755 --- a/examples/light-switch-app/telink/CMakeLists.txt +++ b/examples/light-switch-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 42f91badbb37e1..b2a9a6a61e733e 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -49,10 +49,12 @@ else() endif() if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") - endif() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE diff --git a/examples/lock-app/telink/CMakeLists.txt b/examples/lock-app/telink/CMakeLists.txt index 702648dab2daa0..68da40303ef367 100755 --- a/examples/lock-app/telink/CMakeLists.txt +++ b/examples/lock-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/ota-requestor-app/telink/CMakeLists.txt b/examples/ota-requestor-app/telink/CMakeLists.txt index b3558357cc59c8..01034b21c9612f 100644 --- a/examples/ota-requestor-app/telink/CMakeLists.txt +++ b/examples/ota-requestor-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/pump-app/telink/CMakeLists.txt b/examples/pump-app/telink/CMakeLists.txt index 1e831ee268d2de..8a31b18742fb5c 100755 --- a/examples/pump-app/telink/CMakeLists.txt +++ b/examples/pump-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/pump-controller-app/telink/CMakeLists.txt b/examples/pump-controller-app/telink/CMakeLists.txt index 32e6f4682e5f2c..ac50a7fdb4718d 100755 --- a/examples/pump-controller-app/telink/CMakeLists.txt +++ b/examples/pump-controller-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/resource-monitoring-app/telink/CMakeLists.txt b/examples/resource-monitoring-app/telink/CMakeLists.txt index 07f4004a6f54a9..ef2e79c3f9d119 100644 --- a/examples/resource-monitoring-app/telink/CMakeLists.txt +++ b/examples/resource-monitoring-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/shell/telink/CMakeLists.txt b/examples/shell/telink/CMakeLists.txt index fe3d961ca02758..f5cb01ca721492 100755 --- a/examples/shell/telink/CMakeLists.txt +++ b/examples/shell/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/smoke-co-alarm-app/telink/CMakeLists.txt b/examples/smoke-co-alarm-app/telink/CMakeLists.txt index e1d5beec90d1c7..05d00ebde9405e 100755 --- a/examples/smoke-co-alarm-app/telink/CMakeLists.txt +++ b/examples/smoke-co-alarm-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/temperature-measurement-app/telink/CMakeLists.txt b/examples/temperature-measurement-app/telink/CMakeLists.txt index 1adc7f29fe00a6..24461249085000 100644 --- a/examples/temperature-measurement-app/telink/CMakeLists.txt +++ b/examples/temperature-measurement-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/thermostat/telink/CMakeLists.txt b/examples/thermostat/telink/CMakeLists.txt index 7b9dff6ff3e6f8..ff18cdbd46dea4 100755 --- a/examples/thermostat/telink/CMakeLists.txt +++ b/examples/thermostat/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/examples/window-app/telink/CMakeLists.txt b/examples/window-app/telink/CMakeLists.txt index d9e703db81ae94..a18e960ded0722 100644 --- a/examples/window-app/telink/CMakeLists.txt +++ b/examples/window-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) From 6c66ccc0564677aee178c7ff25ee7b198d80dbca Mon Sep 17 00:00:00 2001 From: Dmytro Kashkarov Date: Tue, 10 Oct 2023 11:36:48 +0300 Subject: [PATCH 03/11] add offset argument to mfg_tool --- config/telink/chip-module/CMakeLists.txt | 45 +++++++------------ .../chip-module/generate_factory_data.cmake | 12 +++++ .../telink/flash_overlays/1m_flash.overlay | 14 +++--- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index f7f4d5e6e332f3..56c500a7a0bb8d 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -188,37 +188,26 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_dependencies(chip-ota-image ${ZEPHYR_FINAL_EXECUTABLE}) endif() -if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE) - if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - if(${FLASH_SIZE} MATCHES 1m) - add_custom_target(merge_factory_data ALL - COMMAND - dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=540 - ) - elseif(${FLASH_SIZE} MATCHES 2m) - add_custom_target(merge_factory_data ALL - COMMAND - dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1052 - ) - elseif(${FLASH_SIZE} MATCHES 4m) - add_custom_target(merge_factory_data ALL - COMMAND - dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=2076 - ) - endif() - else() - add_custom_target(merge_factory_data ALL - COMMAND - dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1052 - ) - endif() - +if(${FLASH_SIZE} MATCHES 1m) + set(SEEK "980") +elseif(${FLASH_SIZE} MATCHES 2m) + set(SEEK "1052") +elseif(${FLASH_SIZE} MATCHES 4m) + set(SEEK "2076") +else() + set(SEEK "1052") +endif() -if (CONFIG_CHIP_OTA_IMAGE_BUILD) +if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE) + add_custom_target(merge_factory_data ALL + COMMAND + dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=SEEK + ) + if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_dependencies(merge_factory_data merge_mcuboot) -else() + else() add_dependencies(merge_factory_data ${ZEPHYR_FINAL_EXECUTABLE}) -endif() + endif() endif() # ============================================================================== diff --git a/config/telink/chip-module/generate_factory_data.cmake b/config/telink/chip-module/generate_factory_data.cmake index 9ba1903266c2dc..1d232325f94b39 100644 --- a/config/telink/chip-module/generate_factory_data.cmake +++ b/config/telink/chip-module/generate_factory_data.cmake @@ -116,6 +116,18 @@ if(CONFIG_CHIP_DEVICE_ENABLE_KEY) string(APPEND script_args "--enable-key \"${CONFIG_CHIP_DEVICE_ENABLE_KEY}\"\n") endif() +if(${FLASH_SIZE} MATCHES 1m) + set(SEEK "0xF5000") +elseif(${FLASH_SIZE} MATCHES 2m) + set(SEEK "0x107000") +elseif(${FLASH_SIZE} MATCHES 4m) + set(SEEK "0x207000") +else() + set(SEEK "0x107000") +endif() + +string(APPEND script_args "--offset ${SEEK}\n") + string(APPEND script_args "--output \"${output_path}\"/factory\n") set(factory_data_bin ${output_path}/factory/factory_data.bin) diff --git a/src/platform/telink/flash_overlays/1m_flash.overlay b/src/platform/telink/flash_overlays/1m_flash.overlay index 2b23839c445f6b..cbcfff6713b6a8 100644 --- a/src/platform/telink/flash_overlays/1m_flash.overlay +++ b/src/platform/telink/flash_overlays/1m_flash.overlay @@ -14,19 +14,15 @@ }; slot0_partition: partition@19000 { label = "image-0"; - reg = <0x19000 0x6e000>; + reg = <0x19000 0xDC000>; }; - factory_partition: partition@87000 { + factory_partition: partition@F5000 { label = "factory-data"; - reg = <0x87000 0x1000>; + reg = <0xF5000 0x1000>; }; - storage_partition: partition@88000 { + storage_partition: partition@F6000 { label = "storage"; - reg = <0x88000 0x8000>; - }; - slot1_partition: partition@90000 { - label = "image-1"; - reg = <0x90000 0x6e000>; + reg = <0xF6000 0x8000>; }; vendor_partition: partition@fe000 { label = "vendor-data"; From fb42174b4010d13d2ddca967ed3ca5cd99135cdc Mon Sep 17 00:00:00 2001 From: Dmytro Kashkarov Date: Wed, 11 Oct 2023 11:49:25 +0300 Subject: [PATCH 04/11] generate factory data for different flash sizes --- config/telink/chip-module/CMakeLists.txt | 10 +++++----- config/telink/chip-module/generate_factory_data.cmake | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 56c500a7a0bb8d..5c6af01cda6e81 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -189,19 +189,19 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD) endif() if(${FLASH_SIZE} MATCHES 1m) - set(SEEK "980") + set(FD_SEEK "980") elseif(${FLASH_SIZE} MATCHES 2m) - set(SEEK "1052") + set(FD_SEEK "1052") elseif(${FLASH_SIZE} MATCHES 4m) - set(SEEK "2076") + set(FD_SEEK "2076") else() - set(SEEK "1052") + set(FD_SEEK "1052") endif() if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE) add_custom_target(merge_factory_data ALL COMMAND - dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=SEEK + dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=${FD_SEEK} ) if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_dependencies(merge_factory_data merge_mcuboot) diff --git a/config/telink/chip-module/generate_factory_data.cmake b/config/telink/chip-module/generate_factory_data.cmake index 1d232325f94b39..489e4f96965624 100644 --- a/config/telink/chip-module/generate_factory_data.cmake +++ b/config/telink/chip-module/generate_factory_data.cmake @@ -117,16 +117,16 @@ string(APPEND script_args "--enable-key \"${CONFIG_CHIP_DEVICE_ENABLE_KEY}\"\n") endif() if(${FLASH_SIZE} MATCHES 1m) - set(SEEK "0xF5000") + set(FD_SEEK "0xF5000") elseif(${FLASH_SIZE} MATCHES 2m) - set(SEEK "0x107000") + set(FD_SEEK "0x107000") elseif(${FLASH_SIZE} MATCHES 4m) - set(SEEK "0x207000") + set(FD_SEEK "0x207000") else() - set(SEEK "0x107000") + set(FD_SEEK "0x107000") endif() -string(APPEND script_args "--offset ${SEEK}\n") +string(APPEND script_args "--offset ${FD_SEEK}\n") string(APPEND script_args "--output \"${output_path}\"/factory\n") From 3afbb594a06ca9fdcd12a0faa70b6b880686c953 Mon Sep 17 00:00:00 2001 From: Dmytro Kashkarov Date: Wed, 11 Oct 2023 14:01:56 +0300 Subject: [PATCH 05/11] generate factory data for different flash sizes --- config/telink/chip-module/generate_factory_data.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/telink/chip-module/generate_factory_data.cmake b/config/telink/chip-module/generate_factory_data.cmake index 489e4f96965624..db954bc624a21a 100644 --- a/config/telink/chip-module/generate_factory_data.cmake +++ b/config/telink/chip-module/generate_factory_data.cmake @@ -117,16 +117,16 @@ string(APPEND script_args "--enable-key \"${CONFIG_CHIP_DEVICE_ENABLE_KEY}\"\n") endif() if(${FLASH_SIZE} MATCHES 1m) - set(FD_SEEK "0xF5000") + set(FD_OFFSET "0xF5000") elseif(${FLASH_SIZE} MATCHES 2m) - set(FD_SEEK "0x107000") + set(FD_OFFSET "0x107000") elseif(${FLASH_SIZE} MATCHES 4m) - set(FD_SEEK "0x207000") + set(FD_OFFSET "0x207000") else() - set(FD_SEEK "0x107000") + set(FD_OFFSET "0x107000") endif() -string(APPEND script_args "--offset ${FD_SEEK}\n") +string(APPEND script_args "--offset ${FD_OFFSET}\n") string(APPEND script_args "--output \"${output_path}\"/factory\n") From 8c2eb408210586af434412ca6122874a9a5f2e94 Mon Sep 17 00:00:00 2001 From: Dmytro Kashkarov Date: Wed, 11 Oct 2023 15:58:14 +0300 Subject: [PATCH 06/11] generate factory data for different flash sizes --- .../telink/chip-module/generate_factory_data.cmake | 1 + .../air-quality-sensor-app/telink/CMakeLists.txt | 12 ++++++++++-- scripts/tools/telink/mfg_tool.py | 5 ++--- src/platform/telink/flash_overlays/1m_flash.overlay | 7 +++++++ src/platform/telink/flash_overlays/2m_flash.overlay | 7 +++++++ src/platform/telink/flash_overlays/4m_flash.overlay | 7 +++++++ 6 files changed, 34 insertions(+), 5 deletions(-) diff --git a/config/telink/chip-module/generate_factory_data.cmake b/config/telink/chip-module/generate_factory_data.cmake index db954bc624a21a..2ac45d43dfea00 100644 --- a/config/telink/chip-module/generate_factory_data.cmake +++ b/config/telink/chip-module/generate_factory_data.cmake @@ -127,6 +127,7 @@ else() endif() string(APPEND script_args "--offset ${FD_OFFSET}\n") +string(APPEND script_args "--size 0x1000\n") string(APPEND script_args "--output \"${output_path}\"/factory\n") diff --git a/examples/air-quality-sensor-app/telink/CMakeLists.txt b/examples/air-quality-sensor-app/telink/CMakeLists.txt index 9900d9bb4b5403..7ad5f6514435f6 100644 --- a/examples/air-quality-sensor-app/telink/CMakeLists.txt +++ b/examples/air-quality-sensor-app/telink/CMakeLists.txt @@ -31,13 +31,21 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() +if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") + message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") +else() + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + message(STATUS "Flash memory size is set to: 2mb") +endif() + if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${FLASH_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() set(CONF_FILE prj.conf) diff --git a/scripts/tools/telink/mfg_tool.py b/scripts/tools/telink/mfg_tool.py index 3725707d7c9c78..c55e1fe4ca3c4a 100644 --- a/scripts/tools/telink/mfg_tool.py +++ b/scripts/tools/telink/mfg_tool.py @@ -642,10 +642,9 @@ def base64_str(s): return base64.b64decode(s) basic_args.add_argument('--part_number', type=str, required=False, help='Provide human-readable product number') part_gen_args = parser.add_argument_group('Partition generator options') - part_gen_args.add_argument('--offset', type=allow_any_int, default=0x107000, + part_gen_args.add_argument('--offset', type=allow_any_int, help='Partition offset - an address in devices NVM memory, where factory data will be stored') - part_gen_args.add_argument('--size', type=allow_any_int, default=0x1000, - help='The maximum partition size') + part_gen_args.add_argument('--size', type=allow_any_int, help='The maximum partition size') args = parser.parse_args() diff --git a/src/platform/telink/flash_overlays/1m_flash.overlay b/src/platform/telink/flash_overlays/1m_flash.overlay index cbcfff6713b6a8..698d7721d5012c 100644 --- a/src/platform/telink/flash_overlays/1m_flash.overlay +++ b/src/platform/telink/flash_overlays/1m_flash.overlay @@ -1,3 +1,10 @@ +/* + * In case of change partitions size - check if factory data size is correct + * in matter/connectedhomeip/config/telink/chip-module/CMakeLists.txt, variable "FD_SEEK" + * Also check matter/connectedhomeip/config/telink/chip-module/generate_factory_data.cmake, + * variable "FD_OFFSET" and argument "size" + */ + &flash { reg = <0x20000000 0x100000>; diff --git a/src/platform/telink/flash_overlays/2m_flash.overlay b/src/platform/telink/flash_overlays/2m_flash.overlay index 1131283f8e7af9..8a12e9c02aad02 100644 --- a/src/platform/telink/flash_overlays/2m_flash.overlay +++ b/src/platform/telink/flash_overlays/2m_flash.overlay @@ -1,3 +1,10 @@ +/* + * In case of change partitions size - check if factory data size is correct + * in matter/connectedhomeip/config/telink/chip-module/CMakeLists.txt, variable "FD_SEEK" + * Also check matter/connectedhomeip/config/telink/chip-module/generate_factory_data.cmake, + * variable "FD_OFFSET" and argument "size" + */ + &flash { reg = <0x20000000 0x200000>; diff --git a/src/platform/telink/flash_overlays/4m_flash.overlay b/src/platform/telink/flash_overlays/4m_flash.overlay index b25c2951f623b0..52a3f1c9a6f2fc 100644 --- a/src/platform/telink/flash_overlays/4m_flash.overlay +++ b/src/platform/telink/flash_overlays/4m_flash.overlay @@ -1,3 +1,10 @@ +/* + * In case of change partitions size - check if factory data size is correct + * in matter/connectedhomeip/config/telink/chip-module/CMakeLists.txt, variable "FD_SEEK" + * Also check matter/connectedhomeip/config/telink/chip-module/generate_factory_data.cmake, + * variable "FD_OFFSET" and argument "size" + */ + &flash { reg = <0x20000000 0x400000>; From 1113a938ab646978b0e44df32023a84e43ffa61b Mon Sep 17 00:00:00 2001 From: Dmytro Kashkarov Date: Thu, 12 Oct 2023 14:44:30 +0300 Subject: [PATCH 07/11] generate factory data for different flash sizes --- config/telink/chip-module/CMakeLists.txt | 24 ++++++++++--------- .../chip-module/generate_factory_data.cmake | 20 +++++++--------- .../air-quality-sensor-app/telink/README.md | 8 ++++++- examples/all-clusters-app/telink/Readme.md | 8 ++++++- .../all-clusters-minimal-app/telink/Readme.md | 8 ++++++- examples/bridge-app/telink/README.md | 8 ++++++- examples/contact-sensor-app/telink/README.md | 8 ++++++- examples/light-switch-app/telink/README.md | 8 ++++++- examples/lighting-app/telink/README.md | 8 ++++++- examples/lock-app/telink/README.md | 8 ++++++- examples/ota-requestor-app/telink/Readme.md | 15 ++++++++---- examples/pump-app/telink/README.md | 8 ++++++- examples/pump-controller-app/telink/README.md | 8 ++++++- .../resource-monitoring-app/telink/README.md | 8 ++++++- examples/shell/telink/README.md | 6 +++++ examples/smoke-co-alarm-app/telink/README.md | 8 ++++++- .../telink/README.md | 8 ++++++- examples/thermostat/telink/Readme.md | 8 ++++++- examples/window-app/telink/README.md | 8 ++++++- 19 files changed, 144 insertions(+), 41 deletions(-) diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 5c6af01cda6e81..688a665aed18e7 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -165,6 +165,13 @@ else() unset(GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE) endif() +set(BLOCK_SIZE "1024") + +# get code-partition mcuboot_partition size +dt_nodelabel(dts_partition_path NODELABEL "boot_partition") +dt_reg_size(mcuboot_size PATH ${dts_partition_path}) +math(EXPR boot_blocks "${mcuboot_size} / ${BLOCK_SIZE}" OUTPUT_FORMAT DECIMAL) + if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_custom_target(build_mcuboot ALL COMMAND @@ -176,7 +183,7 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD) COMMAND dd if=${PROJECT_BINARY_DIR}/../modules/chip-module/build_mcuboot/zephyr/zephyr.bin of=${PROJECT_BINARY_DIR}/zephyr.bin COMMAND - dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=100 + dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=${BLOCK_SIZE} seek=${boot_blocks} ) chip_ota_image(chip-ota-image @@ -188,20 +195,15 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_dependencies(chip-ota-image ${ZEPHYR_FINAL_EXECUTABLE}) endif() -if(${FLASH_SIZE} MATCHES 1m) - set(FD_SEEK "980") -elseif(${FLASH_SIZE} MATCHES 2m) - set(FD_SEEK "1052") -elseif(${FLASH_SIZE} MATCHES 4m) - set(FD_SEEK "2076") -else() - set(FD_SEEK "1052") -endif() +# get code-partition factory_partition address +dt_nodelabel(dts_partition_path NODELABEL "factory_partition") +dt_reg_addr(factory_size PATH ${dts_partition_path}) +math(EXPR factory_blocks "${factory_size} / ${BLOCK_SIZE}" OUTPUT_FORMAT DECIMAL) if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE) add_custom_target(merge_factory_data ALL COMMAND - dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=${FD_SEEK} + dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=${BLOCK_SIZE} seek=${factory_blocks} ) if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_dependencies(merge_factory_data merge_mcuboot) diff --git a/config/telink/chip-module/generate_factory_data.cmake b/config/telink/chip-module/generate_factory_data.cmake index 2ac45d43dfea00..5dfaa8e839dc4e 100644 --- a/config/telink/chip-module/generate_factory_data.cmake +++ b/config/telink/chip-module/generate_factory_data.cmake @@ -116,18 +116,16 @@ if(CONFIG_CHIP_DEVICE_ENABLE_KEY) string(APPEND script_args "--enable-key \"${CONFIG_CHIP_DEVICE_ENABLE_KEY}\"\n") endif() -if(${FLASH_SIZE} MATCHES 1m) - set(FD_OFFSET "0xF5000") -elseif(${FLASH_SIZE} MATCHES 2m) - set(FD_OFFSET "0x107000") -elseif(${FLASH_SIZE} MATCHES 4m) - set(FD_OFFSET "0x207000") -else() - set(FD_OFFSET "0x107000") -endif() +# get code-partition factory_partition address +dt_nodelabel(dts_partition_path NODELABEL "factory_partition") +dt_reg_addr(factory_off PATH ${dts_partition_path}) + +# get code-partition factory_partition size +dt_nodelabel(dts_partition_path NODELABEL "factory_partition") +dt_reg_size(factory_size PATH ${dts_partition_path}) -string(APPEND script_args "--offset ${FD_OFFSET}\n") -string(APPEND script_args "--size 0x1000\n") +string(APPEND script_args "--offset ${factory_off}\n") +string(APPEND script_args "--size ${factory_size}\n") string(APPEND script_args "--output \"${output_path}\"/factory\n") diff --git a/examples/air-quality-sensor-app/telink/README.md b/examples/air-quality-sensor-app/telink/README.md index 371a26cc00639e..18dd481cfabc19 100644 --- a/examples/air-quality-sensor-app/telink/README.md +++ b/examples/air-quality-sensor-app/telink/README.md @@ -30,6 +30,12 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -115,7 +121,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/all-clusters-app/telink/Readme.md b/examples/all-clusters-app/telink/Readme.md index d83ba75fb1353b..a374fad4f69179 100644 --- a/examples/all-clusters-app/telink/Readme.md +++ b/examples/all-clusters-app/telink/Readme.md @@ -32,6 +32,12 @@ creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -117,7 +123,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/all-clusters-minimal-app/telink/Readme.md b/examples/all-clusters-minimal-app/telink/Readme.md index aa751fecabea42..cb99eb94c4834a 100644 --- a/examples/all-clusters-minimal-app/telink/Readme.md +++ b/examples/all-clusters-minimal-app/telink/Readme.md @@ -32,6 +32,12 @@ for creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -100,7 +106,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/bridge-app/telink/README.md b/examples/bridge-app/telink/README.md index 48ae3eaec0a6e6..188f32ebd990ae 100644 --- a/examples/bridge-app/telink/README.md +++ b/examples/bridge-app/telink/README.md @@ -109,6 +109,12 @@ defined: ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -262,7 +268,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/contact-sensor-app/telink/README.md b/examples/contact-sensor-app/telink/README.md index 3131839f440452..975817ffb96380 100755 --- a/examples/contact-sensor-app/telink/README.md +++ b/examples/contact-sensor-app/telink/README.md @@ -30,6 +30,12 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -119,7 +125,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/light-switch-app/telink/README.md b/examples/light-switch-app/telink/README.md index 10e2500ab457fd..487c75aca1c4f4 100755 --- a/examples/light-switch-app/telink/README.md +++ b/examples/light-switch-app/telink/README.md @@ -35,6 +35,12 @@ creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -240,7 +246,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/lighting-app/telink/README.md b/examples/lighting-app/telink/README.md index b09df9c49fe3aa..7192efe2182044 100644 --- a/examples/lighting-app/telink/README.md +++ b/examples/lighting-app/telink/README.md @@ -33,6 +33,12 @@ a reference for creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -205,7 +211,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/lock-app/telink/README.md b/examples/lock-app/telink/README.md index 9cca961b6262f6..6e60817f3587b6 100755 --- a/examples/lock-app/telink/README.md +++ b/examples/lock-app/telink/README.md @@ -33,6 +33,12 @@ a reference for creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -122,7 +128,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/ota-requestor-app/telink/Readme.md b/examples/ota-requestor-app/telink/Readme.md index 805f70a0d5435c..f8a7aee76231cb 100755 --- a/examples/ota-requestor-app/telink/Readme.md +++ b/examples/ota-requestor-app/telink/Readme.md @@ -26,6 +26,12 @@ ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -106,14 +112,15 @@ feature for another Telink example: - set CONFIG_CHIP_OTA_REQUESTOR=y in corresponding "prj.conf" configuration file. -- remove "boards/tlsr9518adk80d.overlay" file to enable 2MB flash storage. After build application with enabled OTA feature, use next binary files: -- zephyr_final.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider -- zephyr.bin - ignore this file. -- zephyr.signed.bin - ignore this file. + +All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in +corresponding “prj.conf” configuration file. Usage of OTA: diff --git a/examples/pump-app/telink/README.md b/examples/pump-app/telink/README.md index ca97a9ec18c32d..6cc8080edc99ea 100755 --- a/examples/pump-app/telink/README.md +++ b/examples/pump-app/telink/README.md @@ -34,6 +34,12 @@ reference for creating your own pump application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -123,7 +129,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/pump-controller-app/telink/README.md b/examples/pump-controller-app/telink/README.md index 41089fcc94a6ac..2593a42c1e95a2 100755 --- a/examples/pump-controller-app/telink/README.md +++ b/examples/pump-controller-app/telink/README.md @@ -35,6 +35,12 @@ your own pump application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -124,7 +130,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/resource-monitoring-app/telink/README.md b/examples/resource-monitoring-app/telink/README.md index 13962d281f43ac..c34a3a13a0e604 100644 --- a/examples/resource-monitoring-app/telink/README.md +++ b/examples/resource-monitoring-app/telink/README.md @@ -30,6 +30,12 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -115,7 +121,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/shell/telink/README.md b/examples/shell/telink/README.md index 19d115dc64cca1..f58033ff5c1d69 100755 --- a/examples/shell/telink/README.md +++ b/examples/shell/telink/README.md @@ -30,6 +30,12 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: diff --git a/examples/smoke-co-alarm-app/telink/README.md b/examples/smoke-co-alarm-app/telink/README.md index 185f68213a3271..51dc221200dc4d 100755 --- a/examples/smoke-co-alarm-app/telink/README.md +++ b/examples/smoke-co-alarm-app/telink/README.md @@ -30,6 +30,12 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -121,7 +127,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/temperature-measurement-app/telink/README.md b/examples/temperature-measurement-app/telink/README.md index ea722c693d7679..cd74d6f1f3165f 100644 --- a/examples/temperature-measurement-app/telink/README.md +++ b/examples/temperature-measurement-app/telink/README.md @@ -34,6 +34,12 @@ creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -104,7 +110,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/thermostat/telink/Readme.md b/examples/thermostat/telink/Readme.md index a1ff048488b436..5ee73590f4023b 100755 --- a/examples/thermostat/telink/Readme.md +++ b/examples/thermostat/telink/Readme.md @@ -30,6 +30,12 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -115,7 +121,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have diff --git a/examples/window-app/telink/README.md b/examples/window-app/telink/README.md index 876764c2fb0b88..f60e2bf39b86d1 100644 --- a/examples/window-app/telink/README.md +++ b/examples/window-app/telink/README.md @@ -33,6 +33,12 @@ for creating your own application. ```bash $ west build -b ``` + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, + for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + ```bash + $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m + ``` 4. Flash binary: @@ -186,7 +192,7 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). - zephyr-ota.bin - binary for OTA Provider All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have From a092bceab9d8366fb906e93c59aa73f2f9dca359 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 12 Oct 2023 15:37:13 +0300 Subject: [PATCH 08/11] [Telink] Update CI --- .github/workflows/examples-telink.yaml | 8 +++---- .../telink/factory_data.overlay | 22 ------------------- .../lighting-app/telink/factory_data.overlay | 22 ------------------- examples/lighting-app/telink/shell.overlay | 21 ------------------ .../telink/common/include/AppTaskCommon.h | 4 ++++ .../telink/common/src/AppTaskCommon.cpp | 4 ++++ scripts/build/build/targets.py | 2 ++ scripts/build/builders/telink.py | 16 +++++++++++--- .../build/testdata/all_targets_linux_x64.txt | 2 +- 9 files changed, 28 insertions(+), 73 deletions(-) delete mode 100644 examples/light-switch-app/telink/factory_data.overlay delete mode 100644 examples/lighting-app/telink/factory_data.overlay delete mode 100644 examples/lighting-app/telink/shell.overlay diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 34afad3e0657e0..e0eb5fb4db7c6e 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -124,10 +124,10 @@ jobs: - name: clean out build output (keep tools) run: rm -rf ./out/telink* - - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data + - name: Build example Telink (B91) Lighting App with OTA, RPC, Factory Data and 4Mb flash run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc-shell-factory-data' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-ota-rpc-factory-data-4mb' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ telink tlsr9518adk80d lighting-app-rpc-shell-factory-data \ out/telink-tlsr9518adk80d-light-rpc-shell-factory-data/zephyr/zephyr.elf \ @@ -136,10 +136,10 @@ jobs: - name: clean out build output (keep tools) run: rm -rf ./out/telink* - - name: Build example Telink (B92) Light Switch App with RPC, Shell and Factory Data + - name: Build example Telink (B92) Light Switch App with OTA, Shell, Factory Data run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-switch-rpc-shell-factory-data' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-switch-ota-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ telink tlsr9528a light-switch-app-rpc-shell-factory-data \ out/telink-tlsr9528a-light-switch-rpc-shell-factory-data/zephyr/zephyr.elf \ diff --git a/examples/light-switch-app/telink/factory_data.overlay b/examples/light-switch-app/telink/factory_data.overlay deleted file mode 100644 index 4f7289d9bd15ca..00000000000000 --- a/examples/light-switch-app/telink/factory_data.overlay +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# This file should be used as a configuration overlay to enable Factory Data. - -# Enable factory data support. -CONFIG_CHIP_FACTORY_DATA=y -CONFIG_CHIP_FACTORY_DATA_BUILD=y -CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=y diff --git a/examples/lighting-app/telink/factory_data.overlay b/examples/lighting-app/telink/factory_data.overlay deleted file mode 100644 index 4f7289d9bd15ca..00000000000000 --- a/examples/lighting-app/telink/factory_data.overlay +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# This file should be used as a configuration overlay to enable Factory Data. - -# Enable factory data support. -CONFIG_CHIP_FACTORY_DATA=y -CONFIG_CHIP_FACTORY_DATA_BUILD=y -CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=y diff --git a/examples/lighting-app/telink/shell.overlay b/examples/lighting-app/telink/shell.overlay deleted file mode 100644 index 6c4922bc475aeb..00000000000000 --- a/examples/lighting-app/telink/shell.overlay +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# This file should be used as a configuration overlay to enable Shell. - -# Enable Shell support. -CONFIG_SHELL=y -CONFIG_CHIP_LIB_SHELL=y diff --git a/examples/platform/telink/common/include/AppTaskCommon.h b/examples/platform/telink/common/include/AppTaskCommon.h index 7204df2ba4b7a9..6652a55210f601 100644 --- a/examples/platform/telink/common/include/AppTaskCommon.h +++ b/examples/platform/telink/common/include/AppTaskCommon.h @@ -76,8 +76,12 @@ class AppTaskCommon { kButtonId_ExampleAction = 1, kButtonId_FactoryReset, +#if APP_USE_THREAD_START_BUTTON kButtonId_StartThread, +#endif +#if APP_USE_BLE_START_BUTTON kButtonId_StartBleAdv +#endif } ButtonId; #endif diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp index 7a1a537d1110df..590fdba938aa10 100644 --- a/examples/platform/telink/common/src/AppTaskCommon.cpp +++ b/examples/platform/telink/common/src/AppTaskCommon.cpp @@ -386,12 +386,16 @@ void AppTaskCommon::ButtonEventHandler(ButtonId_t btnId, bool btnPressed) case kButtonId_FactoryReset: FactoryResetButtonEventHandler(); break; +#if APP_USE_THREAD_START_BUTTON case kButtonId_StartThread: StartThreadButtonEventHandler(); break; +#endif +#if APP_USE_BLE_START_BUTTON case kButtonId_StartBleAdv: StartBleAdvButtonEventHandler(); break; +#endif } } #endif diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index c1b0fad61be8ff..086bebd2c0753d 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -715,9 +715,11 @@ def BuildTelinkTarget(): TargetPart('window-covering', app=TelinkApp.WINDOW_COVERING), ]) + target.AppendModifier('ota', enable_ota=True) target.AppendModifier('shell', enable_shell=True) target.AppendModifier('rpc', enable_rpcs=True) target.AppendModifier('factory-data', enable_factory_data=True) + target.AppendModifier('4mb', enable_4mb_flash=True) return target diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index 9487a17a36dbb0..39bdbe9675a2ad 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -136,15 +136,19 @@ def __init__(self, runner, app: TelinkApp = TelinkApp, board: TelinkBoard = TelinkBoard, + enable_ota: bool = False, enable_shell: bool = False, enable_rpcs: bool = False, - enable_factory_data: bool = False): + enable_factory_data: bool = False, + enable_4mb_flash: bool = False): super(TelinkBuilder, self).__init__(root, runner) self.app = app self.board = board + self.enable_ota = enable_ota self.enable_shell = enable_shell self.enable_rpcs = enable_rpcs self.enable_factory_data = enable_factory_data + self.enable_4mb_flash = enable_4mb_flash def get_cmd_prefixes(self): if not self._runner.dry_run: @@ -165,14 +169,20 @@ def generate(self): return flags = [] + if self.enable_ota: + flags.append("-DCONFIG_CHIP_OTA_REQUESTOR=y") + if self.enable_shell: - flags.append("-DOVERLAY_CONFIG=shell.overlay") + flags.append("-DCONFIG_CHIP_LIB_SHELL=y") if self.enable_rpcs: flags.append("-DOVERLAY_CONFIG=rpc.overlay") if self.enable_factory_data: - flags.append("-DOVERLAY_CONFIG=factory_data.overlay") + flags.append("-DCONFIG_CHIP_FACTORY_DATA=y -DCONFIG_CHIP_FACTORY_DATA_BUILD=y -DCONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=y") + + if self.enable_4mb_flash: + flags.append("-DFLASH_SIZE=4m") if self.options.pregen_dir: flags.append(f"-DCHIP_CODEGEN_PREGEN_DIR={shlex.quote(self.options.pregen_dir)}") diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index dd29ccecea337c..37cd6ed4255c15 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -22,5 +22,5 @@ nrf-native-posix-64-tests qpg-qpg6105-{lock,light,shell,persistent-storage} stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan] -telink-{tlsr9518adk80d,tlsr9528a}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,resource-monitoring,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] +telink-{tlsr9518adk80d,tlsr9528a}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,resource-monitoring,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-shell][-rpc][-factory-data][-4mb] openiotsdk-{shell,lock}[-mbedtls][-psa] From 35af829b58a2abc6339ba8d983a766296854c395 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 12 Oct 2023 15:41:41 +0300 Subject: [PATCH 09/11] [Telink] change path --- examples/air-quality-sensor-app/telink/CMakeLists.txt | 6 +++--- examples/all-clusters-app/telink/CMakeLists.txt | 6 +++--- examples/all-clusters-minimal-app/telink/CMakeLists.txt | 6 +++--- examples/bridge-app/telink/CMakeLists.txt | 6 +++--- examples/chef/telink/CMakeLists.txt | 6 +++--- examples/contact-sensor-app/telink/CMakeLists.txt | 6 +++--- examples/light-switch-app/telink/CMakeLists.txt | 6 +++--- examples/lighting-app/telink/CMakeLists.txt | 6 +++--- examples/lock-app/telink/CMakeLists.txt | 6 +++--- examples/ota-requestor-app/telink/CMakeLists.txt | 6 +++--- examples/pump-app/telink/CMakeLists.txt | 6 +++--- examples/pump-controller-app/telink/CMakeLists.txt | 6 +++--- examples/resource-monitoring-app/telink/CMakeLists.txt | 6 +++--- examples/shell/telink/CMakeLists.txt | 6 +++--- examples/smoke-co-alarm-app/telink/CMakeLists.txt | 6 +++--- examples/temperature-measurement-app/telink/CMakeLists.txt | 6 +++--- examples/thermostat/telink/CMakeLists.txt | 6 +++--- examples/window-app/telink/CMakeLists.txt | 6 +++--- src/platform/telink/{flash_overlays => }/1m_flash.overlay | 0 src/platform/telink/{flash_overlays => }/2m_flash.overlay | 0 src/platform/telink/{flash_overlays => }/4m_flash.overlay | 0 21 files changed, 54 insertions(+), 54 deletions(-) rename src/platform/telink/{flash_overlays => }/1m_flash.overlay (100%) rename src/platform/telink/{flash_overlays => }/2m_flash.overlay (100%) rename src/platform/telink/{flash_overlays => }/4m_flash.overlay (100%) diff --git a/examples/air-quality-sensor-app/telink/CMakeLists.txt b/examples/air-quality-sensor-app/telink/CMakeLists.txt index 7ad5f6514435f6..24a18cecffc71c 100644 --- a/examples/air-quality-sensor-app/telink/CMakeLists.txt +++ b/examples/air-quality-sensor-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index 1662d4a5c1a6b0..f0300c3b1d6b9f 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -32,11 +32,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/all-clusters-minimal-app/telink/CMakeLists.txt b/examples/all-clusters-minimal-app/telink/CMakeLists.txt index c3df35f25a0fbd..c7d1eb8a55d925 100644 --- a/examples/all-clusters-minimal-app/telink/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/telink/CMakeLists.txt @@ -32,11 +32,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/bridge-app/telink/CMakeLists.txt b/examples/bridge-app/telink/CMakeLists.txt index 880c19bb9c624d..9438372ea2b8e9 100644 --- a/examples/bridge-app/telink/CMakeLists.txt +++ b/examples/bridge-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/chef/telink/CMakeLists.txt b/examples/chef/telink/CMakeLists.txt index da859bbd7839fb..38f45f92d0eec9 100755 --- a/examples/chef/telink/CMakeLists.txt +++ b/examples/chef/telink/CMakeLists.txt @@ -38,11 +38,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/contact-sensor-app/telink/CMakeLists.txt b/examples/contact-sensor-app/telink/CMakeLists.txt index 8ebe6f44783fde..145653288e1b0d 100755 --- a/examples/contact-sensor-app/telink/CMakeLists.txt +++ b/examples/contact-sensor-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/light-switch-app/telink/CMakeLists.txt b/examples/light-switch-app/telink/CMakeLists.txt index 2b7ddca286fc59..6e5877fa53232a 100755 --- a/examples/light-switch-app/telink/CMakeLists.txt +++ b/examples/light-switch-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index b2a9a6a61e733e..ae9475a1ea62fc 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -48,11 +48,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/lock-app/telink/CMakeLists.txt b/examples/lock-app/telink/CMakeLists.txt index 68da40303ef367..95c8a225c51878 100755 --- a/examples/lock-app/telink/CMakeLists.txt +++ b/examples/lock-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/ota-requestor-app/telink/CMakeLists.txt b/examples/ota-requestor-app/telink/CMakeLists.txt index 01034b21c9612f..81bfef4e710d3e 100644 --- a/examples/ota-requestor-app/telink/CMakeLists.txt +++ b/examples/ota-requestor-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/pump-app/telink/CMakeLists.txt b/examples/pump-app/telink/CMakeLists.txt index 8a31b18742fb5c..846eb3180ca027 100755 --- a/examples/pump-app/telink/CMakeLists.txt +++ b/examples/pump-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/pump-controller-app/telink/CMakeLists.txt b/examples/pump-controller-app/telink/CMakeLists.txt index ac50a7fdb4718d..6d07c242352b4b 100755 --- a/examples/pump-controller-app/telink/CMakeLists.txt +++ b/examples/pump-controller-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/resource-monitoring-app/telink/CMakeLists.txt b/examples/resource-monitoring-app/telink/CMakeLists.txt index ef2e79c3f9d119..3bc56cfbaa161b 100644 --- a/examples/resource-monitoring-app/telink/CMakeLists.txt +++ b/examples/resource-monitoring-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/shell/telink/CMakeLists.txt b/examples/shell/telink/CMakeLists.txt index f5cb01ca721492..0bd2d490411bec 100755 --- a/examples/shell/telink/CMakeLists.txt +++ b/examples/shell/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/smoke-co-alarm-app/telink/CMakeLists.txt b/examples/smoke-co-alarm-app/telink/CMakeLists.txt index 05d00ebde9405e..e9ecc7a36a71ea 100755 --- a/examples/smoke-co-alarm-app/telink/CMakeLists.txt +++ b/examples/smoke-co-alarm-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/temperature-measurement-app/telink/CMakeLists.txt b/examples/temperature-measurement-app/telink/CMakeLists.txt index 24461249085000..e6360e44003500 100644 --- a/examples/temperature-measurement-app/telink/CMakeLists.txt +++ b/examples/temperature-measurement-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/thermostat/telink/CMakeLists.txt b/examples/thermostat/telink/CMakeLists.txt index ff18cdbd46dea4..6570057c3c0765 100755 --- a/examples/thermostat/telink/CMakeLists.txt +++ b/examples/thermostat/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/examples/window-app/telink/CMakeLists.txt b/examples/window-app/telink/CMakeLists.txt index a18e960ded0722..58daebe6d318b0 100644 --- a/examples/window-app/telink/CMakeLists.txt +++ b/examples/window-app/telink/CMakeLists.txt @@ -31,11 +31,11 @@ else() unset(GLOBAL_DTC_OVERLAY_FILE) endif() -if(EXISTS "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/${FLASH_SIZE}_flash.overlay") +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${FLASH_SIZE}_flash.overlay") message(STATUS "Flash memory size is set to: " ${FLASH_SIZE} "b") else() - set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/flash_overlays/2m_flash.overlay") + set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/2m_flash.overlay") message(STATUS "Flash memory size is set to: 2mb") endif() diff --git a/src/platform/telink/flash_overlays/1m_flash.overlay b/src/platform/telink/1m_flash.overlay similarity index 100% rename from src/platform/telink/flash_overlays/1m_flash.overlay rename to src/platform/telink/1m_flash.overlay diff --git a/src/platform/telink/flash_overlays/2m_flash.overlay b/src/platform/telink/2m_flash.overlay similarity index 100% rename from src/platform/telink/flash_overlays/2m_flash.overlay rename to src/platform/telink/2m_flash.overlay diff --git a/src/platform/telink/flash_overlays/4m_flash.overlay b/src/platform/telink/4m_flash.overlay similarity index 100% rename from src/platform/telink/flash_overlays/4m_flash.overlay rename to src/platform/telink/4m_flash.overlay From cab5ae6e333c77c4bd96b7015b68ef8548185a9e Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 12 Oct 2023 12:48:43 +0000 Subject: [PATCH 10/11] Restyled by prettier-markdown --- examples/air-quality-sensor-app/telink/README.md | 5 +++-- examples/all-clusters-app/telink/Readme.md | 5 +++-- examples/all-clusters-minimal-app/telink/Readme.md | 5 +++-- examples/bridge-app/telink/README.md | 5 +++-- examples/contact-sensor-app/telink/README.md | 5 +++-- examples/light-switch-app/telink/README.md | 5 +++-- examples/lighting-app/telink/README.md | 5 +++-- examples/lock-app/telink/README.md | 5 +++-- examples/ota-requestor-app/telink/Readme.md | 5 +++-- examples/pump-app/telink/README.md | 5 +++-- examples/pump-controller-app/telink/README.md | 5 +++-- examples/resource-monitoring-app/telink/README.md | 5 +++-- examples/shell/telink/README.md | 5 +++-- examples/smoke-co-alarm-app/telink/README.md | 5 +++-- examples/temperature-measurement-app/telink/README.md | 5 +++-- examples/thermostat/telink/Readme.md | 5 +++-- examples/window-app/telink/README.md | 5 +++-- 17 files changed, 51 insertions(+), 34 deletions(-) diff --git a/examples/air-quality-sensor-app/telink/README.md b/examples/air-quality-sensor-app/telink/README.md index 18dd481cfabc19..eecc7e8bbdbaa6 100644 --- a/examples/air-quality-sensor-app/telink/README.md +++ b/examples/air-quality-sensor-app/telink/README.md @@ -30,8 +30,9 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/all-clusters-app/telink/Readme.md b/examples/all-clusters-app/telink/Readme.md index a374fad4f69179..a8881b7fdeb024 100644 --- a/examples/all-clusters-app/telink/Readme.md +++ b/examples/all-clusters-app/telink/Readme.md @@ -32,8 +32,9 @@ creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/all-clusters-minimal-app/telink/Readme.md b/examples/all-clusters-minimal-app/telink/Readme.md index cb99eb94c4834a..53c750b806baf7 100644 --- a/examples/all-clusters-minimal-app/telink/Readme.md +++ b/examples/all-clusters-minimal-app/telink/Readme.md @@ -32,8 +32,9 @@ for creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/bridge-app/telink/README.md b/examples/bridge-app/telink/README.md index 188f32ebd990ae..fd3d70c21e9b84 100644 --- a/examples/bridge-app/telink/README.md +++ b/examples/bridge-app/telink/README.md @@ -109,8 +109,9 @@ defined: ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/contact-sensor-app/telink/README.md b/examples/contact-sensor-app/telink/README.md index 975817ffb96380..cef7f3364dd7dd 100755 --- a/examples/contact-sensor-app/telink/README.md +++ b/examples/contact-sensor-app/telink/README.md @@ -30,8 +30,9 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/light-switch-app/telink/README.md b/examples/light-switch-app/telink/README.md index 487c75aca1c4f4..6dc9970c5c732e 100755 --- a/examples/light-switch-app/telink/README.md +++ b/examples/light-switch-app/telink/README.md @@ -35,8 +35,9 @@ creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/lighting-app/telink/README.md b/examples/lighting-app/telink/README.md index 7192efe2182044..666af084b2a8bf 100644 --- a/examples/lighting-app/telink/README.md +++ b/examples/lighting-app/telink/README.md @@ -33,8 +33,9 @@ a reference for creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/lock-app/telink/README.md b/examples/lock-app/telink/README.md index 6e60817f3587b6..2d8e0349d571a1 100755 --- a/examples/lock-app/telink/README.md +++ b/examples/lock-app/telink/README.md @@ -33,8 +33,9 @@ a reference for creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/ota-requestor-app/telink/Readme.md b/examples/ota-requestor-app/telink/Readme.md index f8a7aee76231cb..867f498f9df917 100755 --- a/examples/ota-requestor-app/telink/Readme.md +++ b/examples/ota-requestor-app/telink/Readme.md @@ -26,8 +26,9 @@ ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/pump-app/telink/README.md b/examples/pump-app/telink/README.md index 6cc8080edc99ea..a5a656c68adeea 100755 --- a/examples/pump-app/telink/README.md +++ b/examples/pump-app/telink/README.md @@ -34,8 +34,9 @@ reference for creating your own pump application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/pump-controller-app/telink/README.md b/examples/pump-controller-app/telink/README.md index 2593a42c1e95a2..14153386de3b5e 100755 --- a/examples/pump-controller-app/telink/README.md +++ b/examples/pump-controller-app/telink/README.md @@ -35,8 +35,9 @@ your own pump application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/resource-monitoring-app/telink/README.md b/examples/resource-monitoring-app/telink/README.md index c34a3a13a0e604..3b6645171511e0 100644 --- a/examples/resource-monitoring-app/telink/README.md +++ b/examples/resource-monitoring-app/telink/README.md @@ -30,8 +30,9 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/shell/telink/README.md b/examples/shell/telink/README.md index f58033ff5c1d69..2ff00f0046473f 100755 --- a/examples/shell/telink/README.md +++ b/examples/shell/telink/README.md @@ -30,8 +30,9 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/smoke-co-alarm-app/telink/README.md b/examples/smoke-co-alarm-app/telink/README.md index 51dc221200dc4d..f36ecb97d5925e 100755 --- a/examples/smoke-co-alarm-app/telink/README.md +++ b/examples/smoke-co-alarm-app/telink/README.md @@ -30,8 +30,9 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/temperature-measurement-app/telink/README.md b/examples/temperature-measurement-app/telink/README.md index cd74d6f1f3165f..fda373eedf2ca9 100644 --- a/examples/temperature-measurement-app/telink/README.md +++ b/examples/temperature-measurement-app/telink/README.md @@ -34,8 +34,9 @@ creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/thermostat/telink/Readme.md b/examples/thermostat/telink/Readme.md index 5ee73590f4023b..b73e5866b03173 100755 --- a/examples/thermostat/telink/Readme.md +++ b/examples/thermostat/telink/Readme.md @@ -30,8 +30,9 @@ You can use this example as a reference for creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m diff --git a/examples/window-app/telink/README.md b/examples/window-app/telink/README.md index f60e2bf39b86d1..372dbcf8dba809 100644 --- a/examples/window-app/telink/README.md +++ b/examples/window-app/telink/README.md @@ -33,8 +33,9 @@ for creating your own application. ```bash $ west build -b ``` - Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 MB, - for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: + + Also use key `-DFLASH_SIZE`, if your board has memory size different from 2 + MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`: ```bash $ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m From 99e825476b0d3857cbc017f1ccc24b2b634d502e Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 12 Oct 2023 17:47:21 +0300 Subject: [PATCH 11/11] [Telink] set correct app name --- .github/workflows/examples-telink.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index e0eb5fb4db7c6e..0f7a42d4ab8a04 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -129,8 +129,8 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-ota-rpc-factory-data-4mb' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-rpc-shell-factory-data \ - out/telink-tlsr9518adk80d-light-rpc-shell-factory-data/zephyr/zephyr.elf \ + telink tlsr9518adk80d lighting-app-ota-rpc-factory-data-4mb \ + out/telink-tlsr9518adk80d-light-ota-rpc-factory-data-4mb/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output (keep tools) @@ -141,8 +141,8 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-switch-ota-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9528a light-switch-app-rpc-shell-factory-data \ - out/telink-tlsr9528a-light-switch-rpc-shell-factory-data/zephyr/zephyr.elf \ + telink tlsr9528a light-switch-app-ota-shell-factory-data \ + out/telink-tlsr9528a-light-switch-ota-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output