TL7218X Retention Light-Switch App Build Guide#
1. 2MB Flash (Matter only, NO OTA/MCUBoot, NO LZMA)#
Kconfig: boards/tl7218x_retention.conf (default)
CONFIG_CHIP_OTA_REQUESTOR=n
CONFIG_CHIP_DFU_OVER_BT_SMP=n, CONFIG_CHIP_DFU_OVER_BT_SMP_BUILD=n,
CONFIG_LZMA=n, CONFIG_COMPRESS_LZMA=n
CONFIG_DUAL_MODE=0
Note: This configuration disables OTA, does not use MCUBoot, and cannot be upgraded
DTS Overlay: src/platform/telink/tl7218x_2m_flash.overlay (default)
slot0: 0x15000, size 0xe5000 (916KB)
slot1: 0xfa000, size 0xe6000 (920KB)
Build:
west build -p -b tl7218x_retention -d build_tl7218x_retention_default -- \
> build_tl7218x_retention_default.log
# Kconfig: default (boards/tl7218x_retention.conf)
# DTS Overlay: default (src/platform/telink/tl7218x_2m_flash.overlay)
Output:
build_tl7218x_retention_default/zephyr/zephyr.bin -> flash this
2. 2MB Flash (Matter only, enable BT DFU, LZMA compressed, SW - 1 and 2)#
IMPORTANT: LZMA compression is REQUIRED for 2MB flash with OTA.
Kconfig: boards/tl7218x_retention_ota_lzma.conf (explicitly specified)
CONFIG_CHIP_OTA_REQUESTOR=y
CONFIG_CHIP_DFU_OVER_BT_SMP=y, CONFIG_CHIP_DFU_OVER_BT_SMP_BUILD=y,
CONFIG_LZMA=y, CONFIG_COMPRESS_LZMA=y
CONFIG_DUAL_MODE=0
DTS Overlay: src/platform/telink/tl7218x_2m_flash_lzma.overlay (default)
Build Software Version 1:
west build -p -b tl7218x_retention -d build_tl7218x_retention_lzma_v1 -- \
-DCONF_FILE="prj.conf boards/tl7218x_retention_ota_lzma.conf" \
-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION=1 > build_tl7218x_retention_lzma_v1.log
# Kconfig: explicitly specified (-DCONF_FILE="prj.conf boards/tl7218x_retention_ota_lzma.conf")
# DTS Overlay: default (src/platform/telink/tl7218x_2m_flash_lzma.overlay)
Build Software Version 2:
west build -p -b tl7218x_retention -d build_tl7218x_retention_lzma_v2 -- \
-DCONF_FILE="prj.conf boards/tl7218x_retention_ota_lzma.conf" \
-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 > build_tl7218x_retention_lzma_v2.log
# Kconfig: explicitly specified (-DCONF_FILE="prj.conf boards/tl7218x_retention_ota_lzma.conf")
# DTS Overlay: default (src/platform/telink/tl7218x_2m_flash_lzma.overlay)
Output:
build_tl7218x_retention_lzma_v1/zephyr/merged.bin -> flash this
build_tl7218x_retention_lzma_v2/zephyr/merged_dfu.lzma.bin -> DFU over BLE SMP
build_tl7218x_retention_lzma_v2/zephyr/matter.ota -> OTA upgrade
3. WARNING: 2MB Flash with OTA but NO LZMA (NOT RECOMMENDED)#
This configuration will show a warning during build and may fail at link time.
Kconfig: boards/tl7218x_retention_ota.conf (explicitly specified)
CONFIG_CHIP_OTA_REQUESTOR=y
CONFIG_CHIP_DFU_OVER_BT_SMP=y, CONFIG_CHIP_DFU_OVER_BT_SMP_BUILD=y,
CONFIG_LZMA=n, CONFIG_COMPRESS_LZMA=n
CONFIG_DUAL_MODE=0
WARNING: Building this configuration will show a warning:
“tl7218x with 2MB flash and OTA requires LZMA compression. Please use a config with ‘lzma’ suffix and set CONFIG_COMPRESS_LZMA=y. Continuing compilation anyway…”
Note: Build may fail at link time if firmware size exceeds 916KB (0xe5000) partition limit.
Solution: Use the LZMA-enabled configuration (target #2) instead.
Important Note: TL7218X does NOT support dual_mode (Matter + Zigbee) configuration.
4. Low Power: Fully Disable BLE After Commissioning (Concurrent Mode)#
Kconfig: boards/tl7218x_retention_ble_off.conf (add to CONF_FILE)
CONFIG_CHIP_CONCURRENT_BLE_OFF_AFTER_COMMISSIONING=yCONFIG_CHIP_CONCURRENT_BLE_RESUME_AFTER_COMMISSIONING=y
Note: After Matter commissioning completes (or on reboot of an already
commissioned device), the BLE stack is torn down entirely and the RF is handed
to 802.15.4, so the device reaches its lowest power state. With
CONFIG_CHIP_CONCURRENT_BLE_RESUME_AFTER_COMMISSIONING this is reversible: the
Start BLE advertising button re-enables BLE and starts a connectable
advertisement while the device stays on Thread, so no factory reset is needed.
Note: This configuration requires CONFIG_PM=y (the teardown relies on
tlx_bt_802154_dual_mode_suspend()/resume(), which are built only under
CONFIG_PM). For line-powered (CONFIG_PM=n) devices that only need to stop
advertising after commissioning but keep BLE available on demand, use
CONFIG_CHIP_CONCURRENT_BLE_IDLE=y instead.
Build:
cd ~/connectedhomeip/examples/light-switch-app/telink
west build -p -b tl7218x_retention \
-d ~/connectedhomeip/examples/light-switch-app/telink/build_tl7218x_retention_concurrent_off \
~/connectedhomeip/examples/light-switch-app/telink -- \
-DCONF_FILE="prj.conf boards/tl7218x_retention_concurrent.conf boards/tl7218x_retention_ble_off.conf" \
> build_tl7218x_retention_concurrent_off.log
Output:
build_tl7218x_retention_concurrent_off/zephyr/merged.bin -> flash this
Build with OTA (LZMA):
Kconfig: boards/tl7218x_retention_concurrent.conf +
boards/tl7218x_retention_ble_off.conf +
boards/tl7218x_retention_ota_lzma.conf
Build Software Version 1:
cd ~/connectedhomeip/examples/light-switch-app/telink
west build -p -b tl7218x_retention \
-d ~/connectedhomeip/examples/light-switch-app/telink/build_tl7218x_retention_concurrent_off_ota_v1 \
~/connectedhomeip/examples/light-switch-app/telink -- \
-DCONF_FILE="prj.conf boards/tl7218x_retention_concurrent.conf boards/tl7218x_retention_ble_off.conf boards/tl7218x_retention_ota_lzma.conf" \
-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION=1 \
> build_tl7218x_retention_concurrent_off_ota_v1.log
Build Software Version 2:
cd ~/connectedhomeip/examples/light-switch-app/telink
west build -p -b tl7218x_retention \
-d ~/connectedhomeip/examples/light-switch-app/telink/build_tl7218x_retention_concurrent_off_ota_v2 \
~/connectedhomeip/examples/light-switch-app/telink -- \
-DCONF_FILE="prj.conf boards/tl7218x_retention_concurrent.conf boards/tl7218x_retention_ble_off.conf boards/tl7218x_retention_ota_lzma.conf" \
-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 \
> build_tl7218x_retention_concurrent_off_ota_v2.log
Output:
build_tl7218x_retention_concurrent_off_ota_v1/zephyr/merged.bin -> flash this
build_tl7218x_retention_concurrent_off_ota_v2/zephyr/merged_dfu.lzma.bin -> DFU over BLE SMP
build_tl7218x_retention_concurrent_off_ota_v2/zephyr/matter.ota -> OTA upgrade