Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Telink] Update to Zephyr v3.7 #36691

Draft
wants to merge 57 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3663762
[Telink] Zephyr v3.7 update changes
interfer Dec 2, 2024
f0d697e
[Telink] Manual Zephyr SDK update to check CI jobs
s07641069 Nov 25, 2024
794dc59
[Telink] Fix build errors:
s07641069 Nov 25, 2024
bf1b9c8
[Telink] CONFIG_BOOT_MAX_IMG_SECTORS_AUTO used
s07641069 Nov 26, 2024
951f73a
[Telink] Fix build errors
s07641069 Nov 26, 2024
5f20728
[Telink] Reduce mcuboot partition size to 60Kb
s07641069 Dec 2, 2024
cda4887
[Telink] Reduce NET_BUF_*_COUNT (to be tested)
s07641069 Nov 27, 2024
d304e94
[Telink] avoid using NEWLIB_LIBC (use PICOLIB)
s07641069 Dec 2, 2024
1ea5831
Restyled by whitespace
restyled-commits Dec 2, 2024
368924c
Restyled by clang-format
restyled-commits Dec 2, 2024
44b20d6
[Telink] Update Zephyr revision & SDK
s07641069 Dec 2, 2024
05f54f9
[Telink] Adopt TL3218 to latest Zephyr version
s07641069 Dec 2, 2024
79c54e3
[Telink] Use 4mb flash for (B92) Light Switch App target build
s07641069 Dec 3, 2024
2b61414
[Telink] Fix W91 target build
s07641069 Dec 3, 2024
2064da8
[Telink] Fix B91 Mars target build
s07641069 Dec 3, 2024
95eface
[Telink] Use correct if SOC_RISCV_TELINK_TL321X
s07641069 Dec 3, 2024
a1b1a16
[Telink] Fix retention target builds
s07641069 Dec 3, 2024
d9371be
[Telink] fixed W91 WiFi interface init
interfer Dec 4, 2024
6893758
[Telink] Update to latest zephyr (develop_new_matter_fixes) hash
s07641069 Dec 4, 2024
c643c5e
[Telink] memory layout and default config changes
interfer Dec 6, 2024
768e02a
Merge pull request #349 from s07641069/update_zephyr_3.7_mem_optimize
interfer Dec 16, 2024
a3093b6
[Telink] W91 OTA, Factory data commissioning fix
interfer Dec 16, 2024
f887453
[Telink] W91 stacks increase
interfer Dec 17, 2024
3c4d272
[Telink] review changes draft
interfer Dec 17, 2024
025d722
Merge branch 'master' into update_zephyr_3.7
s07641069 Dec 30, 2024
0d36905
[Telink] Add tl7218 board.
andriy-bilynskyy Dec 30, 2024
3cc4d9f
[Telink] Fix compilation warnings.
andriy-bilynskyy Dec 30, 2024
99b861d
[Telink] Fix config option.
andriy-bilynskyy Dec 30, 2024
04ee5ac
[Telink] Cleanup MbedTLS configuration.
andriy-bilynskyy Dec 30, 2024
5d8f6fb
[Telink] Update tl721x default Kconfig
s07641069 Dec 30, 2024
11422fd
[Telink] Remove unused files
s07641069 Dec 30, 2024
79c7f01
[Telink] Update Zephyr revision
s07641069 Dec 30, 2024
01524da
[Telink] Clean config types
s07641069 Jan 2, 2025
d4a3914
[Telink] Update Zephyr revision
s07641069 Jan 3, 2025
55364c4
[Telink] Increase BLE_CTRL_THREAD_STACK_SIZE (B92 SoC retention test)
s07641069 Jan 6, 2025
7548e35
[Telink] Fix compilation warninig
s07641069 Jan 7, 2025
53fb192
[Telink] TL7218 upgrade to support version A2
s07641069 Jan 7, 2025
1bc3274
Merge branch 'master' into update_zephyr_3.7
s07641069 Jan 7, 2025
fd0ff22
[Telink] Remove unused file after resolve merge conflict
s07641069 Jan 7, 2025
493c81a
[Telink] Add tl7218_retention target
s07641069 Jan 20, 2025
41eab7f
riscv: telink: seperate ram for tl3218x .
haiwentelink Jan 21, 2025
c2a0df0
[Telink] Fix broken GitHub CI after adding tl721x target
s07641069 Jan 24, 2025
6f48c08
[Telink] remove temporary LZMA for tl321x due to bug
s07641069 Jan 24, 2025
984b1be
[Telink] Fix TELINK_TLX_MATTER_RETENTION_LAYOUT typo for BOARD_TL3218
s07641069 Jan 24, 2025
a880ad4
[Telink] Add GPIO/PWM required for TL721X
s07641069 Jan 27, 2025
b5a1722
[Telink] Temporary disable B95 OTA failed build
s07641069 Jan 27, 2025
28b9886
[Telink] Add missed clean out build output step
s07641069 Jan 27, 2025
53bbd10
[Telink] adopt WiFi driver
serhiiSalamakha Jan 22, 2025
01b35ef
[Telink] remove b95 SoC / TLSR9258a board (replaced by TL721x)
s07641069 Jan 28, 2025
80b2800
[Telink] Revert InetUtils.cpp Telink dependency
serhiiSalamakha Jan 28, 2025
20a0b52
Merge branch 'master' into update_zephyr_3.7
s07641069 Jan 31, 2025
6425884
[Telink] zephyr versions compatibility changes (#382)
s07641069 Feb 11, 2025
5a37647
Merge branch 'master' into update_zephyr_3.7
s07641069 Feb 11, 2025
aeacc01
Merge branch 'master' into update_zephyr_3.7
s07641069 Feb 11, 2025
b82ba43
[Telink] manual sync after merge master
s07641069 Feb 11, 2025
c125901
[Telink] Increase Main Stack size for W91
s07641069 Feb 12, 2025
c7d6bd6
[Telink] Zephyr 3.3 backward compatibility support
s07641069 Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ jobs:
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
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 ce4027fc0768b8509758af2e43f74e3fd2c7d58d"
- 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 f28fc3268ea9515d33d7c392b648df25af5d0789"
- name: CI Examples Telink
shell: bash
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
with:
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 ce4027fc0768b8509758af2e43f74e3fd2c7d58d"
- name: Update Zephyr to specific revision (for developers purpose)
run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py f28fc3268ea9515d33d7c392b648df25af5d0789"

- name: Build example Telink (B92 retention) Air Quality Sensor App
# Run test for master and s07641069 PRs
Expand Down Expand Up @@ -165,14 +165,14 @@ jobs:
- name: clean out build output (keep tools)
run: rm -rf ./out/telink*

- name: Build example Telink (tl321x) Lighting App with OTA, Shell, Factory Data
- name: Build example Telink (tl321x) Lighting App with OTA, Factory Data
# Run test for master and all PRs
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tl3218x-light-ota-shell-factory-data' build"
"./scripts/build/build_examples.py --target 'telink-tl3218x-light-ota-factory-data' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tl3218x light-app-ota-shell-factory-data \
out/telink-tl3218x-light-ota-shell-factory-data/zephyr/zephyr.elf \
telink tl3218x light-app-ota-factory-data \
out/telink-tl3218x-light-ota-factory-data/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output (keep tools)
Expand Down
3 changes: 3 additions & 0 deletions config/telink/app/bootloader.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ CONFIG_BOOT_SWAP_USING_SCRATCH=n
# With disabled option the only image magic is validated
CONFIG_BOOT_VALIDATE_SLOT0=y

# Required for Zephyr 3.3 and replased with CONFIG_BOOT_MAX_IMG_SECTORS_AUTO in new versions
# Maximum number of image sectors supported by the bootloader.
# Maximum signed image size: 512 * 4096 = 2M Bytes
CONFIG_BOOT_MAX_IMG_SECTORS=512
Expand All @@ -40,3 +41,5 @@ CONFIG_BOOT_MAX_IMG_SECTORS=512
# - INFO, LOG_LEVEL_INF
# - DEBUG, LOG_LEVEL_DBG
CONFIG_MCUBOOT_LOG_LEVEL_INF=y

CONFIG_PICOLIBC=y
s07641069 marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions config/telink/app/bootloader_compress_lzma.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CONFIG_BOOT_UPGRADE_ONLY=y
# With disabled option the only image magic is validated
CONFIG_BOOT_VALIDATE_SLOT0=y

# Required for Zephyr 3.3 and replased with CONFIG_BOOT_MAX_IMG_SECTORS_AUTO in new versions
# Maximum number of image sectors supported by the bootloader.
# Maximum signed image size: 512 * 4096 = 2M Bytes
CONFIG_BOOT_MAX_IMG_SECTORS=512
Expand All @@ -42,3 +43,5 @@ CONFIG_SIZE_OPTIMIZATIONS=y

# Enable support LZMA compression
CONFIG_COMPRESS_LZMA=y

CONFIG_PICOLIBC=y
3 changes: 2 additions & 1 deletion config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ endif()
matter_add_flags(-DNL_ASSERT_USE_FLAGS_DEFAULT=1)

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

zephyr_get_compile_flags(ZEPHYR_CFLAGS_C C)
matter_add_cflags("${ZEPHYR_CFLAGS_C}")
Expand All @@ -64,7 +65,7 @@ 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>)
matter_add_flags(-DMBEDTLS_USER_CONFIG_FILE=<${CONFIG_MBEDTLS_CFG_FILE}>)

# Set up custom OpenThread configuration

Expand Down
2 changes: 1 addition & 1 deletion config/telink/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ config BOOTLOADER_MCUBOOT
select IMG_MANAGER
select STREAM_FLASH
select STREAM_FLASH_ERASE
select TELINK_W91_N22_MATTER_OTA_LAYOUT if BOARD_TLSR9118BDK40D
select TELINK_W91_N22_MATTER_OTA_LAYOUT if BOARD_TLSR9118BDK40D || BOARD_TLSR9118BDK40D_V1

config CHIP_OTA_REQUESTOR_BUFFER_SIZE
int "OTA Requestor image buffer size"
Expand Down
62 changes: 45 additions & 17 deletions config/telink/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ config CHIP_PROJECT_CONFIG
string "Project configuration file for Matter"
default "include/CHIPProjectConfig.h"

config ZEPHYR_VERSION_3_3
bool "Using Zephyr version 3.3"
default n

config LOG
default y

Expand Down Expand Up @@ -63,6 +67,7 @@ config POSIX_MAX_FDS
# Application stack size
config MAIN_STACK_SIZE
default 3240 if PM || SOC_RISCV_TELINK_TL321X
default 4608 if SOC_RISCV_TELINK_W91 && !ZEPHYR_VERSION_3_3
default 4096

config INIT_STACKS
Expand All @@ -80,11 +85,12 @@ config SYSTEM_WORKQUEUE_STACK_SIZE
default 616 if PM

config HEAP_MEM_POOL_SIZE
default 256
default 256 if ZEPHYR_VERSION_3_3
default 1280

config COMMON_LIBC_MALLOC_ARENA_SIZE
default 20716 if SOC_RISCV_TELINK_TL321X || SOC_SERIES_RISCV_TELINK_B9X_RETENTION
default 16384 if SOC_RISCV_TELINK_TL721X
default 20716 if SOC_SERIES_RISCV_TELINK_B9X_RETENTION || (SOC_RISCV_TELINK_TL321X && ZEPHYR_VERSION_3_3)
default 16384 if SOC_RISCV_TELINK_TL721X || (SOC_RISCV_TELINK_TL321X && !ZEPHYR_VERSION_3_3)
default 12288

config NET_IPV6_MLD
Expand Down Expand Up @@ -172,7 +178,8 @@ config BT_DEVICE_NAME_GATT_WRITABLE
if SOC_RISCV_TELINK_B9X || SOC_RISCV_TELINK_TLX

config TL_BLE_CTRL_THREAD_STACK_SIZE
default 648
default 648 if ZEPHYR_VERSION_3_3
default 680

config TL_BLE_CTRL_MASTER_MAX_NUM
default 0
Expand All @@ -194,13 +201,9 @@ endif # SOC_RISCV_TELINK_B9X || SOC_RISCV_TELINK_TLX

endif # BT

# Board retention config
# Cut down the ram cost by matter's change,it can keep ramcode (driver).
# No need load the ramcode every time in thread mode (retention mode).
# If the ram is not enough , can change it back , initial setting is n.
if BOARD_TLSR9528A_RETENTION || BOARD_TLSR9518ADK80D_RETENTION
config SOC_SERIES_RISCV_TELINK_B9X_NON_RETENTION_RAM_CODE
default n if PM
default y if PM

config TELINK_B9X_MATTER_RETENTION_LAYOUT
default y if PM
Expand Down Expand Up @@ -237,7 +240,7 @@ config CHIP_OTA_REQUESTOR
default y

config MCUBOOT_SIGNATURE_KEY_FILE
default "bootloader/mcuboot/root-ec-p256.pem" if BOARD_TLSR9118BDK40D
default "bootloader/mcuboot/root-ec-p256.pem" if BOARD_TLSR9118BDK40D || BOARD_TLSR9118BDK40D_V1
depends on BOOTLOADER_MCUBOOT

# In current config/zephyr/Kconfig
Expand Down Expand Up @@ -351,6 +354,8 @@ config CHIP_WIFI
select NET_IPV6_ND # enable Neighbor Discovery to handle Router Advertisements
select NET_IPV6_NBR_CACHE
select NET_STATISTICS_USER_API
imply MBEDTLS_ENTROPY_C
imply MBEDTLS_KEY_EXCHANGE_RSA_ENABLED

if CHIP_WIFI

Expand Down Expand Up @@ -405,7 +410,14 @@ config CHIP_WIFI_CONNECTION_RECOVERY_JITTER
within range [-JITTER; +JITTER].

config NET_MGMT_EVENT_STACK_SIZE
default 1128
default 1128 if ZEPHYR_VERSION_3_3
default 1250

if !ZEPHYR_VERSION_3_3
config IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE
int "Size of RX work queue stack"
default 2304 if TELINK_W91_IPC_DISPATCHER
endif

endif # CHIP_WIFI

Expand All @@ -420,12 +432,9 @@ config CHIP_ENABLE_PAIRING_AUTOSTART
config MBEDTLS
default y

config MBEDTLS_USER_CONFIG_ENABLE
config MBEDTLS_CIPHER_AES_ENABLED
default y

config MBEDTLS_USER_CONFIG_FILE
default "telink-mbedtls-config.h"

config MBEDTLS_CIPHER_CCM_ENABLED
default y

Expand All @@ -444,10 +453,29 @@ config MBEDTLS_ECDH_C
config MBEDTLS_ECDSA_C
default y

# getopt version
config GETOPT_LONG
config MBEDTLS_PKCS5_C
default y

config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
default y

if !ZEPHYR_VERSION_3_3
config MBEDTLS_ENTROPY_POLL_ZEPHYR
bool "Provide entropy data to Mbed TLS through entropy driver or random generator"
default y

config MBEDTLS_HKDF_C
bool "HMAC-based Extract-and-Expand Key Derivation Function"
default y

config MBEDTLS_X509_CSR_WRITE_C
bool "X.509 Certificate Signing Requests writing"
default y
endif # !ZEPHYR_VERSION_3_3

config GETOPT_LONG
default y if ZEPHYR_VERSION_3_3

# Disable not used shell modules

config SHELL_WILDCARD
Expand Down
15 changes: 14 additions & 1 deletion examples/platform/telink/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Generate Zephyr version files for backward compatibility
file(STRINGS "$ENV{ZEPHYR_BASE}/VERSION" ZEPHYR_VERSION_STRING REGEX "[0-9]+")
string(REGEX REPLACE "[^0-9;]" "" ZEPHYR_VERSION_STRING "${ZEPHYR_VERSION_STRING}")
string(REPLACE ";" "." ZEPHYR_VERSION_STRING "${ZEPHYR_VERSION_STRING}")
file(WRITE "${CMAKE_BINARY_DIR}/modules/chip-module/zephyr_version.gni" "ZEPHYR_VERSION_STRING = \"${ZEPHYR_VERSION_STRING}\"\n")
if(${ZEPHYR_VERSION_STRING} MATCHES "^3\\.3")
set(ZEPHYR_VERSION_OVERLAY_FILE "${CMAKE_BINARY_DIR}/zephyr_version.conf")
file(WRITE ${ZEPHYR_VERSION_OVERLAY_FILE} "CONFIG_ZEPHYR_VERSION_3_3=y\n")

# Add required MbedTLS defines for Zephyr 3.3
add_definitions(-DMBEDTLS_HKDF_C -DMBEDTLS_X509_CREATE_C -DMBEDTLS_X509_CSR_WRITE_C)
endif()

string(REPLACE "_retention" "" BASE_BOARD ${BOARD})
string(REGEX REPLACE "_v[0-9]+" "" BASE_BOARD ${BASE_BOARD})

Expand Down Expand Up @@ -117,7 +130,7 @@ else()
endif()

if(NOT CONF_FILE)
set(CONF_FILE ${USB_CONF_OVERLAY_FILE} ${MARS_CONF_OVERLAY_FILE} prj.conf)
set(CONF_FILE ${USB_CONF_OVERLAY_FILE} ${MARS_CONF_OVERLAY_FILE} ${ZEPHYR_VERSION_OVERLAY_FILE} prj.conf)
endif()

# Load NCS/Zephyr build system
Expand Down
12 changes: 6 additions & 6 deletions src/platform/Zephyr/InetUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ net_if * GetInterface(Inet::InterfaceId ifaceId)
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
net_if * GetWiFiInterface()
{
// TODO: Remove dependency after Telink Zephyr update
// net_if_get_first_wifi() is not available in Zephyr 3.3.99
#if !defined(CONFIG_SOC_RISCV_TELINK_W91)
return net_if_get_first_wifi();
#else
// TODO: Remove dependency after Telink Zephyr 3.3 support is removed
// net_if_get_first_wifi() is not available in Zephyr 3.3
#if defined(CONFIG_SOC_RISCV_TELINK_W91) && defined(CONFIG_ZEPHYR_VERSION_3_3)
return GetInterface();
#else
return net_if_get_first_wifi();
#endif
}
#endif
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI

} // namespace InetUtils
} // namespace DeviceLayer
Expand Down
4 changes: 4 additions & 0 deletions src/platform/telink/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@
#include <zephyr/bluetooth/addr.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/drivers/flash.h>
#if defined(CONFIG_ZEPHYR_VERSION_3_3)
#include <zephyr/random/rand32.h>
#else
#include <zephyr/random/random.h>
#endif
#include <zephyr/storage/flash_map.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util.h>
Expand Down
9 changes: 5 additions & 4 deletions src/platform/telink/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,15 @@ static_library("telink") {
}

if (chip_enable_wifi) {
import("$root_build_dir/zephyr_version.gni")
sources += [
"OTAImageProcessorImplWiFi.h",
"wifi/ConnectivityManagerImplWiFi.cpp",
"wifi/" + ZEPHYR_VERSION_STRING + "/ConnectivityManagerImplWiFi.cpp",
"wifi/ConnectivityManagerImplWiFi.h",
"wifi/TelinkWiFiDriver.cpp",
"wifi/" + ZEPHYR_VERSION_STRING + "/TelinkWiFiDriver.cpp",
"wifi/TelinkWiFiDriver.h",
"wifi/WiFiManager.cpp",
"wifi/WiFiManager.h",
"wifi/" + ZEPHYR_VERSION_STRING + "/WiFiManager.cpp",
"wifi/" + ZEPHYR_VERSION_STRING + "/WiFiManager.h",
]
}

Expand Down
5 changes: 5 additions & 0 deletions src/platform/telink/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <platform/ConnectivityManager.h>
#include <platform/Zephyr/InetUtils.h>
#include <platform/internal/BLEManager.h>
#include <zephyr/net/net_if.h>

#include <platform/internal/GenericConnectivityManagerImpl_UDP.ipp>

Expand Down Expand Up @@ -76,7 +77,11 @@ CHIP_ERROR JoinLeaveMulticastGroup(net_if * iface, const Inet::IPAddress & addre

if (maddr && !net_if_ipv6_maddr_is_joined(maddr))
{
#if defined(CONFIG_ZEPHYR_VERSION_3_3)
net_if_ipv6_maddr_join(maddr);
#else
net_if_ipv6_maddr_join(iface, maddr);
#endif
}
}
else if (operation == UDPEndPointImplSockets::MulticastOperation::kLeave)
Expand Down
4 changes: 4 additions & 0 deletions src/platform/telink/FactoryDataParser.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ static inline bool uint16_decode(zcbor_state_t * states, uint16_t * value)
bool ParseFactoryData(uint8_t * buffer, uint16_t bufferSize, struct FactoryData * factoryData)
{
memset(factoryData, 0, sizeof(*factoryData));
#if defined(CONFIG_ZEPHYR_VERSION_3_3)
ZCBOR_STATE_D(states, MAX_FACTORY_DATA_NESTING_LEVEL, buffer, bufferSize, 1);
#else
ZCBOR_STATE_D(states, MAX_FACTORY_DATA_NESTING_LEVEL, buffer, bufferSize, 1, 0);
#endif

bool res = zcbor_map_start_decode(states);
struct zcbor_string currentString;
Expand Down
7 changes: 6 additions & 1 deletion src/platform/telink/SystemPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,15 @@ struct ChipDeviceEvent;
#define CHIP_SYSTEM_CONFIG_USE_SOCKETS 1

// Reduce packet buffer pool size (default 15) to reduce ram consumption
#if defined CONFIG_PM || defined CONFIG_SOC_RISCV_TELINK_TL321X
#if defined(CONFIG_PM) || defined(CONFIG_SOC_RISCV_TELINK_TL321X)
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 0
#else
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8
#endif

// ========== Platform-specific Configuration Overrides =========

// Disable Zephyr Socket extensions module, as the Zephyr RTOS now implements recvmsg()
#if !defined(CONFIG_ZEPHYR_VERSION_3_3)
#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKET_EXTENSIONS 0
#endif
Loading
Loading