Skip to content

Commit

Permalink
[Telink] RAM/ROM optimization & Update Telink image to 12 (#29373)
Browse files Browse the repository at this point in the history
* [Telink] Disabled MBEDTLS_TEST and MBEDTLS_ERROR_C (saved 7Kb of flash)

* [Telink] Disabled debug logs (saved 11.5Kb of flash)

* [Telink] Disable all unused buttons

* [Telink] Enable all buttons by default

* [Telink] Disable Interaction model Event support in server

* [Telink] Reduce number of message buffers in the buffer pool

* [Telink] Set packet buffer pool size into 0

* [Telink] Decrease stack and buffer size

* [Telink] Update Stack sizes

* [Telink] Use B9X

* [Telink] Use LAMBDA_EVENT_SIZE minimal value to build OTA

* [Telink] Use Kconfigs and make PM dependency

* [Telink] Set BLE device name via config

* [Telink] Fix after tests

* [Telink] decrease some values for FTD as well

* [Telink]: Added public BLE MAC readout from vendor flash section
The BLE MAC can be generated randomly or read from flash area.

* [Telink] Increase BLE_CTRL_THREAD_STACK after B92 BLE stack update

* [Telink] Update Telink image to 12

* [Telink] Enable NL_ASSERT_USE_FLAGS by default

* [Telink] Increase stack size after OTA tests

* [Telink] minor chnages

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jan 9, 2024
1 parent f4e419c commit d37fe97
Show file tree
Hide file tree
Showing 134 changed files with 1,084 additions and 1,116 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-telink:10
image: ghcr.io/project-chip/chip-build-telink:12
options: --user root

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-telink:10
image: ghcr.io/project-chip/chip-build-telink:12
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"

Expand Down
147 changes: 0 additions & 147 deletions config/telink/app/zephyr.conf

This file was deleted.

4 changes: 2 additions & 2 deletions config/telink/chip-gn/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ chip_device_platform = "telink"

chip_build_tests = false

chip_project_config_include = ""
chip_system_project_config_include = ""
chip_project_config_include = "<CHIPProjectConfig.h>"
chip_system_project_config_include = "<CHIPProjectConfig.h>"
chip_ble_project_config_include = ""

chip_crypto = "mbedtls"
Expand Down
4 changes: 4 additions & 0 deletions config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ if (CONFIG_POSIX_API)
matter_add_flags(-isystem${ZEPHYR_BASE}/include/zephyr/posix)
endif()

matter_add_flags(-DNL_ASSERT_USE_FLAGS_DEFAULT=1)

zephyr_include_directories(${CHIP_ROOT}/src/platform/telink/)

zephyr_get_compile_flags(ZEPHYR_CFLAGS_C C)
Expand All @@ -61,6 +63,8 @@ matter_add_cxxflags("${ZEPHYR_CFLAGS_CC}")
zephyr_get_gnu_cpp_standard(ZEPHYR_GNU_CPP_STD)
matter_add_cxxflags(${ZEPHYR_GNU_CPP_STD})

matter_add_flags(-DMBEDTLS_USER_CONFIG_FILE=<telink-mbedtls-config.h>)

# Set up custom OpenThread configuration

if (CONFIG_CHIP_OPENTHREAD_CONFIG)
Expand Down
24 changes: 14 additions & 10 deletions config/telink/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

rsource "../../zephyr/Kconfig"

if CHIP

# See config/zephyr/Kconfig for full definition
config CHIP_DEVICE_VENDOR_NAME
default "Telink semiconductor"
default "Telink Semiconductor"

config CHIP_APP_LOG_LEVEL
int "Logging level in application"
Expand All @@ -33,27 +35,28 @@ config CHIP_APP_LOG_LEVEL
# See config/zephyr/Kconfig for full definition
config CHIP_OTA_REQUESTOR
bool
default y
imply BOOTLOADER_MCUBOOT
imply IMG_MANAGER
select BOOTLOADER_MCUBOOT
select IMG_MANAGER
select STREAM_FLASH
select STREAM_FLASH_ERASE

config CHIP_OTA_REQUESTOR_BUFFER_SIZE
int "OTA Requestor image buffer size"
default 256
depends on CHIP_OTA_REQUESTOR
help
Configures size of the buffer used by OTA Requestor when downloading and
writing a new firmware image to flash.
Configures the size of the buffer used by OTA Requestor when downloading
and writing a new firmware image to flash.

config CHIP_OTA_REQUESTOR_REBOOT_ON_APPLY
bool "Auto-reboot when firmware update is applied"
default y
depends on CHIP_OTA_REQUESTOR
imply REBOOT
help
When a user consents to apply a firmware update, and the update package is
downloaded, reboot the device automatically to swap the old and the new
firmware images.
Reboots the device automatically after downloading a new firmware update
to swap the old and the new firmware images. The reboot happens only when
a user consents to apply the firmware update.

# See config/zephyr/Kconfig for full definition
config CHIP_OTA_IMAGE_BUILD
Expand Down Expand Up @@ -149,9 +152,10 @@ config CHIP_FACTORY_RESET_ERASE_NVS
bool
default n

endif

config CHIP_LOG_SIZE_OPTIMIZATION
bool "Disable some detailed logs to decrease flash usage"
default y
help
Disables some log levels for specific Matter log modules that provide
information that is too detailed to be used in most cases. You can find
Expand Down
Loading

0 comments on commit d37fe97

Please sign in to comment.