Skip to content

Commit

Permalink
[Silabs] - Updating the wifi-sdk to v3.1.1 with required changes (#31056
Browse files Browse the repository at this point in the history
)

* 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 <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Junior Martinez <[email protected]>
  • Loading branch information
4 people authored and pull[bot] committed Feb 14, 2024
1 parent d2101fb commit c34ce8c
Show file tree
Hide file tree
Showing 15 changed files with 208 additions and 458 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 26 additions & 10 deletions examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -237,14 +237,29 @@ 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);
}
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
Expand All @@ -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)
{
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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++)
Expand Down Expand Up @@ -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));
Expand Down
10 changes: 5 additions & 5 deletions examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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)
Expand Down
39 changes: 27 additions & 12 deletions examples/platform/silabs/ldscripts/SiWx917-common.ld
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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. */
Expand All @@ -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;
Expand All @@ -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 !")
}

Loading

0 comments on commit c34ce8c

Please sign in to comment.