Skip to content

Commit f1a4dfa

Browse files
silabs-srishylamarun-silabsrestyled-commitsjmartinez-silabs
authored
[Silabs] - Updating the wifi-sdk to v3.1.1 with required changes (project-chip#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 <arunkumar.padakanti@silabs.com> Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com>
1 parent 9c0cd9e commit f1a4dfa

File tree

15 files changed

+208
-458
lines changed

15 files changed

+208
-458
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
[submodule "third_party/silabs/wifi_sdk"]
250250
path = third_party/silabs/wifi_sdk
251251
url = https://github.com/SiliconLabs/wiseconnect.git
252-
branch = v3.1.0
252+
branch = v3.1.1
253253
platforms = silabs
254254
[submodule "editline"]
255255
path = third_party/editline/repo

examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c

+26-10
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t
169169
wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING);
170170
temp_reset = (wfx_wifi_scan_ext_t *) malloc(sizeof(wfx_wifi_scan_ext_t));
171171
memset(temp_reset, 0, sizeof(wfx_wifi_scan_ext_t));
172-
if (CHECK_IF_EVENT_FAILED(event))
172+
if (SL_WIFI_CHECK_IF_EVENT_FAILED(event))
173173
{
174174
SILABS_LOG("F: Join Event received with %u bytes payload\n", result_length);
175175
callback_status = *(sl_status_t *) result;
@@ -237,14 +237,29 @@ int32_t wfx_wifi_rsi_init(void)
237237
{
238238
SILABS_LOG("wfx_wifi_rsi_init started");
239239
sl_status_t status;
240-
status = sl_wifi_init(&config, default_wifi_event_handler);
240+
status = sl_wifi_init(&config, NULL, sl_wifi_default_event_handler);
241241
if (status != SL_STATUS_OK)
242242
{
243243
SILABS_LOG("wfx_wifi_rsi_init failed %x", status);
244244
}
245245
return status;
246246
}
247247

248+
/*************************************************************************************
249+
* @fn static void sl_print_firmware_version(sl_wifi_firmware_version_t*)
250+
* @brief
251+
* To print the firmware version
252+
* @param[in] sl_wifi_firmware_version_t*
253+
* @return
254+
* None
255+
*****************************************************************************************/
256+
static void sl_print_firmware_version(sl_wifi_firmware_version_t * firmware_version)
257+
{
258+
SILABS_LOG("Firmware version is: %x%x.%d.%d.%d.%d.%d.%d", firmware_version->chip_id, firmware_version->rom_id,
259+
firmware_version->major, firmware_version->minor, firmware_version->security_version, firmware_version->patch_num,
260+
firmware_version->customer_id, firmware_version->build_num);
261+
}
262+
248263
/*************************************************************************************
249264
* @fn static int32_t wfx_rsi_init(void)
250265
* @brief
@@ -257,7 +272,7 @@ static sl_status_t wfx_rsi_init(void)
257272
{
258273
sl_status_t status;
259274

260-
#ifndef RSI_M4_INTERFACE
275+
#ifndef SLI_SI91X_MCU_INTERFACE
261276
status = wfx_wifi_rsi_init();
262277
if (status != SL_STATUS_OK)
263278
{
@@ -266,14 +281,15 @@ static sl_status_t wfx_rsi_init(void)
266281
}
267282
#endif
268283

269-
sl_wifi_version_string_t version = { 0 };
270-
status = sl_wifi_get_firmware_version(&version);
284+
sl_wifi_firmware_version_t version = { 0 };
285+
status = sl_wifi_get_firmware_version(&version);
271286
if (status != SL_STATUS_OK)
272287
{
273-
SILABS_LOG("Get fw version failed: %s", version.version);
288+
SILABS_LOG("Get fw version failed:");
289+
sl_print_firmware_version(&version);
274290
return status;
275291
}
276-
SILABS_LOG("Get current fw version: %s", version.version);
292+
sl_print_firmware_version(&version);
277293

278294
status = sl_wifi_get_mac_address(SL_WIFI_CLIENT_INTERFACE, (sl_mac_address_t *) &wfx_rsi.sta_mac.octet[0]);
279295
if (status != SL_STATUS_OK)
@@ -302,7 +318,7 @@ void wfx_show_err(char * msg)
302318

303319
sl_status_t scan_callback_handler(sl_wifi_event_t event, sl_wifi_scan_result_t * scan_result, uint32_t result_length, void * arg)
304320
{
305-
if (CHECK_IF_EVENT_FAILED(event))
321+
if (SL_WIFI_CHECK_IF_EVENT_FAILED(event))
306322
{
307323
callback_status = *(sl_status_t *) scan_result;
308324
scan_results_complete = true;
@@ -351,7 +367,7 @@ sl_status_t scan_callback_handler(sl_wifi_event_t event, sl_wifi_scan_result_t *
351367
}
352368
sl_status_t show_scan_results(sl_wifi_scan_result_t * scan_result)
353369
{
354-
ARGS_CHECK_NULL_POINTER(scan_result);
370+
SL_WIFI_ARGS_CHECK_NULL_POINTER(scan_result);
355371
int x;
356372
wfx_wifi_scan_result_t ap;
357373
for (x = 0; x < (int) scan_result->scan_count; x++)
@@ -492,7 +508,7 @@ static sl_status_t wfx_rsi_do_join(void)
492508
* And check there is a success
493509
*/
494510
sl_wifi_credential_t cred = { 0 };
495-
cred.type = SL_WIFI_CRED_PSK;
511+
cred.type = SL_WIFI_PSK_CREDENTIAL;
496512
memcpy(cred.psk.value, &wfx_rsi.sec.passkey[0], strlen(wfx_rsi.sec.passkey));
497513
sl_wifi_credential_id_t id = SL_NET_DEFAULT_WIFI_CLIENT_CREDENTIAL_ID;
498514
status = sl_net_set_credential(id, SL_NET_WIFI_PSK, &wfx_rsi.sec.passkey[0], strlen(wfx_rsi.sec.passkey));

examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static const sl_wifi_device_configuration_t config = {
3838
.boot_config = { .oper_mode = SL_SI91X_CLIENT_MODE,
3939
.coex_mode = SL_SI91X_WLAN_BLE_MODE,
4040
.feature_bit_map =
41-
#ifdef RSI_M4_INTERFACE
41+
#ifdef SLI_SI91X_MCU_INTERFACE
4242
(SL_SI91X_FEAT_SECURITY_OPEN | SL_SI91X_FEAT_WPS_DISABLE),
4343
#else
4444
(SL_SI91X_FEAT_SECURITY_OPEN | SL_SI91X_FEAT_AGGREGATION),
@@ -49,17 +49,17 @@ static const sl_wifi_device_configuration_t config = {
4949
| SL_SI91X_TCP_IP_FEAT_DHCPV6_CLIENT | SL_SI91X_TCP_IP_FEAT_IPV6
5050
#endif
5151
| SL_SI91X_TCP_IP_FEAT_ICMP | SL_SI91X_TCP_IP_FEAT_EXTENSION_VALID),
52-
.custom_feature_bit_map = (SL_SI91X_FEAT_CUSTOM_FEAT_EXTENTION_VALID | RSI_CUSTOM_FEATURE_BIT_MAP),
52+
.custom_feature_bit_map = (SL_SI91X_CUSTOM_FEAT_EXTENTION_VALID | RSI_CUSTOM_FEATURE_BIT_MAP),
5353
.ext_custom_feature_bit_map = (
54-
#ifdef CHIP_917
54+
#ifdef SLI_SI917
5555
(RSI_EXT_CUSTOM_FEATURE_BIT_MAP)
5656
#else // defaults
57-
#ifdef RSI_M4_INTERFACE
57+
#ifdef SLI_SI91X_MCU_INTERFACE
5858
(SL_SI91X_EXT_FEAT_256K_MODE | RSI_EXT_CUSTOM_FEATURE_BIT_MAP)
5959
#else
6060
(SL_SI91X_EXT_FEAT_384K_MODE | RSI_EXT_CUSTOM_FEATURE_BIT_MAP)
6161
#endif
62-
#endif
62+
#endif // SLI_SI917
6363
| (SL_SI91X_EXT_FEAT_BT_CUSTOM_FEAT_ENABLE)
6464
#if (defined A2DP_POWER_SAVE_ENABLE)
6565
| SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2)

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

+27-12
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
******************************************************************************/
2929
MEMORY
3030
{
31-
rom (rx) : ORIGIN = 0x81c2000, LENGTH = 0x200000
32-
ram (rwx) : ORIGIN = 0x400, LENGTH = 0x4e200
31+
rom (rx) : ORIGIN = 0x8202000, LENGTH = 0x1fe000
32+
ram (rwx) : ORIGIN = 0x400, LENGTH = 0x4fc00
3333
}
3434

3535
ENTRY(Reset_Handler)
@@ -39,8 +39,8 @@ SECTIONS
3939
.text :
4040
{
4141
KEEP(*(.isr_vector))
42-
KEEP(*(.reset_handler))
43-
*(EXCLUDE_FILE(*sl_si91x_bus.o *sl_si91x_driver.o *sli_si91x_multithreaded.o *rsi_hal_mcu_m4_ram.o ) .text*)
42+
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*)
4444

4545
/* .ctors */
4646
*crtbegin.o(.ctors)
@@ -127,10 +127,24 @@ SECTIONS
127127
*(.rodata*)
128128
*(vtable)
129129
*(.data*)
130-
*sl_si91x_bus.o(.text*)
131-
*sl_si91x_driver.o(.text*)
132-
*sli_si91x_multithreaded.o(.text*)
133-
*rsi_hal_mcu_m4_ram.o(.text*)
130+
*sl_si91x_bus.c.o(.text*)
131+
*sl_si91x_driver.c.o(.text*)
132+
*sli_si91x_multithreaded.c.o(.text*)
133+
*rsi_hal_mcu_m4_ram.c.o(.text*)
134+
*rsi_deepsleep_soc.c.o(.text*)
135+
*croutine.c.o(.text*)
136+
*event_groups.c.o(.text*)
137+
*list.c.o(.text*)
138+
*queue.c.o(.text*)
139+
*cmsis_os2.c.o(.text*)
140+
*stream_buffer.c.o(.text*)
141+
*tasks.c.o(.text*)
142+
*timers.c.o(.text*)
143+
*freertos_umm_malloc_host.c.o(.text*)
144+
*malloc_buffers.c.o(.text*)
145+
*sl_rsi_utility.c.o(.text*)
146+
*port.c.o(.text*)
147+
*heap_*.c.o(.text*)
134148

135149
. = ALIGN(4);
136150
/* preinit data */
@@ -210,8 +224,8 @@ SECTIONS
210224
} > ram
211225

212226
__heap_size = __HeapLimit - __HeapBase;
213-
__ram_end__ = 0x400 + 0x4e200;
214-
__main_flash_end__ = 0x81c2000 + 0x200000;
227+
__ram_end__ = 0x400 + 0x4fc00;
228+
__main_flash_end__ = 0x8202000 + 0x1fe000;
215229

216230
/* This is where we handle flash storage blocks. We use dummy sections for finding the configured
217231
* block sizes and then "place" them at the end of flash when the size is known. */
@@ -224,7 +238,8 @@ SECTIONS
224238
KEEP(*(.simee*))
225239
} > rom
226240

227-
linker_nvm_end = __main_flash_end__;
241+
/* Last page of flash is reserved for the manufacturing token space */
242+
linker_nvm_end = __main_flash_end__ - 4096;
228243
linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm);
229244
linker_nvm_size = SIZEOF(.nvm);
230245
linker_storage_end = linker_nvm_begin;
@@ -234,7 +249,7 @@ SECTIONS
234249
linker_storage_size = SIZEOF(.internal_storage);
235250
ASSERT((linker_storage_begin >= (__etext + SIZEOF(.data))), "FLASH memory overflowed !")
236251

237-
app_flash_end = 0x81c2000 + 0x200000;
252+
app_flash_end = 0x8202000 + 0x1fe000;
238253
ASSERT( (linker_nvm_begin + SIZEOF(.nvm)) <= app_flash_end, "NVM3 is excessing the flash size !")
239254
}
240255

0 commit comments

Comments
 (0)