Skip to content

Commit d7a488f

Browse files
[Silabs] Update Silabs SDK versions (project-chip#33229)
* Update SDK to latest versions * Update docker version * Update slcp with new gsdk version * Update gitmodules * Update matter support submodule * Refactor Sleepy APIs for 917 * restyle * update cloud build --------- Co-authored-by: Rohan Sahay <Rohan.Sahay@silabs.com>
1 parent 9db03ee commit d7a488f

File tree

16 files changed

+190
-95
lines changed

16 files changed

+190
-95
lines changed

.github/workflows/examples-efr32.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
if: github.actor != 'restyled-io[bot]'
4141

4242
container:
43-
image: ghcr.io/project-chip/chip-build-efr32:47
43+
image: ghcr.io/project-chip/chip-build-efr32:49
4444
volumes:
4545
- "/tmp/bloat_reports:/tmp/bloat_reports"
4646
steps:

.github/workflows/release_artifacts.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323

2424
env:
2525
CHIP_NO_LOG_TIMESTAMPS: true
26-
26+
2727
jobs:
2828
esp32:
2929
name: ESP32
@@ -38,7 +38,7 @@ jobs:
3838
- name: Checkout
3939
uses: actions/checkout@v4
4040
with:
41-
ref: "${{ github.event.inputs.releaseTag }}"
41+
ref: "${{ github.event.inputs.releaseTag }}"
4242
- name: Bootstrap
4343
uses: ./.github/actions/bootstrap
4444

@@ -64,17 +64,18 @@ jobs:
6464
runs-on: ubuntu-latest
6565

6666
container:
67-
image: ghcr.io/project-chip/chip-build-efr32:47
67+
image: ghcr.io/project-chip/chip-build-efr32:49
6868
steps:
6969
- name: Checkout
7070
uses: actions/checkout@v4
7171
with:
72-
ref: "${{ github.event.inputs.releaseTag }}"
72+
ref: "${{ github.event.inputs.releaseTag }}"
7373
- name: Bootstrap
7474
uses: ./.github/actions/bootstrap
7575

7676
- name: Build example EFR32 Lock App
77-
run: scripts/examples/gn_silabs_example.sh examples/lock-app/efr32/
77+
run:
78+
scripts/examples/gn_silabs_example.sh examples/lock-app/efr32/
7879
out/lock_app_debug $SILABS_BOARD
7980

8081
- name: Upload artifact

.gitmodules

+2-3
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
[submodule "third_party/silabs/gecko_sdk"]
245245
path = third_party/silabs/gecko_sdk
246246
url = https://github.com/SiliconLabs/gecko_sdk.git
247-
branch = v4.4.1
247+
branch = v4.4.2
248248
platforms = silabs
249249
[submodule "third_party/silabs/wiseconnect-wifi-bt-sdk"]
250250
path = third_party/silabs/wiseconnect-wifi-bt-sdk
@@ -254,7 +254,7 @@
254254
[submodule "third_party/silabs/wifi_sdk"]
255255
path = third_party/silabs/wifi_sdk
256256
url = https://github.com/SiliconLabs/wiseconnect.git
257-
branch = v3.1.3
257+
branch = v3.1.3-matter-hotfix.4
258258
platforms = silabs
259259
[submodule "editline"]
260260
path = third_party/editline/repo
@@ -334,4 +334,3 @@
334334
url = https://github.com/Infineon/optiga-trust-m.git
335335
branch = matter_support
336336
platforms = infineon
337-

examples/platform/silabs/FreeRTOSConfig.h

+15-2
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,21 @@ extern uint32_t SystemCoreClock;
141141
/* Energy saving modes. */
142142
#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
143143
#define configUSE_TICKLESS_IDLE 1
144+
#elif SL_ICD_ENABLED && SI917_M4_SLEEP_ENABLED
145+
#define configUSE_TICKLESS_IDLE 1
146+
#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 70
147+
#define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING(x) vTaskPreSuppressTicksAndSleepProcessing(&x)
148+
#define configPRE_SLEEP_PROCESSING(x) sl_wfx_host_si91x_sleep(&x)
149+
#define configPOST_SLEEP_PROCESSING(x) sl_si91x_post_sleep_update_ticks(&x)
144150
#else
145151
#define configUSE_TICKLESS_IDLE 0
146152
#endif // SL_CATALOG_POWER_MANAGER_PRESENT
147153

154+
#if defined(SLI_SI91X_MCU_INTERFACE)
155+
#define configTICK_RATE_HZ (1000)
156+
#else
148157
#define configTICK_RATE_HZ (1024)
158+
#endif // SLI_SI91X_MCU_INTERFACE
149159
/* Definition used by Keil to replace default system clock source. */
150160
#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1
151161

@@ -201,8 +211,11 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
201211
#define configUSE_PORT_OPTIMISED_TASK_SELECTION (0)
202212
#define configUSE_TICKLESS_IDLE_SIMPLE_DEBUG (1) /* See into vPortSuppressTicksAndSleep source code for explanation */
203213
#define configMAX_PRIORITIES (56)
204-
#define configMINIMAL_STACK_SIZE (320) /* Number of words to use for Idle and Timer stacks */
205-
214+
#if SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED
215+
#define configMINIMAL_STACK_SIZE (1024) /* Number of words to use for Idle and Timer stacks */
216+
#else // For EFR32
217+
#define configMINIMAL_STACK_SIZE (320) /* Number of words to use for Idle and Timer stacks */
218+
#endif // SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED
206219
#ifdef HEAP_MONITORING
207220
#define configMAX_TASK_NAME_LEN (24)
208221
#else

examples/platform/silabs/MatterConfig.cpp

+61-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343

4444
#ifdef SLI_SI91X_MCU_INTERFACE
4545
#include "wfx_rsi.h"
46-
#endif /* SLI_SI91X_MCU_INTERFACE */
46+
#if CHIP_CONFIG_ENABLE_ICD_SERVER && SI917_M4_SLEEP_ENABLED
47+
#include "rsi_m4.h"
48+
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SI917_M4_SLEEP_ENABLED
49+
#endif // SLI_SI91X_MCU_INTERFACE
4750

4851
#include <crypto/CHIPCryptoPAL.h>
4952
// If building with the EFR32-provided crypto backend, we can use the
@@ -342,7 +345,6 @@ CHIP_ERROR SilabsMatterConfig::InitWiFi(void)
342345
sl_status_t status;
343346
if ((status = wfx_wifi_rsi_init()) != SL_STATUS_OK)
344347
{
345-
SILABS_LOG("wfx_wifi_rsi_init failed with status: %x", status);
346348
ReturnErrorOnFailure((CHIP_ERROR) status);
347349
}
348350
#endif // SLI_SI91X_MCU_INTERFACE
@@ -354,9 +356,63 @@ CHIP_ERROR SilabsMatterConfig::InitWiFi(void)
354356
// ================================================================================
355357
// FreeRTOS Callbacks
356358
// ================================================================================
357-
extern "C" void vApplicationIdleHook(void)
359+
#if CHIP_CONFIG_ENABLE_ICD_SERVER && SI917_M4_SLEEP_ENABLED
360+
static bool is_sleep_ready = false;
361+
void vTaskPreSuppressTicksAndSleepProcessing(uint16_t * xExpectedIdleTime)
358362
{
359-
#if SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER
360-
sl_wfx_host_si91x_sleep_wakeup();
363+
// pointer check
364+
if (xExpectedIdleTime == NULL)
365+
{
366+
return;
367+
}
368+
369+
if (!is_sleep_ready)
370+
{
371+
*xExpectedIdleTime = 0;
372+
}
373+
else
374+
{
375+
// a preliminary check of the expected idle time is performed without making M4 inactive
376+
if (*xExpectedIdleTime >= configEXPECTED_IDLE_TIME_BEFORE_SLEEP)
377+
{
378+
// Indicate M4 is Inactive
379+
P2P_STATUS_REG &= ~M4_is_active;
380+
// Waiting for one more clock cycle to make sure M4 H/W Register is updated
381+
P2P_STATUS_REG;
382+
383+
// TODO: This delay is added to sync between M4 and TA. It should be removed once the logic is moved to wifi SDK
384+
for (uint8_t delay = 0; delay < 10; delay++)
385+
{
386+
__ASM("NOP");
387+
}
388+
// Checking if TA has already triggered a packet to M4
389+
// RX_BUFFER_VALID will be cleared by TA if any packet is triggered
390+
if ((P2P_STATUS_REG & TA_wakeup_M4) || (P2P_STATUS_REG & M4_wakeup_TA) || (!(M4SS_P2P_INTR_SET_REG & RX_BUFFER_VALID)))
391+
{
392+
P2P_STATUS_REG |= M4_is_active;
393+
*xExpectedIdleTime = 0;
394+
}
395+
else
396+
{
397+
M4SS_P2P_INTR_CLR_REG = RX_BUFFER_VALID;
398+
M4SS_P2P_INTR_CLR_REG;
399+
400+
TASS_P2P_INTR_MASK_SET = (TX_PKT_TRANSFER_DONE_INTERRUPT | RX_PKT_TRANSFER_DONE_INTERRUPT |
401+
TA_WRITING_ON_COMM_FLASH | NWP_DEINIT_IN_COMM_FLASH
402+
#ifdef SL_SI91X_SIDE_BAND_CRYPTO
403+
| SIDE_BAND_CRYPTO_DONE
361404
#endif
405+
);
406+
}
407+
}
408+
}
409+
}
410+
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SI917_M4_SLEEP_ENABLED
411+
extern "C" void vApplicationIdleHook(void)
412+
{
413+
#if CHIP_CONFIG_ENABLE_ICD_SERVER && SI917_M4_SLEEP_ENABLED
414+
invoke_btn_press_event();
415+
// is_sleep_ready is required since wfx_is_sleep_ready() is not FreeRTOS scheduler agnostic
416+
is_sleep_ready = wfx_is_sleep_ready();
417+
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SI917_M4_SLEEP_ENABLED
362418
}

examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp

+54-32
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ extern "C" {
7878

7979
WfxRsi_t wfx_rsi;
8080

81+
// TODO: remove this. Added only to monitor how many watch dog reset have happened during testing.
82+
#ifdef SLI_SI91X_MCU_INTERFACE
83+
volatile uint32_t watchdog_reset = 0;
84+
#endif // SLI_SI91X_MCU_INTERFACE
85+
8186
/* Declare a variable to hold the data associated with the created event group. */
8287
StaticEventGroup_t rsiDriverEventGroup;
8388

@@ -274,42 +279,52 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t
274279

275280
#if SL_ICD_ENABLED
276281

277-
#if SLI_SI91X_MCU_INTERFACE
278-
/******************************************************************
279-
* @fn sl_wfx_host_si91x_sleep_wakeup()
280-
* @brief
281-
* M4 going to sleep
282-
*
283-
* @param[in] None
284-
* @return
285-
* None
286-
*********************************************************************/
287-
void sl_wfx_host_si91x_sleep_wakeup()
282+
#if SI917_M4_SLEEP_ENABLED
283+
// Required to invoke button press event during sleep as falling edge is not detected
284+
void invoke_btn_press_event()
288285
{
289-
if (wfx_rsi.dev_state & WFX_RSI_ST_SLEEP_READY)
286+
// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
287+
if (!RSI_NPSSGPIO_GetPin(SL_BUTTON_BTN0_PIN) && !btn0_pressed)
290288
{
291-
// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
292-
if (!RSI_NPSSGPIO_GetPin(SL_BUTTON_BTN0_PIN) && !btn0_pressed)
293-
{
294-
sl_button_on_change(SL_BUTTON_BTN0_NUMBER, BUTTON_PRESSED);
295-
btn0_pressed = true;
296-
}
297-
if (RSI_NPSSGPIO_GetPin(SL_BUTTON_BTN0_PIN))
298-
{
299-
#ifdef DISPLAY_ENABLED
300-
// if LCD is enabled, power down the lcd before setting the M4 to sleep
301-
sl_si91x_hardware_setup();
302-
#endif
303-
btn0_pressed = false;
304-
/* Configure RAM Usage and Retention Size */
305-
sl_si91x_m4_sleep_wakeup();
306-
#if SILABS_LOG_ENABLED
307-
silabsInitLog();
308-
#endif
309-
}
289+
sl_button_on_change(SL_BUTTON_BTN0_NUMBER, BUTTON_PRESSED);
290+
btn0_pressed = true;
291+
}
292+
if (RSI_NPSSGPIO_GetPin(SL_BUTTON_BTN0_PIN))
293+
{
294+
btn0_pressed = false;
310295
}
311296
}
312-
#endif // SLI_SI91X_MCU_INTERFACE
297+
298+
/**
299+
* @brief Checks if the Wi-Fi module is ready for sleep.
300+
*
301+
* This function checks if the Wi-Fi module is ready to enter sleep mode.
302+
*
303+
* @return true if the Wi-Fi module is ready for sleep, false otherwise.
304+
*/
305+
bool wfx_is_sleep_ready()
306+
{
307+
// BRD4002A board BTN_PRESS is 0 when pressed, release is 1
308+
// sli_si91x_is_sleep_ready requires OS Scheduler to be active
309+
return ((RSI_NPSSGPIO_GetPin(SL_BUTTON_BTN0_PIN) != 0) && (wfx_rsi.dev_state & WFX_RSI_ST_SLEEP_READY) &&
310+
sli_si91x_is_sleep_ready());
311+
}
312+
313+
/**
314+
* @brief Sleeps for a specified duration and then wakes up.
315+
*
316+
* This function puts the SI91x host into sleep mode for the specified duration
317+
* in milliseconds and then wakes it up.
318+
*
319+
* @param sleep_time_ms The duration in milliseconds to sleep.
320+
*/
321+
void sl_wfx_host_si91x_sleep(uint16_t * sleep_time_ms)
322+
{
323+
SL_ASSERT(sleep_time_ms != NULL);
324+
sl_si91x_m4_sleep_wakeup(sleep_time_ms);
325+
}
326+
327+
#endif // SI917_M4_SLEEP_ENABLED
313328

314329
/******************************************************************
315330
* @fn wfx_rsi_power_save()
@@ -363,6 +378,13 @@ int32_t wfx_wifi_rsi_init(void)
363378
SILABS_LOG("wfx_wifi_rsi_init started");
364379
sl_status_t status;
365380
status = sl_wifi_init(&config, NULL, sl_wifi_default_event_handler);
381+
#ifdef SLI_SI91X_MCU_INTERFACE
382+
// TODO: remove this. Added only to monitor how many watch dog reset have happened during testing.
383+
if ((MCU_FSM->MCU_FSM_WAKEUP_STATUS_REG) & BIT(5))
384+
{
385+
watchdog_reset++;
386+
}
387+
#endif // SLI_SI91X_MCU_INTERFACE
366388
if (status != SL_STATUS_OK)
367389
{
368390
return status;

examples/platform/silabs/ldscripts/SiWx917-common.ld

+7-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ SECTIONS
4040
{
4141
KEEP(*(.isr_vector))
4242
KEEP(*(.reset_handler))
43-
*(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*)
43+
*(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_hal_mcu_m4_rom.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 *os_systick.c.o *sl_wifi_if.c.o *sl_si91x_m4_ps.c.o *sl_platform_wireless.c.o) .text*)
4444

4545
/* .ctors */
4646
*crtbegin.o(.ctors)
@@ -131,7 +131,8 @@ SECTIONS
131131
*sl_si91x_driver.c.o(.text*)
132132
*sli_si91x_multithreaded.c.o(.text*)
133133
*rsi_hal_mcu_m4_ram.c.o(.text*)
134-
*rsi_deepsleep_soc.c.o(.text*)
134+
*rsi_hal_mcu_m4_rom.c.o(.text*)
135+
*rsi_deepsleep_soc.c.o(.text*)
135136
*croutine.c.o(.text*)
136137
*event_groups.c.o(.text*)
137138
*list.c.o(.text*)
@@ -145,6 +146,10 @@ SECTIONS
145146
*sl_rsi_utility.c.o(.text*)
146147
*port.c.o(.text*)
147148
*heap_*.c.o(.text*)
149+
*os_systick.c.o(.text*)
150+
*sl_wifi_if.c.o(.text*)
151+
*sl_si91x_m4_ps.c.o(.text*)
152+
*sl_platform_wireless.c.o(.text*)
148153

149154
. = ALIGN(4);
150155
/* preinit data */
@@ -252,4 +257,3 @@ SECTIONS
252257
app_flash_end = 0x8202000 + 0x1fe000;
253258
ASSERT( (linker_nvm_begin + SIZEOF(.nvm)) <= app_flash_end, "NVM3 is excessing the flash size !")
254259
}
255-

examples/platform/silabs/matter-platform.slcp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ include:
2727
file_list:
2828
- {path: app.h}
2929
- {path: reset_util.h}
30-
sdk: {id: gecko_sdk, version: 4.3.1}
30+
sdk: {id: gecko_sdk, version: 4.4.2}
3131
toolchain_settings: []
3232

3333
component:

integrations/cloudbuild/smoke-test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ steps:
6666
- name: pwenv
6767
path: /pwenv
6868

69-
- name: "ghcr.io/project-chip/chip-build-vscode:47"
69+
- name: "ghcr.io/project-chip/chip-build-vscode:49"
7070
id: EFR32
7171
env:
7272
- PW_ENVIRONMENT_ROOT=/pwenv

src/platform/silabs/SiWx917/BUILD.gn

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ static_library("SiWx917") {
7373
]
7474
}
7575

76-
public_deps = [ "${chip_root}/src/platform:platform_base" ]
76+
public_deps = [
77+
"${chip_root}/src/app/icd/server:icd-server-config",
78+
"${chip_root}/src/platform:platform_base",
79+
]
7780
deps = [ "${chip_root}/src/platform/logging:headers" ]
7881

7982
# Add platform crypto implementation

0 commit comments

Comments
 (0)