Skip to content

Commit

Permalink
riscv: telink:tl3218x: add ble optimize.
Browse files Browse the repository at this point in the history
- add optimize for ble.
- low down the ramcost.

Signed-off-by: Haiwen Xia <[email protected]>
  • Loading branch information
haiwentelink committed Sep 13, 2024
1 parent cbebbec commit 7944b65
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
platform: telink
- name: Update Zephyr to specific revision (for developers purpose)
shell: bash
run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py e9249e2769bde058c729a9b1f940bfc8b35958a3"
run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py fdeaf68638c2a2a5343e884be8a367dbe5a53c42"
- name: CI Examples Telink
shell: bash
run: |
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 @@ -57,7 +57,7 @@ jobs:
gh-context: ${{ toJson(github) }}

- name: Update Zephyr to specific revision (for developers purpose)
run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py e9249e2769bde058c729a9b1f940bfc8b35958a3"
run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py fdeaf68638c2a2a5343e884be8a367dbe5a53c42"

- name: Build example Telink (B92 retention) Air Quality Sensor App
run: |
Expand Down
9 changes: 6 additions & 3 deletions config/telink/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ choice LOG_MODE
endchoice

choice MATTER_LOG_LEVEL_CHOICE
default MATTER_LOG_LEVEL_WRN if SOC_RISCV_TELINK_TL321X
default MATTER_LOG_LEVEL_DBG
endchoice

config CHIP_APP_LOG_LEVEL
default 4 if SOC_RISCV_TELINK_TL321X # certify should be 2
default 4 # debug

config LOG_DEFAULT_LEVEL
Expand Down Expand Up @@ -113,7 +115,7 @@ config GPIO
# Bluetooth Low Energy configs

config BT
default n if SOC_SERIES_RISCV_TELINK_TLX
default y if SOC_SERIES_RISCV_TELINK_TLX
default y

if BT
Expand Down Expand Up @@ -175,7 +177,7 @@ config BT_DEVICE_NAME_GATT_WRITABLE
bool
default n

if SOC_SERIES_RISCV_TELINK_B9X
if SOC_SERIES_RISCV_TELINK_B9X || SOC_SERIES_RISCV_TELINK_TLX

config B9X_BLE_CTRL_THREAD_STACK_SIZE
default 576
Expand All @@ -194,7 +196,7 @@ choice B9X_BLE_CTRL_MAC_TYPE
default B9X_BLE_CTRL_MAC_TYPE_RANDOM_STATIC
endchoice

endif # SOC_SERIES_RISCV_TELINK_B9X
endif # SOC_SERIES_RISCV_TELINK_B9X || SOC_SERIES_RISCV_TELINK_TLX

if SOC_SERIES_RISCV_TELINK_TLX

Expand Down Expand Up @@ -489,6 +491,7 @@ config OPENTHREAD_SHELL
default n

config CHIP_TASK_STACK_SIZE
default 6192 if SOC_RISCV_TELINK_TL321X
default 4864 if PM

endif
7 changes: 6 additions & 1 deletion examples/platform/telink/project_include/OpenThreadConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@

/* Number of message buffers reduced to save RAM */
#undef OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
#if CONFIG_PM
#if CONFIG_PM || CONFIG_SOC_RISCV_TELINK_TL321X
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 22
#else
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 44
#endif

#if CONFIG_SOC_RISCV_TELINK_TL321X
#undef OPENTHREAD_CONFIG_MLE_MAX_CHILDREN
#define OPENTHREAD_CONFIG_MLE_MAX_CHILDREN 5
#endif

#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART

#undef OPENTHREAD_CONFIG_LOG_LEVEL
Expand Down
7 changes: 7 additions & 0 deletions src/platform/telink/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0
#endif

#ifdef CONFIG_SOC_RISCV_TELINK_TL321X
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE (256)
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE (256)
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (256)
#endif


#ifdef CONFIG_BT
#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE CONFIG_BT
#else
Expand Down
2 changes: 1 addition & 1 deletion src/platform/telink/SystemPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct ChipDeviceEvent;
#define CHIP_SYSTEM_PACKETBUFFER_FROM_CHIP_HEAP 1
#define CHIP_SYSTEM_PACKETBUFFER_FROM_CHIP_POOL 0
#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 1
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_CAPACITY_MAX 1200
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_CAPACITY_MAX 1280
#endif


Expand Down

0 comments on commit 7944b65

Please sign in to comment.