diff --git a/examples/platform/silabs/MatterConfig.cpp b/examples/platform/silabs/MatterConfig.cpp index 37c68d1ebf6c4c..1b2e604bda36c9 100644 --- a/examples/platform/silabs/MatterConfig.cpp +++ b/examples/platform/silabs/MatterConfig.cpp @@ -155,17 +155,6 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName) SILABS_LOG("%s starting", appName); SILABS_LOG("=================================================="); -#ifdef SI917 - sl_status_t status; - SILABS_LOG("Wireless init starting"); - if ((status = wfx_wifi_rsi_init()) != SL_STATUS_OK) - { - SILABS_LOG("wfx_wifi_start() failed: %s", status); - ReturnErrorOnFailure((CHIP_ERROR)status); - } - SILABS_LOG("WIFI init completed"); -#endif // SI917 - #if PW_RPC_ENABLED chip::rpc::Init(); #endif @@ -275,6 +264,15 @@ CHIP_ERROR SilabsMatterConfig::InitWiFi(void) wfx_securelink_task_start(); // start securelink key renegotiation task #endif // SL_WFX_USE_SECURE_LINK #endif /* WF200_WIFI */ + +#ifdef SI917 + sl_status_t status; + if ((status = wfx_wifi_rsi_init()) != SL_STATUS_OK) + { + ReturnErrorOnFailure((CHIP_ERROR)status); + } +#endif // SI917 + return CHIP_NO_ERROR; } #endif // SL_WIFI diff --git a/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_m4.c b/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_m4.c index ee45532d08ddfc..61002010b96b85 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_m4.c +++ b/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_m4.c @@ -17,7 +17,6 @@ #include "rsi_board.h" #include "rsi_chip.h" -#include "rsi_driver.h" #include "rsi_m4.h" #ifdef COMMON_FLASH_EN #include "rsi_power_save.h" @@ -94,4 +93,4 @@ void IRQ021_Handler(void) btn0 = 0; sl_button_on_change(0, 1); } -} \ No newline at end of file +} diff --git a/examples/platform/silabs/SiWx917/init_ccpPlatform.cpp b/examples/platform/silabs/SiWx917/init_ccpPlatform.cpp deleted file mode 100644 index 1c9e83bec89139..00000000000000 --- a/examples/platform/silabs/SiWx917/init_ccpPlatform.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * 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. - */ - -#include "AppConfig.h" -#include -#include - -//#include "main_task.h" -#ifdef __cplusplus -extern "C" { -#endif -#include "init_ccpPlatform.h" -#include "rsi_pll.h" -#include "rsi_rom_clks.h" -#include "sl_system_init.h" -#include "sli_siwx917_soc.h" -#include "em_core.h" -#include -#include -#include - -void initAntenna(void); - -/* GPIO button config */ -void soc_pll_config(void); -void RSI_Wakeupsw_config(void); -void RSI_Wakeupsw_config_gpio0(void); - -void init_ccpPlatform(void) -{ - sl_system_init(); - NVIC_SetPriority(SVCall_IRQn, CORE_INTERRUPT_HIGHEST_PRIORITY); - - soc_pll_config(); - RSI_Wakeupsw_config(); - - RSI_Wakeupsw_config_gpio0(); -#if SILABS_LOG_ENABLED - silabsInitLog(); -#endif -} - -#ifdef __cplusplus -} -#endif diff --git a/examples/platform/silabs/SilabsDeviceDataProvider.cpp b/examples/platform/silabs/SilabsDeviceDataProvider.cpp index d0a7a87ffbe394..e3b22fafdb721c 100644 --- a/examples/platform/silabs/SilabsDeviceDataProvider.cpp +++ b/examples/platform/silabs/SilabsDeviceDataProvider.cpp @@ -25,7 +25,6 @@ #ifdef SIWX917_USE_COMISSIONABLE_DATA #include "DeviceConfig.h" -#include "siwx917_utils.h" #include #include #endif // SIWX917_USE_COMISSIONABLE_DATA diff --git a/examples/platform/silabs/ldscripts/SiWx917.ld b/examples/platform/silabs/ldscripts/SiWx917.ld deleted file mode 100644 index a9919f0c5f23e6..00000000000000 --- a/examples/platform/silabs/ldscripts/SiWx917.ld +++ /dev/null @@ -1,222 +0,0 @@ -/***************************************************************************//** - * GCC Linker script for Silicon Labs devices - ******************************************************************************* - * # License - * Copyright 2020 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - MEMORY - { - FLASH (rx) : ORIGIN = 0x8012000, LENGTH = 0x400000 - RAM (rwx) : ORIGIN = 0x400, LENGTH = 0x3e800 - } - -ENTRY(Reset_Handler) - -SECTIONS -{ - - .text : - { - linker_vectors_begin = .; - KEEP(*(.vectors)) - linker_vectors_end = .; - - __Vectors_End = .; - __Vectors_Size = __Vectors_End - __Vectors; - - linker_code_begin = .; - *(SORT_BY_ALIGNMENT(.text*)) - linker_code_end = .; - - 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*) - *(.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) - - /* Add each additional data section here */ -/* - LONG (__etext2) - LONG (__data2_start__) - LONG ((__data2_end__ - __data2_start__) / 4) -*/ - __copy_table_end__ = .; - } > FLASH - - .zero.table : - { - . = ALIGN(4); - __zero_table_start__ = .; - /* Add each additional bss section here */ -/* - LONG (__bss2_start__) - LONG ((__bss2_end__ - __bss2_start__) / 4) -*/ - __zero_table_end__ = .; - } > FLASH - - __etext = .; - - /* Start placing output sections which are loaded into RAM */ - . = ORIGIN(RAM); - - .stack ALIGN(8) (NOLOAD): - { - __StackLimit = .; - KEEP(*(.stack*)) - . = ALIGN(4); - __StackTop = .; - PROVIDE(__stack = __StackTop); - } > RAM - - - .noinit . (NOLOAD): - { - *(.noinit*); - } > RAM - - .data . : AT (__etext) - { - . = ALIGN(4); - __data_start__ = .; - *(vtable) - *(SORT_BY_ALIGNMENT(.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 = .); - - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss . : - { - . = ALIGN(4); - __bss_start__ = .; - *(SORT_BY_ALIGNMENT(.bss*)) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - end = __end__; - _end = __end__; - KEEP(*(.heap*)) - __HeapLimit = ORIGIN(RAM) + LENGTH(RAM); - } > RAM - - __heap_size = __HeapLimit - __HeapBase; - __ram_end__ = 0x400 + 0x3e800; - __main_flash_end__ = 0x8012000 + 0x400000; - - /* 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. */ - .internal_storage (DSECT) : { - KEEP(*(.internal_storage*)) - } > FLASH - - - .nvm (DSECT) : { - KEEP(*(.simee*)) - } > FLASH - - linker_nvm_end = __main_flash_end__; - linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm); - linker_nvm_size = SIZEOF(.nvm); - linker_storage_end = linker_nvm_begin; - __nvm3Base = linker_nvm_begin; - - linker_storage_begin = linker_storage_end - SIZEOF(.internal_storage); - linker_storage_size = SIZEOF(.internal_storage); - ASSERT((linker_storage_begin >= (__etext + SIZEOF(.data))), "FLASH memory overflowed !") - - - app_flash_end = 0x8012000 + 0x400000; - ASSERT( (linker_nvm_begin + SIZEOF(.nvm)) <= app_flash_end, "NVM3 is excessing the flash size !") -} diff --git a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp index c6303356eb1112..5ef3cc09dec3b7 100644 --- a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp +++ b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp @@ -25,11 +25,14 @@ #endif // TODO add includes ? -extern "C" void RSI_Board_LED_Set(int, bool); -extern "C" void RSI_Board_LED_Toggle(int); -extern "C" void RSI_Wakeupsw_config(void); -extern "C" void RSI_Wakeupsw_config_gpio0(void); -extern "C" void sl_platform_init(void); +extern "C" { +#include "sl_event_handler.h" + +void RSI_Board_LED_Set(int, bool); +void RSI_Board_LED_Toggle(int); +void RSI_Wakeupsw_config(void); +void RSI_Wakeupsw_config_gpio0(void); +} namespace chip { namespace DeviceLayer { diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index 2e77dbfee3c242..d9b620aa7066ea 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -18,7 +18,7 @@ import("//build_overrides/jlink.gni") import("${chip_root}/src/platform/device.gni") import("${efr32_sdk_build_root}/silabs_board.gni") -if ((silabs_board == "BRD4325B") || (silabs_board == "BRD4325C") || (silabs_board == "BRD4325G")) { # CCP board +if (wifi_soc == true) { # CCP board import("${efr32_sdk_build_root}/SiWx917_sdk.gni") } else { import("${efr32_sdk_build_root}/efr32_sdk.gni") @@ -53,7 +53,7 @@ group("efr32_sdk") { public_configs = [ ":silabs_config" ] } -if ((silabs_board != "BRD4325B") || (silabs_board != "BRD4325C") || (silabs_board != "BRD4325G")) { # CCP board +if (wifi_soc != true) { # CCP board # Openthread GSDK libraries configurations if (use_silabs_thread_lib) { config("libopenthread-platform_config") { diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index 3990d9f30a0244..532e18e14854e0 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -152,15 +152,11 @@ template("siwx917_sdk") { "SL_PLATFORM_EXAMPLES_ENABLE", "SI91X_DEVICE", "SI917_RADIO_BOARD", - # "SL_NET_COMPONENT_INCLUDED", "FLASH_PAGE_SIZE", "SL_NVM3_PRESENT", "ROM_WIRELESS", "SRAM_BASE=0x0C000000UL", "SRAM_SIZE=0x00040000UL", - # "SL_ONNETWORK_PAIRING=1", - # "SL_WIFI_SSID=\"matter_openwrt\"", - # "SL_WIFI_PSK=\"matter@123\"", ] if ( silabs_board == "BRD4325B" ) { diff --git a/third_party/silabs/silabs_arm.gni b/third_party/silabs/silabs_arm.gni index 69210334a040ce..996a34b2cb6071 100644 --- a/third_party/silabs/silabs_arm.gni +++ b/third_party/silabs/silabs_arm.gni @@ -14,7 +14,7 @@ import("silabs_board.gni") -if (silabs_family == "efr32mg12" || silabs_family == "SiWx917-dual" || silabs_family == "SiWx917-common") { +if ((silabs_family == "efr32mg12") || (wifi_soc == true)) { arm_arch = "armv7e-m" arm_abi = "aapcs" arm_cpu = "cortex-m4" diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index c653a089207eab..ec060ed08422d9 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -98,19 +98,19 @@ if (silabs_board == "BRD4304A") { silabs_mcu = "EFR32MG12P433F1024GM68" } else if (silabs_board == "BRD4325B") { silabs_family = "SiWx917-dual" - silabs_mcu = "EFR32MG12P432F1024GL125" + silabs_mcu = "SiWG917M111MGTBA" disable_lcd = true show_qr_code = false wifi_soc = true } else if (silabs_board == "BRD4325C") { silabs_family = "SiWx917-common" - silabs_mcu = "EFR32MG12P432F1024GL125" + silabs_mcu = "SiWG917M111MGTBA" disable_lcd = true show_qr_code = false wifi_soc = true } else if (silabs_board == "BRD4325G") { silabs_family = "SiWx917-common" - silabs_mcu = "EFR32MG12P432F1024GL125" + silabs_mcu = "SiWG917M111MGTBA" disable_lcd = true show_qr_code = false wifi_soc = true