Skip to content

Commit 7b7fe91

Browse files
jmartinez-silabsmkardous-silabsrestyled-commits
authored
[Silabs] Update Silabs sdks version and related enablement (#35083)
* Update all sdks to new verions * 9116 changes to support sdk update * 917 changes to support sdk update * Update to provision storage for configurable address * bump matter_support submodule * Bump docker image version used for silabs ci * Restyled by clang-format * Fix wifi ncp builds --------- Co-authored-by: Mathieu Kardous <mathieu.kardous@silabs.com> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 9a90d8b commit 7b7fe91

18 files changed

+104
-121
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:73
43+
image: ghcr.io/project-chip/chip-build-efr32:74
4444
volumes:
4545
- "/tmp/bloat_reports:/tmp/bloat_reports"
4646
steps:

.gitmodules

+3-3
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,17 @@
213213
[submodule "third_party/silabs/simplicity_sdk"]
214214
path = third_party/silabs/simplicity_sdk
215215
url = https://github.com/SiliconLabs/simplicity_sdk.git
216-
branch = v2024.6.0
216+
branch = v2024.6.1-0
217217
platforms = silabs
218218
[submodule "third_party/silabs/wiseconnect-wifi-bt-sdk"]
219219
path = third_party/silabs/wiseconnect-wifi-bt-sdk
220220
url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk.git
221-
branch = 2.8.2
221+
branch = 2.10.0
222222
platforms = silabs
223223
[submodule "third_party/silabs/wifi_sdk"]
224224
path = third_party/silabs/wifi_sdk
225225
url = https://github.com/SiliconLabs/wiseconnect.git
226-
branch = v3.3.0
226+
branch = v3.3.1
227227
platforms = silabs
228228
[submodule "editline"]
229229
path = third_party/editline/repo

examples/platform/silabs/FreeRTOSConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ extern uint32_t SystemCoreClock;
150150
#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 70
151151
#define configPRE_SLEEP_PROCESSING(x)
152152
#define configPOST_SLEEP_PROCESSING(x)
153-
#define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING(x) sl_si91x_pre_supress_ticks_and_sleep(&x)
153+
#define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING(x)
154154
#else
155155
#define configUSE_TICKLESS_IDLE 0
156156
#endif // SL_CATALOG_POWER_MANAGER_PRESENT

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

+27-68
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
* limitations under the License.
1616
*/
1717

18+
/*
19+
* This file implements the interface to the wifi sdk
20+
*/
21+
1822
#include <stdio.h>
1923
#include <stdlib.h>
2024
#include <string.h>
@@ -23,38 +27,44 @@
2327
#include "sl_matter_wifi_config.h"
2428
#endif // SL_MATTER_GN_BUILD
2529

30+
#include "FreeRTOS.h"
31+
#include "ble_config.h"
32+
#include "dhcp_client.h"
33+
#include "event_groups.h"
34+
#include "sl_board_configuration.h"
2635
#include "sl_status.h"
36+
#include "task.h"
37+
#include "wfx_host_events.h"
38+
#include "wfx_rsi.h"
2739
#include <app/icd/server/ICDServerConfig.h>
2840
#include <inet/IPAddress.h>
2941
#include <lib/support/logging/CHIPLogging.h>
3042

31-
#include "FreeRTOS.h"
32-
#include "event_groups.h"
33-
#include "sl_board_configuration.h"
3443
extern "C" {
44+
#include "sl_net.h"
45+
#include "sl_si91x_driver.h"
46+
#include "sl_si91x_host_interface.h"
3547
#include "sl_si91x_types.h"
48+
#include "sl_wifi.h"
49+
#include "sl_wifi_callback_framework.h"
3650
#include "sl_wifi_constants.h"
3751
#include "sl_wifi_types.h"
3852
#include "sl_wlan_config.h"
53+
#include "wfx_host_events.h"
54+
#if SL_MBEDTLS_USE_TINYCRYPT
55+
#include "sl_si91x_constants.h"
56+
#include "sl_si91x_trng.h"
57+
#endif // SL_MBEDTLS_USE_TINYCRYPT
3958
}
40-
#include "task.h"
4159

4260
#if (EXP_BOARD)
4361
#include "rsi_bt_common_apis.h"
4462
#endif
4563

46-
#include "ble_config.h"
47-
4864
#if CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
4965
#include "rsi_rom_power_save.h"
5066
#include "sl_si91x_button_pin_config.h"
51-
#if DISPLAY_ENABLED
52-
#include "sl_memlcd.h"
53-
#endif // DISPLAY_ENABLED
54-
extern "C" {
55-
#include "sl_si91x_driver.h"
56-
#include "sl_si91x_m4_ps.h"
57-
}
67+
#include "sl_si91x_power_manager.h"
5868

5969
namespace {
6070
// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
@@ -67,9 +77,6 @@ bool ps_requirement_added = false;
6777
} // namespace
6878
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
6979

70-
#include "dhcp_client.h"
71-
#include "wfx_host_events.h"
72-
#include "wfx_rsi.h"
7380
#define ADV_SCAN_THRESHOLD -40
7481
#define ADV_RSSI_TOLERANCE_THRESHOLD 5
7582
#define ADV_ACTIVE_SCAN_DURATION 15
@@ -79,17 +86,9 @@ bool ps_requirement_added = false;
7986

8087
// TODO: Confirm that this value works for size and timing
8188
#define WFX_QUEUE_SIZE 10
82-
extern "C" {
83-
#include "sl_net.h"
84-
#include "sl_si91x_host_interface.h"
85-
#include "sl_wifi.h"
86-
#include "sl_wifi_callback_framework.h"
87-
#include "wfx_host_events.h"
88-
#if SL_MBEDTLS_USE_TINYCRYPT
89-
#include "sl_si91x_constants.h"
90-
#include "sl_si91x_trng.h"
91-
#endif // SL_MBEDTLS_USE_TINYCRYPT
92-
}
89+
90+
// TODO: Figure out why we actually need this, we are already handling failure and retries somewhere else.
91+
#define WIFI_SCAN_TIMEOUT_TICK 10000
9392

9493
WfxRsi_t wfx_rsi;
9594

@@ -109,20 +108,9 @@ bool is_wifi_disconnection_event = false;
109108
uint32_t retryInterval = WLAN_MIN_RETRY_TIMER_MS;
110109
volatile bool scan_results_complete = false;
111110
volatile bool bg_scan_results_complete = false;
112-
113-
// TODO: Figure out why we actually need this, we are already handling failure and retries somewhere else.
114-
#define WIFI_SCAN_TIMEOUT_TICK 10000
115-
116111
extern osSemaphoreId_t sl_rs_ble_init_sem;
117-
118-
/*
119-
* This file implements the interface to the wifi sdk
120-
*/
121-
122112
static wfx_wifi_scan_ext_t temp_reset;
123-
124113
volatile sl_status_t callback_status = SL_STATUS_OK;
125-
126114
// Scan semaphore
127115
static osSemaphoreId_t sScanSemaphore;
128116
// DHCP Poll timer
@@ -319,28 +307,6 @@ void sl_si91x_invoke_btn_press_event()
319307
}
320308
#endif // ENABLE_CHIP_SHELL
321309
}
322-
323-
/******************************************************************
324-
* @fn sl_app_sleep_ready()
325-
* @brief
326-
* Called from the supress ticks from tickless to check if it
327-
* is ok to go to sleep
328-
* @param[in] None
329-
* @return
330-
* None
331-
*********************************************************************/
332-
uint32_t sl_app_sleep_ready()
333-
{
334-
if (wfx_rsi.dev_state & WFX_RSI_ST_SLEEP_READY)
335-
{
336-
#if DISPLAY_ENABLED
337-
// Powering down the LCD
338-
sl_memlcd_power_on(NULL, false);
339-
#endif /* DISPLAY_ENABLED */
340-
return true;
341-
}
342-
return false;
343-
}
344310
#endif // SLI_SI91X_MCU_INTERFACE
345311

346312
/******************************************************************
@@ -370,14 +336,7 @@ int32_t wfx_rsi_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_
370336
ChipLogError(DeviceLayer, "sl_wifi_set_performance_profile failed: 0x%lx", static_cast<uint32_t>(status));
371337
return status;
372338
}
373-
if (sl_si91x_wifi_state == HIGH_PERFORMANCE)
374-
{
375-
wfx_rsi.dev_state &= ~(WFX_RSI_ST_SLEEP_READY);
376-
}
377-
else
378-
{
379-
wfx_rsi.dev_state |= WFX_RSI_ST_SLEEP_READY;
380-
}
339+
381340
return status;
382341
}
383342
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */

examples/platform/silabs/display/demo-ui.c

+12-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "glib.h"
2626
#include "sl_component_catalog.h"
2727
#include "sl_memlcd.h"
28+
#include <app/icd/server/ICDServerConfig.h>
2829
#if SL_WIFI && !SLI_SI91X_MCU_INTERFACE
2930
#include "spi_multiplex.h"
3031
#endif // SL_WIFI && !SLI_SI91X_MCU_INTERFACE
@@ -106,9 +107,12 @@ void demoUIInit(GLIB_Context_t * context)
106107
sl_status_t updateDisplay(void)
107108
{
108109
sl_status_t status = SL_STATUS_OK;
109-
#if SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && DISPLAY_ENABLED
110+
111+
#if SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER
112+
// In sleep, memlcd will not be retained so re-initialize MEMLCD interface after sleep wakeup
110113
sl_memlcd_post_wakeup_init();
111-
#endif // SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && DISPLAY_ENABLED
114+
#endif // SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && CHIP_CONFIG_ENABLE_ICD_SERVER
115+
112116
#if SL_LCDCTRL_MUX
113117
status = sl_wfx_host_pre_lcd_spi_transfer();
114118
if (status != SL_STATUS_OK)
@@ -123,6 +127,12 @@ sl_status_t updateDisplay(void)
123127
return status;
124128
#endif // SL_LCDCTRL_MUX
125129

130+
#if SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER
131+
// MEMLCD is not a UULP component and not available in sleep so powering down before sleep and need to be re-initialized after
132+
// sleep-wakeup
133+
sl_memlcd_power_on(NULL, false);
134+
#endif // SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER
135+
126136
return SL_STATUS_OK;
127137
}
128138

examples/platform/silabs/efr32/rs911x/rsi_if.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,9 @@ static void wfx_rsi_save_ap_info() // translation
511511
case SME_WEP:
512512
wfx_rsi.sec.security = WFX_SEC_WEP;
513513
break;
514-
case SME_WPA3_TRANSITION:
514+
case SME_WPA3_PERSONAL_TRANSITION:
515515
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
516-
case SME_WPA3:
516+
case SME_WPA3_PERSONAL:
517517
wfx_rsi.sec.security = WFX_SEC_WPA3;
518518
#else
519519
wfx_rsi.sec.security = WFX_SEC_WPA2;
@@ -557,7 +557,7 @@ static void wfx_rsi_do_join(void)
557557
break;
558558
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
559559
case WFX_SEC_WPA3:
560-
connect_security_mode = RSI_WPA3_TRANSITION;
560+
connect_security_mode = RSI_WPA3_PERSONAL_TRANSITION;
561561
break;
562562
#endif // WIFI_ENABLE_SECURITY_WPA3_TRANSITION
563563
case WFX_SEC_NONE:

examples/platform/silabs/provision/ProvisionStorageDefault.cpp

+13-8
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ size_t RoundNearest(size_t n, size_t multiple)
9090
CHIP_ERROR WriteFile(Storage & store, SilabsConfig::Key offset_key, SilabsConfig::Key size_key, const ByteSpan & value)
9191
{
9292
uint32_t base_addr = 0;
93-
ReturnErrorOnFailure(store.GetBaseAddress(base_addr));
93+
ReturnErrorOnFailure(store.GetCredentialsBaseAddress(base_addr));
9494
if (0 == sCredentialsOffset)
9595
{
9696
ReturnErrorOnFailure(ErasePage(base_addr));
@@ -120,7 +120,7 @@ CHIP_ERROR WriteFile(Storage & store, SilabsConfig::Key offset_key, SilabsConfig
120120
CHIP_ERROR ReadFileByOffset(Storage & store, const char * description, uint32_t offset, uint32_t size, MutableByteSpan & value)
121121
{
122122
uint32_t base_addr = 0;
123-
ReturnErrorOnFailure(store.GetBaseAddress(base_addr));
123+
ReturnErrorOnFailure(store.GetCredentialsBaseAddress(base_addr));
124124

125125
uint8_t * address = (uint8_t *) (base_addr + offset);
126126
ByteSpan span(address, size);
@@ -167,12 +167,7 @@ CHIP_ERROR Storage::Initialize(uint32_t flash_addr, uint32_t flash_size)
167167
setNvm3End(base_addr);
168168
#endif
169169
}
170-
return SilabsConfig::WriteConfigValue(SilabsConfig::kConfigKey_Creds_Base_Addr, base_addr);
171-
}
172-
173-
CHIP_ERROR Storage::GetBaseAddress(uint32_t & value)
174-
{
175-
return SilabsConfig::ReadConfigValue(SilabsConfig::kConfigKey_Creds_Base_Addr, value);
170+
return SetCredentialsBaseAddress(base_addr);
176171
}
177172

178173
CHIP_ERROR Storage::Commit()
@@ -625,6 +620,16 @@ CHIP_ERROR Storage::SignWithDeviceAttestationKey(const ByteSpan & message, Mutab
625620
// Other
626621
//
627622

623+
CHIP_ERROR Storage::SetCredentialsBaseAddress(uint32_t addr)
624+
{
625+
return SilabsConfig::WriteConfigValue(SilabsConfig::kConfigKey_Creds_Base_Addr, addr);
626+
}
627+
628+
CHIP_ERROR Storage::GetCredentialsBaseAddress(uint32_t & addr)
629+
{
630+
return SilabsConfig::ReadConfigValue(SilabsConfig::kConfigKey_Creds_Base_Addr, addr);
631+
}
632+
628633
CHIP_ERROR Storage::SetProvisionVersion(const char * value, size_t size)
629634
{
630635
return SilabsConfig::WriteConfigValueStr(SilabsConfig::kConfigKey_Provision_Version, value, size);

examples/platform/silabs/provision/ProvisionStorageFlash.cpp

+12-6
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,6 @@ CHIP_ERROR Storage::Commit()
296296
return CHIP_NO_ERROR;
297297
}
298298

299-
CHIP_ERROR Storage::GetBaseAddress(uint32_t & value)
300-
{
301-
value = (uint32_t) Flash::sReadOnlyPage;
302-
return CHIP_NO_ERROR;
303-
}
304-
305299
//
306300
// DeviceInstanceInfoProvider
307301
//
@@ -675,6 +669,18 @@ CHIP_ERROR Storage::SignWithDeviceAttestationKey(const ByteSpan & message, Mutab
675669
// Other
676670
//
677671

672+
CHIP_ERROR Storage::SetCredentialsBaseAddress(uint32_t addr)
673+
{
674+
Flash::sReadOnlyPage = (uint8_t *) addr;
675+
return CHIP_NO_ERROR;
676+
}
677+
678+
CHIP_ERROR Storage::GetCredentialsBaseAddress(uint32_t & addr)
679+
{
680+
addr = (uint32_t) Flash::sReadOnlyPage;
681+
return CHIP_NO_ERROR;
682+
}
683+
678684
CHIP_ERROR Storage::SetProvisionVersion(const char * value, size_t size)
679685
{
680686
return Flash::Set(Parameters::ID::kVersion, value, size);

examples/platform/silabs/wfx_rsi.h

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ typedef enum
6262
WFX_RSI_ST_STA_READY = (WFX_RSI_ST_STA_CONNECTED | WFX_RSI_ST_STA_DHCP_DONE),
6363
WFX_RSI_ST_STARTED = (1 << 9), /* RSI task started */
6464
WFX_RSI_ST_SCANSTARTED = (1 << 10), /* Scan Started */
65-
WFX_RSI_ST_SLEEP_READY = (1 << 11) /* Notify the M4 to go to sleep*/
6665
} WfxStateType_e;
6766

6867
typedef struct WfxEvent_s

src/platform/silabs/provision/ProvisionStorage.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ enum ID : uint16_t
4242
kFlashAddress = 0x0101,
4343
kFlashSize = 0x0102,
4444
kFlashPageSize = 0x0103,
45-
kBaseAddress = 0x0104,
45+
kCredsAddress = 0x0104,
4646
kCsrFile = 0x0105,
4747
// Options,
4848
kVersion = 0x0111,
@@ -175,7 +175,6 @@ struct Storage : public GenericStorage,
175175

176176
CHIP_ERROR Initialize(uint32_t flash_addr = 0, uint32_t flash_size = 0);
177177
CHIP_ERROR Commit();
178-
CHIP_ERROR GetBaseAddress(uint32_t & value);
179178

180179
//
181180
// Generic Interface
@@ -233,6 +232,8 @@ struct Storage : public GenericStorage,
233232
// Other
234233
//
235234

235+
CHIP_ERROR SetCredentialsBaseAddress(uint32_t addr);
236+
CHIP_ERROR GetCredentialsBaseAddress(uint32_t & addr);
236237
CHIP_ERROR GetSetupPayload(chip::MutableCharSpan & value);
237238
CHIP_ERROR SetProvisionRequest(bool value);
238239
CHIP_ERROR GetProvisionRequest(bool & value);

src/platform/silabs/rs911x/ble_config.h

-1
This file was deleted.
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*******************************************************************************
2+
* @file ble_config.h
3+
* @brief
4+
*******************************************************************************
5+
* # License
6+
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b>
7+
*******************************************************************************
8+
*
9+
* The licensor of this software is Silicon Laboratories Inc. Your use of this
10+
* software is governed by the terms of Silicon Labs Master Software License
11+
* Agreement (MSLA) available at
12+
* www.silabs.com/about-us/legal/master-software-license-agreement. This
13+
* software is distributed to you in Source Code format and is governed by the
14+
* sections of the MSLA applicable to Source Code.
15+
*
16+
******************************************************************************/
17+
18+
#include <rsi_ble_config.h>

0 commit comments

Comments
 (0)