From c34ce8ce77ee15e0f133253a140c40c6f966166f Mon Sep 17 00:00:00 2001 From: srningap <107042150+srningap@users.noreply.github.com> Date: Sat, 6 Jan 2024 02:56:19 +0530 Subject: [PATCH] [Silabs] - Updating the wifi-sdk to v3.1.1 with required changes (#31056) * updating to wifi-sdk v3.1.1 * fixing build errors with wifi-sdk v3.1.1 * Adds linker file changes and cleaned up gni files * Updates wifi-sdk commit * Restyled * Updated proper comments. * reverted Dockerfile * fixed the build issue after rebase * Restyled by clang-format * Restyled by gn * reverted Dockerfile * updates matter_support * rebase and fix submodule change conflicts --------- Co-authored-by: Arun Padakanti Co-authored-by: Restyled.io Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> --- .gitmodules | 2 +- .../silabs/SiWx917/SiWx917/sl_wifi_if.c | 36 ++- .../silabs/SiWx917/SiWx917/sl_wlan_config.h | 10 +- .../silabs/ldscripts/SiWx917-common.ld | 39 ++- .../platform/silabs/ldscripts/SiWx917-dual.ld | 219 -------------- scripts/examples/gn_silabs_example.sh | 2 +- src/platform/silabs/BLEManagerImpl.h | 20 +- .../silabs/SiWx917/OTAImageProcessorImpl.cpp | 2 +- src/platform/silabs/SilabsConfig.cpp | 2 - .../platformAbstraction/WiseMcuSpam.cpp | 7 +- src/platform/silabs/rs911x/rsi_ble_config.h | 14 +- third_party/silabs/SiWx917_sdk.gni | 282 ++++++++---------- third_party/silabs/matter_support | 2 +- third_party/silabs/silabs_board.gni | 27 -- third_party/silabs/wifi_sdk | 2 +- 15 files changed, 208 insertions(+), 458 deletions(-) delete mode 100644 examples/platform/silabs/ldscripts/SiWx917-dual.ld diff --git a/.gitmodules b/.gitmodules index 7e82068156fbe5..61e34cfafd6e94 100644 --- a/.gitmodules +++ b/.gitmodules @@ -249,7 +249,7 @@ [submodule "third_party/silabs/wifi_sdk"] path = third_party/silabs/wifi_sdk url = https://github.com/SiliconLabs/wiseconnect.git - branch = v3.1.0 + branch = v3.1.1 platforms = silabs [submodule "editline"] path = third_party/editline/repo diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c index 4c3df704dcae38..2d640ef3387ec0 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c @@ -169,7 +169,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING); temp_reset = (wfx_wifi_scan_ext_t *) malloc(sizeof(wfx_wifi_scan_ext_t)); memset(temp_reset, 0, sizeof(wfx_wifi_scan_ext_t)); - if (CHECK_IF_EVENT_FAILED(event)) + if (SL_WIFI_CHECK_IF_EVENT_FAILED(event)) { SILABS_LOG("F: Join Event received with %u bytes payload\n", result_length); callback_status = *(sl_status_t *) result; @@ -237,7 +237,7 @@ int32_t wfx_wifi_rsi_init(void) { SILABS_LOG("wfx_wifi_rsi_init started"); sl_status_t status; - status = sl_wifi_init(&config, default_wifi_event_handler); + status = sl_wifi_init(&config, NULL, sl_wifi_default_event_handler); if (status != SL_STATUS_OK) { SILABS_LOG("wfx_wifi_rsi_init failed %x", status); @@ -245,6 +245,21 @@ int32_t wfx_wifi_rsi_init(void) return status; } +/************************************************************************************* + * @fn static void sl_print_firmware_version(sl_wifi_firmware_version_t*) + * @brief + * To print the firmware version + * @param[in] sl_wifi_firmware_version_t* + * @return + * None + *****************************************************************************************/ +static void sl_print_firmware_version(sl_wifi_firmware_version_t * firmware_version) +{ + SILABS_LOG("Firmware version is: %x%x.%d.%d.%d.%d.%d.%d", firmware_version->chip_id, firmware_version->rom_id, + firmware_version->major, firmware_version->minor, firmware_version->security_version, firmware_version->patch_num, + firmware_version->customer_id, firmware_version->build_num); +} + /************************************************************************************* * @fn static int32_t wfx_rsi_init(void) * @brief @@ -257,7 +272,7 @@ static sl_status_t wfx_rsi_init(void) { sl_status_t status; -#ifndef RSI_M4_INTERFACE +#ifndef SLI_SI91X_MCU_INTERFACE status = wfx_wifi_rsi_init(); if (status != SL_STATUS_OK) { @@ -266,14 +281,15 @@ static sl_status_t wfx_rsi_init(void) } #endif - sl_wifi_version_string_t version = { 0 }; - status = sl_wifi_get_firmware_version(&version); + sl_wifi_firmware_version_t version = { 0 }; + status = sl_wifi_get_firmware_version(&version); if (status != SL_STATUS_OK) { - SILABS_LOG("Get fw version failed: %s", version.version); + SILABS_LOG("Get fw version failed:"); + sl_print_firmware_version(&version); return status; } - SILABS_LOG("Get current fw version: %s", version.version); + sl_print_firmware_version(&version); status = sl_wifi_get_mac_address(SL_WIFI_CLIENT_INTERFACE, (sl_mac_address_t *) &wfx_rsi.sta_mac.octet[0]); if (status != SL_STATUS_OK) @@ -302,7 +318,7 @@ void wfx_show_err(char * msg) sl_status_t scan_callback_handler(sl_wifi_event_t event, sl_wifi_scan_result_t * scan_result, uint32_t result_length, void * arg) { - if (CHECK_IF_EVENT_FAILED(event)) + if (SL_WIFI_CHECK_IF_EVENT_FAILED(event)) { callback_status = *(sl_status_t *) scan_result; scan_results_complete = true; @@ -351,7 +367,7 @@ sl_status_t scan_callback_handler(sl_wifi_event_t event, sl_wifi_scan_result_t * } sl_status_t show_scan_results(sl_wifi_scan_result_t * scan_result) { - ARGS_CHECK_NULL_POINTER(scan_result); + SL_WIFI_ARGS_CHECK_NULL_POINTER(scan_result); int x; wfx_wifi_scan_result_t ap; for (x = 0; x < (int) scan_result->scan_count; x++) @@ -492,7 +508,7 @@ static sl_status_t wfx_rsi_do_join(void) * And check there is a success */ sl_wifi_credential_t cred = { 0 }; - cred.type = SL_WIFI_CRED_PSK; + cred.type = SL_WIFI_PSK_CREDENTIAL; memcpy(cred.psk.value, &wfx_rsi.sec.passkey[0], strlen(wfx_rsi.sec.passkey)); sl_wifi_credential_id_t id = SL_NET_DEFAULT_WIFI_CLIENT_CREDENTIAL_ID; status = sl_net_set_credential(id, SL_NET_WIFI_PSK, &wfx_rsi.sec.passkey[0], strlen(wfx_rsi.sec.passkey)); diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h b/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h index 8bf4e1a4ce51ad..add60ffafeef0c 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h @@ -38,7 +38,7 @@ static const sl_wifi_device_configuration_t config = { .boot_config = { .oper_mode = SL_SI91X_CLIENT_MODE, .coex_mode = SL_SI91X_WLAN_BLE_MODE, .feature_bit_map = -#ifdef RSI_M4_INTERFACE +#ifdef SLI_SI91X_MCU_INTERFACE (SL_SI91X_FEAT_SECURITY_OPEN | SL_SI91X_FEAT_WPS_DISABLE), #else (SL_SI91X_FEAT_SECURITY_OPEN | SL_SI91X_FEAT_AGGREGATION), @@ -49,17 +49,17 @@ static const sl_wifi_device_configuration_t config = { | SL_SI91X_TCP_IP_FEAT_DHCPV6_CLIENT | SL_SI91X_TCP_IP_FEAT_IPV6 #endif | SL_SI91X_TCP_IP_FEAT_ICMP | SL_SI91X_TCP_IP_FEAT_EXTENSION_VALID), - .custom_feature_bit_map = (SL_SI91X_FEAT_CUSTOM_FEAT_EXTENTION_VALID | RSI_CUSTOM_FEATURE_BIT_MAP), + .custom_feature_bit_map = (SL_SI91X_CUSTOM_FEAT_EXTENTION_VALID | RSI_CUSTOM_FEATURE_BIT_MAP), .ext_custom_feature_bit_map = ( -#ifdef CHIP_917 +#ifdef SLI_SI917 (RSI_EXT_CUSTOM_FEATURE_BIT_MAP) #else // defaults -#ifdef RSI_M4_INTERFACE +#ifdef SLI_SI91X_MCU_INTERFACE (SL_SI91X_EXT_FEAT_256K_MODE | RSI_EXT_CUSTOM_FEATURE_BIT_MAP) #else (SL_SI91X_EXT_FEAT_384K_MODE | RSI_EXT_CUSTOM_FEATURE_BIT_MAP) #endif -#endif +#endif // SLI_SI917 | (SL_SI91X_EXT_FEAT_BT_CUSTOM_FEAT_ENABLE) #if (defined A2DP_POWER_SAVE_ENABLE) | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2) diff --git a/examples/platform/silabs/ldscripts/SiWx917-common.ld b/examples/platform/silabs/ldscripts/SiWx917-common.ld index e91bba8384b0ca..b0168a06ecf235 100644 --- a/examples/platform/silabs/ldscripts/SiWx917-common.ld +++ b/examples/platform/silabs/ldscripts/SiWx917-common.ld @@ -28,8 +28,8 @@ ******************************************************************************/ MEMORY { - rom (rx) : ORIGIN = 0x81c2000, LENGTH = 0x200000 - ram (rwx) : ORIGIN = 0x400, LENGTH = 0x4e200 + rom (rx) : ORIGIN = 0x8202000, LENGTH = 0x1fe000 + ram (rwx) : ORIGIN = 0x400, LENGTH = 0x4fc00 } ENTRY(Reset_Handler) @@ -39,8 +39,8 @@ SECTIONS .text : { KEEP(*(.isr_vector)) - KEEP(*(.reset_handler)) - *(EXCLUDE_FILE(*sl_si91x_bus.o *sl_si91x_driver.o *sli_si91x_multithreaded.o *rsi_hal_mcu_m4_ram.o ) .text*) + KEEP(*(.reset_handler)) + *(EXCLUDE_FILE(*sl_si91x_bus.c.o *sl_si91x_driver.c.o *sli_si91x_multithreaded.c.o *rsi_hal_mcu_m4_ram.c.o *rsi_deepsleep_soc.c.o *croutine.c.o *event_groups.c.o *list.c.o *queue.c.o *stream_buffer.c.o *tasks.c.o *timers.c.o *cmsis_os2.c.o *freertos_umm_malloc_host.c.o *malloc_buffers.c.o *sl_rsi_utility.c.o *port.c.o *heap_*.c.o) .text*) /* .ctors */ *crtbegin.o(.ctors) @@ -127,10 +127,24 @@ SECTIONS *(.rodata*) *(vtable) *(.data*) - *sl_si91x_bus.o(.text*) - *sl_si91x_driver.o(.text*) - *sli_si91x_multithreaded.o(.text*) - *rsi_hal_mcu_m4_ram.o(.text*) + *sl_si91x_bus.c.o(.text*) + *sl_si91x_driver.c.o(.text*) + *sli_si91x_multithreaded.c.o(.text*) + *rsi_hal_mcu_m4_ram.c.o(.text*) + *rsi_deepsleep_soc.c.o(.text*) + *croutine.c.o(.text*) + *event_groups.c.o(.text*) + *list.c.o(.text*) + *queue.c.o(.text*) + *cmsis_os2.c.o(.text*) + *stream_buffer.c.o(.text*) + *tasks.c.o(.text*) + *timers.c.o(.text*) + *freertos_umm_malloc_host.c.o(.text*) + *malloc_buffers.c.o(.text*) + *sl_rsi_utility.c.o(.text*) + *port.c.o(.text*) + *heap_*.c.o(.text*) . = ALIGN(4); /* preinit data */ @@ -210,8 +224,8 @@ SECTIONS } > ram __heap_size = __HeapLimit - __HeapBase; - __ram_end__ = 0x400 + 0x4e200; - __main_flash_end__ = 0x81c2000 + 0x200000; + __ram_end__ = 0x400 + 0x4fc00; + __main_flash_end__ = 0x8202000 + 0x1fe000; /* This is where we handle flash storage blocks. We use dummy sections for finding the configured * block sizes and then "place" them at the end of flash when the size is known. */ @@ -224,7 +238,8 @@ SECTIONS KEEP(*(.simee*)) } > rom - linker_nvm_end = __main_flash_end__; + /* Last page of flash is reserved for the manufacturing token space */ + linker_nvm_end = __main_flash_end__ - 4096; linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm); linker_nvm_size = SIZEOF(.nvm); linker_storage_end = linker_nvm_begin; @@ -234,7 +249,7 @@ SECTIONS linker_storage_size = SIZEOF(.internal_storage); ASSERT((linker_storage_begin >= (__etext + SIZEOF(.data))), "FLASH memory overflowed !") - app_flash_end = 0x81c2000 + 0x200000; + app_flash_end = 0x8202000 + 0x1fe000; ASSERT( (linker_nvm_begin + SIZEOF(.nvm)) <= app_flash_end, "NVM3 is excessing the flash size !") } diff --git a/examples/platform/silabs/ldscripts/SiWx917-dual.ld b/examples/platform/silabs/ldscripts/SiWx917-dual.ld deleted file mode 100644 index 1c39478c808bf5..00000000000000 --- a/examples/platform/silabs/ldscripts/SiWx917-dual.ld +++ /dev/null @@ -1,219 +0,0 @@ -/* - * - * Copyright (c) 2022 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. - */ - - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08012000, LENGTH = 0x400000 - RAM (rwx) : ORIGIN = 0xC, LENGTH = 0x4FC00 -} - -/* Linker script to place sections and symbol values. Should be used together - * with other linker script that defines memory regions FLASH and RAM. - * It references following symbols, which must be defined in code: - * Reset_Handler : Entry of reset handler - * - * It defines following symbols, which code can use without definition: - * __exidx_start - * __exidx_end - * __copy_table_start__ - * __copy_table_end__ - * __zero_table_start__ - * __zero_table_end__ - * __etext - * __data_start__ - * __preinit_array_start - * __preinit_array_end - * __init_array_start - * __init_array_end - * __fini_array_start - * __fini_array_end - * __data_end__ - * __bss_start__ - * __bss_end__ - * __end__ - * end - * __HeapBase - * __HeapLimit - * __StackLimit - * __StackTop - * __stack - */ -ENTRY(Reset_Handler) - -SECTIONS -{ - .text : - { - KEEP(*(.vectors)) - - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - .copy.table : - { - . = ALIGN(4); - __copy_table_start__ = .; - - LONG (__etext) - LONG (__data_start__) - LONG ((__data_end__ - __data_start__) / 4) - - __copy_table_end__ = .; - } > FLASH - - .zero.table : - { - . = ALIGN(4); - __zero_table_start__ = .; - __zero_table_end__ = .; - } > FLASH - - __etext = ALIGN (4); - _sidata = __etext; - - .data : AT (__etext) - { - __data_start__ = .; - _sdata = __data_start__; - - *(vtable) - *(.data*) - . = ALIGN (4); - PROVIDE (__ram_func_section_start = .); - *(.ram) - PROVIDE (__ram_func_section_end = .); - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - _edata = __data_end__; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - _sbss = __bss_start__; - *(.bss) - *(.bss.*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - _ebss = __bss_end__; - } > RAM - - .heap (COPY) : - { - __HeapBase = .; - __end__ = .; - end = __end__; - _end = __end__; - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - __main_flash_end__ = ORIGIN(FLASH) + LENGTH(FLASH); - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - .nvm (DSECT) : { - KEEP(*(.simee*)) - } > FLASH - - /* Last page of flash is reserved for the manufacturing token space */ - linker_nvm_end = __main_flash_end__ - 4096; - linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm); - linker_nvm_size = SIZEOF(.nvm); - __nvm3Base = linker_nvm_begin; - __attestation_credentials_base = linker_nvm_end; - - /* Check if data + heap + stack exceeds RAM limit */ - /*ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")*/ - ASSERT( (linker_nvm_begin + SIZEOF(.nvm)) <= __main_flash_end__, "NVM3 is excessing the flash size !") - - /* Check if FLASH usage exceeds FLASH size */ -/* ASSERT( LENGTH(FLASH) >= (__etext), "FLASH memory overflowed !") */ /* Build error need to be checked for CCP */ - ASSERT((__etext + SIZEOF(.data)) <= __nvm3Base, "FLASH memory overlapped with NVM section.") -} \ No newline at end of file diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh index ae1d60e4eb69d7..d9b78bc7892f8d 100755 --- a/scripts/examples/gn_silabs_example.sh +++ b/scripts/examples/gn_silabs_example.sh @@ -285,7 +285,7 @@ else fi # 917 exception. TODO find a more generic way - if [ "$SILABS_BOARD" == "BRD4325B" ] || [ "$SILABS_BOARD" == "BRD4325C" ] || [ "$SILABS_BOARD" == "BRD4338A" ] || [ "$SILABS_BOARD" == "BRD4325G" ]; then + if [ "$SILABS_BOARD" == "BRD4338A" ]; then echo "Compiling for 917 WiFi SOC" USE_WIFI=true optArgs+="chip_device_platform =\"SiWx917\" " diff --git a/src/platform/silabs/BLEManagerImpl.h b/src/platform/silabs/BLEManagerImpl.h index b13f9fb2901603..602c28fcdf5a7d 100644 --- a/src/platform/silabs/BLEManagerImpl.h +++ b/src/platform/silabs/BLEManagerImpl.h @@ -25,29 +25,29 @@ #pragma once #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#if (BLE_ENABLE || RSI_BLE_ENABLE) +#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) #define BLE_MIN_CONNECTION_INTERVAL_MS 45 // 45 msec #define BLE_MAX_CONNECTION_INTERVAL_MS 45 // 45 msec #define BLE_SLAVE_LATENCY_MS 0 #define BLE_TIMEOUT_MS 400 -#endif // RSI_BLE_ENABLE +#endif // (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) #include "FreeRTOS.h" #include "timers.h" -#if (BLE_ENABLE || RSI_BLE_ENABLE) +#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) #ifdef __cplusplus extern "C" { -#endif +#endif // __cplusplus #include #include #include #ifdef __cplusplus } -#endif +#endif // __cplusplus #else #include "gatt_db.h" #include "sl_bgapi.h" #include "sl_bt_api.h" -#endif // RSI_BLE_ENABLE +#endif // (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) namespace chip { namespace DeviceLayer { @@ -64,7 +64,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla public: void HandleBootEvent(void); -#if (BLE_ENABLE || RSI_BLE_ENABLE) +#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) void HandleConnectEvent(void); void HandleConnectionCloseEvent(uint16_t reason); void HandleWriteEvent(rsi_ble_event_write_t evt); @@ -86,7 +86,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR StopAdvertising(void); #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING -#if (BLE_ENABLE || RSI_BLE_ENABLE) +#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) static void HandleC3ReadRequest(void); #else #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING @@ -163,7 +163,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla struct CHIPoBLEConState { -#if !(BLE_ENABLE || RSI_BLE_ENABLE) +#if !(SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) bd_addr address; #endif uint16_t mtu : 10; @@ -192,7 +192,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR EncodeAdditionalDataTlv(); #endif -#if (BLE_ENABLE || RSI_BLE_ENABLE) +#if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE) void HandleRXCharWrite(rsi_ble_event_write_t * evt); #else void HandleRXCharWrite(volatile sl_bt_msg_t * evt); diff --git a/src/platform/silabs/SiWx917/OTAImageProcessorImpl.cpp b/src/platform/silabs/SiWx917/OTAImageProcessorImpl.cpp index 075317fb9cb2f3..b4755995e36b01 100644 --- a/src/platform/silabs/SiWx917/OTAImageProcessorImpl.cpp +++ b/src/platform/silabs/SiWx917/OTAImageProcessorImpl.cpp @@ -26,7 +26,7 @@ extern "C" { #endif #include "sl_si91x_driver.h" -#ifdef RSI_M4_INTERFACE +#ifdef SLI_SI91X_MCU_INTERFACE #include "sl_si91x_hal_soc_soft_reset.h" #endif #ifdef __cplusplus diff --git a/src/platform/silabs/SilabsConfig.cpp b/src/platform/silabs/SilabsConfig.cpp index 4c9093e09d97f8..d15fef86b7985c 100644 --- a/src/platform/silabs/SilabsConfig.cpp +++ b/src/platform/silabs/SilabsConfig.cpp @@ -33,7 +33,6 @@ #include #include -#ifndef BRD4325A // TODO: fix semaphore usage in nvm3_lock for siwx917. use weak implementation for that board instead #include #include // Substitute the GSDK weak nvm3_lockBegin and nvm3_lockEnd @@ -58,7 +57,6 @@ void nvm3_lockEnd(void) VerifyOrDie(nvm3_Sem != NULL); xSemaphoreGive(nvm3_Sem); } -#endif // not BRD4325A namespace chip { namespace DeviceLayer { diff --git a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp index 328112fec19de0..1015d959ee0825 100644 --- a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp +++ b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp @@ -29,6 +29,8 @@ extern "C" { #include "em_core.h" #include "rsi_board.h" #include "sl_event_handler.h" +#include "sl_si91x_led.h" +#include "sl_si91x_led_config.h" #include "sl_system_init.h" void soc_pll_config(void); } @@ -73,7 +75,8 @@ void SilabsPlatform::InitLed(void) CHIP_ERROR SilabsPlatform::SetLed(bool state, uint8_t led) { // TODO add range check - RSI_Board_LED_Set(led, state); + (state) ? sl_si91x_led_set(led ? SL_LED_LED1_PIN : SL_LED_LED0_PIN) + : sl_si91x_led_clear(led ? SL_LED_LED1_PIN : SL_LED_LED0_PIN); return CHIP_NO_ERROR; } @@ -86,7 +89,7 @@ bool SilabsPlatform::GetLedState(uint8_t led) CHIP_ERROR SilabsPlatform::ToggleLed(uint8_t led) { // TODO add range check - RSI_Board_LED_Toggle(led); + sl_si91x_led_toggle(led ? SL_LED_LED1_PIN : SL_LED_LED0_PIN); return CHIP_NO_ERROR; } #endif // ENABLE_WSTK_LEDS diff --git a/src/platform/silabs/rs911x/rsi_ble_config.h b/src/platform/silabs/rs911x/rsi_ble_config.h index 64be3e24d386e6..9bc475a0a70131 100644 --- a/src/platform/silabs/rs911x/rsi_ble_config.h +++ b/src/platform/silabs/rs911x/rsi_ble_config.h @@ -89,14 +89,14 @@ #define RSI_BLE_CUSTOM_SERVICE_UUID (0xFFF6) #define RSI_BLE_CUSTOM_LEVEL_UUID (0x1FF1) -#ifdef RSI_M4_INTERFACE +#if (defined(RSI_M4_INTERFACE) || defined(SLI_SI91X_MCU_INTERFACE)) #define RSI_BLE_MAX_NBR_ATT_REC (20) #if (SIWX_917 | EXP_BOARD) #define RSI_BLE_MAX_NBR_PERIPHERALS (1) #else #define RSI_BLE_MAX_NBR_SLAVES (1) -#endif +#endif // (SIWX_917 | EXP_BOARD) #define RSI_BLE_NUM_CONN_EVENTS (2) #else @@ -106,10 +106,10 @@ #define RSI_BLE_MAX_NBR_PERIPHERALS (3) #else #define RSI_BLE_MAX_NBR_SLAVES (3) -#endif +#endif // (SIWX_917 | EXP_BOARD) #define RSI_BLE_NUM_CONN_EVENTS (20) -#endif +#endif // (defined(RSI_M4_INTERFACE) || defined(SLI_SI91X_MCU_INTERFACE)) #define RSI_BLE_MAX_NBR_ATT_SERV (10) @@ -266,16 +266,16 @@ (SL_SI91X_FEAT_ULP_GPIO_BASED_HANDSHAKE | SL_SI91X_FEAT_DEV_TO_HOST_ULP_GPIO_1) //! To set wlan feature select bit map #define RSI_TCP_IP_FEATURE_BIT_MAP \ (SL_SI91X_TCP_IP_FEAT_DHCPV4_CLIENT) //! TCP/IP feature select bitmap for selecting TCP/IP features -#define RSI_CUSTOM_FEATURE_BIT_MAP SL_SI91X_FEAT_CUSTOM_FEAT_EXTENTION_VALID //! To set custom feature select bit map +#define RSI_CUSTOM_FEATURE_BIT_MAP SL_SI91X_CUSTOM_FEAT_EXTENTION_VALID //! To set custom feature select bit map #ifdef CHIP_9117 #if WIFI_ENABLE_SECURITY_WPA3_TRANSITION // Adding Support for WPA3 transition #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \ - (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | RAM_LEVEL_NWP_BASIC_MCU_ADV | \ + (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | SL_SI91X_RAM_LEVEL_NWP_BASIC_MCU_ADV | \ SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0 | SL_SI91X_EXT_FEAT_IEEE_80211W) #else #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \ - (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | RAM_LEVEL_NWP_BASIC_MCU_ADV | \ + (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | SL_SI91X_RAM_LEVEL_NWP_BASIC_MCU_ADV | \ SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0) #endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */ #else // EXP_BOARD diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index bc8b8c23bf67ab..f66011f4d180e1 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -22,13 +22,6 @@ import("${chip_root}/src/app/icd/icd.gni") import("${chip_root}/src/lib/lib.gni") import("silabs_board.gni") -declare_args() { - if (silabs_board == "BRD4338A") { - sdk_support_board = "BRD4338A" - } else { - sdk_support_board = "BRD4325x" - } -} examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" # Defines an siwx917 SDK build target. @@ -54,45 +47,43 @@ template("siwx917_sdk") { "${efr32_sdk_root}/platform/emdrv/common/inc", "${efr32_sdk_root}/platform/service/device_init/inc", "${sdk_support_root}/matter/mbedtls/tinycrypt/inc", - "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/autogen", - "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/config", + "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen", + "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/config", "${chip_root}/third_party/mbedtls/repo/include", "${chip_root}/third_party/mbedtls/repo/library", "${chip_root}/src/platform/silabs/rs911x", # ble component - "${wifi_sdk_root}/components/si91x/ble/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ble/inc", # si91x component - "${wifi_sdk_root}/components/si91x/inc", - "${wifi_sdk_root}/components/si91x/memory", - "${wifi_sdk_root}/components/si91x/sl_net/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/sl_net/inc", # siwx917_soc component - "${wifi_sdk_root}/components/siwx917_soc/boards/config/${silabs_board_lower}", - "${wifi_sdk_root}/components/siwx917_soc/boards/inc", - "${wifi_sdk_root}/components/siwx917_soc/core/chip/inc", - "${wifi_sdk_root}/components/siwx917_soc/core/config", - "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver", - "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/config", - "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/CMSIS/Driver/Include", - "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/inc", - "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/inc", - "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/inc", - "${wifi_sdk_root}/components/siwx917_soc/drivers/rom_driver/inc", - "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/inc", - "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/config", - "${wifi_sdk_root}/components/siwx917_soc/hal/inc", - "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/inc", - "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/wifi_inc", + "${wifi_sdk_root}/components/board/silabs/config/brd4338a", + "${wifi_sdk_root}/components/board/silabs/inc", + "${wifi_sdk_root}/components/common/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/chip/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/config", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/common/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/cmsis_driver", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/cmsis_driver/config", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/cmsis_driver/CMSIS/Driver/Include", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/nvm3/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/rom_driver/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/config", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/hal/inc", # wifi component "${wifi_sdk_root}/components/protocol/wifi/inc", - # si91x_support component - "${wifi_sdk_root}/components/si91x_support/inc", - # wifi_resources component "${wifi_sdk_root}/resources/certificates", "${wifi_sdk_root}/resources/defaults", @@ -102,7 +93,6 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/service/network_manager/inc", # nvm3 - "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/inc", "${efr32_sdk_root}/platform/common/inc", "${efr32_sdk_root}/platform/emlib/inc", "${efr32_sdk_root}/platform/service/system/inc", @@ -118,29 +108,29 @@ template("siwx917_sdk") { "${efr32_sdk_root}/platform/middleware/glib/config", "${efr32_sdk_root}/platform/middleware/glib/glib", "${efr32_sdk_root}/platform/middleware/glib/dmd", - "${wifi_sdk_root}/components/siwx917_soc/drivers/hardware_drivers/memlcd/inc", - "${wifi_sdk_root}/components/siwx917_soc/drivers/hardware_drivers/memlcd/inc/memlcd_917", - "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/sleeptimer/inc", - "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/memlcd/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/memlcd/inc/memlcd_917", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/sleeptimer/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/inc", "${efr32_sdk_root}/hardware/driver/memlcd/src/ls013b7dh03", "${efr32_sdk_root}/platform/service/sleeptimer/inc", "${efr32_sdk_root}/platform/service/sleeptimer/config", "${efr32_sdk_root}/platform/service/sleeptimer/src", - "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/inc", + "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/support/inc", "${efr32_sdk_root}/platform/service/iostream/inc", - "${wifi_sdk_root}/components/siwx917_soc/drivers/hardware_drivers/button/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/config", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/config", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/config", # OTA - "${wifi_sdk_root}/components/si91x/sl_net/protocols/firmware_upgrade", - "${wifi_sdk_root}/components/siwx917_soc/hal/inc", - "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/firmware_upgrade", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/hal/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/inc", ] - if (silabs_board == "BRD4338A") { - _include_dirs += [ "${wifi_sdk_root}/components/siwx917_soc/core/config" ] - } - # Note that we're setting the mbedTLS and PSA configuration files through a # define. This means the build system by default does not pick up changes in # the content of these, only when changing the filename itself. @@ -157,11 +147,9 @@ template("siwx917_sdk") { "SL_COMPONENT_CATALOG_PRESENT", "RS911X_WIFI", "RSI_WLAN_ENABLE", - "RSI_WITH_OS", - "RSI_M4_INTERFACE", #Enable CCP bus Interface + "SLI_SI91X_ENABLE_OS", + "SLI_SI91X_MCU_INTERFACE", #Enable CCP bus Interface "RSI_WLAN_API_ENABLE", - "LITTLE_ENDIAN_ORDER", - "_CHIP_9118", "NVM3_DEFAULT_NVM_SIZE=40960", "NVM3_DEFAULT_MAX_OBJECT_SIZE=4092", "KVS_MAX_ENTRIES=${kvs_max_entries}", @@ -174,55 +162,42 @@ template("siwx917_sdk") { "RSI_ARM_CM4F", "SIWX_917", "CHIP_9117", - "BLE_ENABLE=1", - "RSI_LITTLE_ENDIAN=1", + "SLI_SI91X_ENABLE_BLE=1", + "SL_SI91X_ENABLE_LITTLE_ENDIAN=1", "TINYCRYPT_PRIMITIVES", "OPTIMIZE_TINYCRYPT_ASM", "__error_t_defined", "RSI_SAMPLE_HAL", "ENABLE_IPMU_APIS", - "ROM_BYPASS", + "SLI_SI91X_MCU_MOV_ROM_API_TO_FLASH", "DEBUG_UART", - "FLASH_BASED_EXECUTION_ENABLE", - "TA_DEEP_SLEEP_COMMON_FLASH", + "SLI_SI91X_MCU_ENABLE_FLASH_BASED_EXECUTION", "SL_WIFI_COMPONENT_INCLUDED", - "CHIP_917=1", + "SLI_SI917=1", "ROMDRIVER_PRESENT=1", "SL_CATALOG_FREERTOS_KERNEL_PRESENT=1", "SL_PLATFORM_EXAMPLES_ENABLE", - "SI91X_DEVICE=1", - "SI917_RADIO_BOARD=1", + "SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER=1", "FLASH_PAGE_SIZE", "SL_NVM3_PRESENT", "ROM_WIRELESS", "BRD4325A", #TODO: should be removed after SoC macro clean-up "CONNECTIVITY_PLATFORM", + "SLI_SI917B0 = 1", + "SLI_SI91X_MCU_COMMON_FLASH_MODE=1", + "EXECUTION_FROM_RAM", + "SLI_SI91X_MCU_CONFIG_RADIO_BOARD_VER2=1", + "SL_BOARD_REV=\"A00\"", + "SPI_MULTI_SLAVE=1", + "SYSCALLS_WRITE=1", + "SI91X_SYSRTC_COUNT=1", + "SSI_ULP_MASTER=1", + "SL_MEMLCD_EXTCOMIN_PORT=0", + "__STATIC_INLINE=static inline", + "SL_SI91X_SI917_RAM_MEM_CONFIG=3", + "SL_SI91x_DUAL_INTERRUPTS_ERRATA=1", ] - if (silabs_board == "BRD4325B") { - defines += [ "DUAL_FLASH_EN" ] - } - if (wifi_soc_common_flash) { - defines += [ - "CHIP_917B0 = 1", - "COMMON_FLASH_EN=1", - "EXECUTION_FROM_RAM", - ] - if (silabs_board == "BRD4338A") { - defines += [ - "SI917_RADIO_BOARD_V2=1", - "SL_BOARD_REV=\"A00\"", - "SPI_MULTI_SLAVE=1", - "SYSCALLS_WRITE=1", - "SI91X_PLATFORM=1", - "SI91X_SYSRTC_COUNT=1", - "SI91X_SYSRTC_PRESENT=1", - "SSI_ULP_MASTER=1", - "SL_MEMLCD_EXTCOMIN_PORT=0", - ] - } - } - if (chip_build_libshell) { defines += [ "ENABLE_CHIP_SHELL" ] } @@ -262,7 +237,6 @@ template("siwx917_sdk") { if (!disable_lcd) { defines += [ "CONFIG_ENABLE_UART", - "__STATIC_INLINE=static inline", "SI91X_SYSRTC_COUNT=1", "SYSCALLS_WRITE", "SPI_MULTI_SLAVE", @@ -340,6 +314,7 @@ template("siwx917_sdk") { "${efr32_sdk_root}/platform/CMSIS/RTOS2/Source/os_systick.c", "${efr32_sdk_root}/platform/common/src/sl_assert.c", "${efr32_sdk_root}/platform/common/src/sl_slist.c", + "${efr32_sdk_root}/platform/common/src/sli_cmsis_os2_ext_task_register.c", "${efr32_sdk_root}/util/third_party/freertos/cmsis/Source/cmsis_os2.c", "${wifi_sdk_root}/components/protocol/wifi/si91x/sl_wifi.c", @@ -355,54 +330,54 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/service/network_manager/src/sl_net_basic_profiles.c", # ble component - "${wifi_sdk_root}/components/si91x/ble/src/rsi_ble_gap_apis.c", - "${wifi_sdk_root}/components/si91x/ble/src/rsi_ble_gatt_apis.c", - "${wifi_sdk_root}/components/si91x/ble/src/rsi_bt_ble.c", - "${wifi_sdk_root}/components/si91x/ble/src/rsi_bt_common_apis.c", - "${wifi_sdk_root}/components/si91x/ble/src/rsi_common_apis.c", - "${wifi_sdk_root}/components/si91x/ble/src/rsi_utils.c", - "${wifi_sdk_root}/components/si91x/ble/src/sl_si91x_ble.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ble/src/rsi_ble_gap_apis.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ble/src/rsi_ble_gatt_apis.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ble/src/rsi_bt_ble.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ble/src/rsi_bt_common_apis.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ble/src/rsi_common_apis.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ble/src/rsi_utils.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ble/src/sl_si91x_ble.c", # si91x_basic_buffers component - "${wifi_sdk_root}/components/si91x/memory/malloc_buffers.c", - "${wifi_sdk_root}/components/si91x/platforms/siwx917_soc/siwx917_soc_ncp_host.c", - "${wifi_sdk_root}/components/si91x/sl_net/src/sl_net_rsi_utility.c", - "${wifi_sdk_root}/components/si91x/sl_net/src/sl_net_si91x.c", - "${wifi_sdk_root}/components/si91x/sl_net/src/sl_net_si91x_integration_handler.c", - "${wifi_sdk_root}/components/si91x/src/sl_rsi_utility.c", - "${wifi_sdk_root}/components/si91x/src/sl_si91x_callback_framework.c", - "${wifi_sdk_root}/components/si91x/src/sl_si91x_driver.c", - "${wifi_sdk_root}/components/si91x/threading/sli_si91x_multithreaded.c", - - # si91x_support component - "${wifi_sdk_root}/components/si91x_support/src/sl_utility.c", - "${wifi_sdk_root}/components/siwx917_soc/boards/src/rsi_board.c", - "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/rsi_deepsleep_soc.c", - "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/rsi_system_config.c", - "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/system_si91x.c", - "${wifi_sdk_root}/components/siwx917_soc/core/config/src/rsi_nvic_priorities_config.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/UDMA.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/USART.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/clock_update.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_egpio.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_udma.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_udma_wrapper.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_usart.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_ipmu.c", - - # siwx917_soc component - "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_pll.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_power_save.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_temp_sensor.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_ulpss_clk.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/src/sl_si91x_usart.c", - "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/rsi_hal_mcu_m4_ram.c", - "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/rsi_hal_mcu_m4_rom.c", - "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_platform.c", - "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_platform_wireless.c", - "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_si91x_bus.c", - "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_si91x_timer.c", - "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sli_siwx917_soc.c", + "${wifi_sdk_root}/components/board/silabs/src/rsi_board.c", + "${wifi_sdk_root}/components/common/src/sl_utility.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/chip/src/rsi_deepsleep_soc.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/chip/src/rsi_system_config.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/chip/src/system_si91x.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/common/src/rsi_debug.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/config/src/rsi_nvic_priorities_config.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/cmsis_driver/UDMA.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/cmsis_driver/USART.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/clock_update.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_egpio.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_udma.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_udma_wrapper.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_usart.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_ipmu.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_pll.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_power_save.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_temp_sensor.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_ulpss_clk.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/src/sl_si91x_driver_gpio.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/src/sl_si91x_usart.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/src/sl_si91x_peripheral_gpio.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/rsi_hal_mcu_m4_ram.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/rsi_hal_mcu_m4_rom.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/sl_platform.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/sl_platform_wireless.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/sl_si91x_bus.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/sl_si91x_timer.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/sli_siwx917_soc.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/host_mcu/si91x/siwx917_soc_ncp_host.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/memory/malloc_buffers.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/sl_net/src/sl_net_rsi_utility.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/sl_net/src/sl_net_si91x_integration_handler.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/sl_net/src/sl_si91x_net_credentials.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/src/sl_rsi_utility.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/src/sl_si91x_callback_framework.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/src/sl_si91x_driver.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/threading/sli_si91x_multithreaded.c", + "${wifi_sdk_root}/components/service/network_manager/si91x/sl_net_si91x.c", # modified hal "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_default_common_linker.c", @@ -418,9 +393,13 @@ template("siwx917_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/stream_buffer.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", - "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/autogen/sl_event_handler.c", - "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/hal/rsi_hal_mcu_m4.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_nvm3_hal_flash.c", + "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.c", + "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_button_instances.c", + "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_led_instances.c", + "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/support/hal/rsi_hal_mcu_m4.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/src/sl_si91x_button.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/src/sl_si91x_led.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/nvm3/src/sl_si91x_nvm3_hal_flash.c", # mbedtls "${chip_root}/third_party/mbedtls/repo/library/aes.c", @@ -459,30 +438,15 @@ template("siwx917_sdk") { "${sdk_support_root}/matter/mbedtls/tinycrypt/src/platform_util.c", "${sdk_support_root}/matter/mbedtls/tinycrypt/src/x509_crt.c", "${sdk_support_root}/matter/mbedtls/tinycrypt/src/x509write_csr.c", - "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/autogen/sl_si91x_button_instances.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/hardware_drivers/button/src/sl_si91x_button.c", + "${sdk_support_root}/matter/si91x/siwx917/BRD4338A/support/src/startup_common_RS1xxxx.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/nvm3/src/sl_si91x_common_flash_intf.c", # OTA - "${wifi_sdk_root}/components/si91x/sl_net/protocols/firmware_upgrade/firmware_upgradation.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_wwdt.c", - "${wifi_sdk_root}/components/siwx917_soc/hal/src/sl_si91x_hal_soc_soft_reset.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_wwdt.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/hal/src/sl_si91x_hal_soc_soft_reset.c", + "${wifi_sdk_root}/components/device/silabs/si91x/wireless/firmware_upgrade/firmware_upgradation.c", ] - # nvm3 ans startup - if (silabs_board == "BRD4325B") { - sources += [ - "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/src/startup_RS1xxxx.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_dual_flash_intf.c", - ] - } - - if (wifi_soc_common_flash) { - sources += [ - "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/src/startup_common_RS1xxxx.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_common_flash_intf.c", - ] - } - if (!disable_lcd) { sources += [ "${efr32_sdk_root}/platform/middleware/glib/dmd/display/dmd_memlcd.c", @@ -498,13 +462,13 @@ template("siwx917_sdk") { "${efr32_sdk_root}/platform/middleware/glib/glib/glib_rectangle.c", "${efr32_sdk_root}/platform/middleware/glib/glib/glib_string.c", "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/SPI.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/hardware_drivers/memlcd/src/memlcd_917/sl_memlcd_spi.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/hardware_drivers/memlcd/src/sl_memlcd.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/hardware_drivers/memlcd/src/sl_memlcd_display.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_sysrtc.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/service/sleeptimer/src/sl_sleeptimer_hal_si91x_sysrtc.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/src/sl_si91x_ulp_timer.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/cmsis_driver/SPI.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/memlcd/src/memlcd_917/sl_memlcd_spi.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/memlcd/src/sl_memlcd.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/memlcd/src/sl_memlcd_display.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_sysrtc.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/sleeptimer/src/sl_sleeptimer_hal_si91x_sysrtc.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/src/sl_si91x_ulp_timer.c", ] } diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 60b66906dbece4..0802242ab9ad37 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 60b66906dbece464753e7059c901714bececc630 +Subproject commit 0802242ab9ad37baac84df3621af3cbca754cfaf diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index 725f05815c1a9f..55777dae54b5a7 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -15,7 +15,6 @@ declare_args() { # EFR32 board used silabs_board = "" - silabs_board_lower = "" # LCD is enabled by default # Boards BRD4166A, BRD2601B, BRD2703A and BRD4319A do not have a LCD so they disable it explicitly @@ -38,7 +37,6 @@ declare_args() { chip_enable_ble_rs911x = false wifi_soc = false - wifi_soc_common_flash = false #Disable MQTT by default enable_dic = false @@ -107,37 +105,12 @@ if (silabs_board == "BRD4304A") { } else if (silabs_board == "BRD4170A") { silabs_family = "efr32mg12" silabs_mcu = "EFR32MG12P433F1024GM68" -} else if (silabs_board == "BRD4325B") { - silabs_family = "SiWx917-dual" - silabs_mcu = "SiWG917M111MGTBA" - disable_lcd = true - show_qr_code = false - wifi_soc = true - silabs_board_lower = "brd4325b" -} else if (silabs_board == "BRD4325C") { - silabs_family = "SiWx917-common" - silabs_mcu = "SiWG917M111MGTBA" - disable_lcd = true - show_qr_code = false - wifi_soc = true - wifi_soc_common_flash = true - silabs_board_lower = "brd4325c" -} else if (silabs_board == "BRD4325G") { - silabs_family = "SiWx917-common" - silabs_mcu = "SiWG917M111MGTBA" - disable_lcd = true - show_qr_code = false - wifi_soc = true - wifi_soc_common_flash = true - silabs_board_lower = "brd4325g" } else if (silabs_board == "BRD4338A") { silabs_family = "SiWx917-common" silabs_mcu = "SiWG917M111MGTBA" disable_lcd = false show_qr_code = true wifi_soc = true - wifi_soc_common_flash = true - silabs_board_lower = "brd4338a" } else if (silabs_board == "BRD4180A") { assert( false, diff --git a/third_party/silabs/wifi_sdk b/third_party/silabs/wifi_sdk index 58a240448abd15..a63c4cd9c4d5cc 160000 --- a/third_party/silabs/wifi_sdk +++ b/third_party/silabs/wifi_sdk @@ -1 +1 @@ -Subproject commit 58a240448abd15f7a4604b3f1a19ff398c341863 +Subproject commit a63c4cd9c4d5cc63c0d8c6d89c35c0891fc47bf8