Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Silabs] [Wi-Fi] [SiWx917] Added support for new SDK 3.1.1 for 917 NCP #31325

Merged
merged 29 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
843f565
Added changes for new wifi sdk 917 NCP
shgutte Dec 14, 2023
f5e338b
Added changes for 917 NCP
shgutte Dec 15, 2023
7946270
Added changes for rs9117 NCP
shgutte Dec 21, 2023
e047cfe
Added changes sl_eifi_if file
shgutte Jan 8, 2024
a776980
Added changes for 917 commissioning
shgutte Jan 9, 2024
9c67474
Updated matter support
shgutte Jan 9, 2024
ee92df8
Added chnages for power manager files
shgutte Jan 9, 2024
ece2708
Updated matter support
shgutte Jan 9, 2024
892c1fc
Added changes for 917 NCP bringup
shgutte Jan 9, 2024
b02451d
Removed the changes for 917 NCP
shgutte Jan 9, 2024
46cc038
Added changes 917 NCP bringup
shgutte Jan 9, 2024
7582f01
Updated matter support
shgutte Jan 9, 2024
08f787d
Merge branch 'master' of https://github.com/project-chip/connectedhom…
shgutte Jan 10, 2024
b6fcab2
Added changes for the power manager file
shgutte Jan 10, 2024
e388bd2
Added changes for host file
shgutte Jan 10, 2024
74e381e
Added changes accroding to comments
shgutte Jan 10, 2024
d6b6e13
Updated matter support repo
shgutte Jan 10, 2024
8bf7581
Added TODO for the include files
shgutte Jan 10, 2024
21fdbef
Update examples/platform/silabs/efr32/BUILD.gn
shgutte Jan 10, 2024
1af4f50
Update third_party/silabs/efr32_sdk.gni
shgutte Jan 10, 2024
b30c03c
Update examples/platform/silabs/efr32/rs911x/wfx_rsi_host.c
shgutte Jan 10, 2024
cfb5a94
Update src/platform/silabs/efr32/wifi/wfx_notify.cpp
shgutte Jan 10, 2024
2bba65f
Added restyle changes
shgutte Jan 10, 2024
57a599e
Removed unwanted line
shgutte Jan 10, 2024
f0c92ef
Added restyler changes
shgutte Jan 10, 2024
e275616
Added fix for wf200 build
shgutte Jan 11, 2024
6faa0c0
Pull request #1476: MATTER-2944 : Adding the is_debug=false flag
chirag-silabs Jan 11, 2024
f74caf1
Merge branch 'master' of https://github.com/project-chip/connectedhom…
shgutte Jan 11, 2024
88a56b1
Added change to fix the sleep
shgutte Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 89 additions & 3 deletions examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@

#include "ble_config.h"

#if SL_ICD_ENABLED && SIWX_917
jmartinez-silabs marked this conversation as resolved.
Show resolved Hide resolved
#include "rsi_rom_power_save.h"
#include "sl_si91x_button_pin_config.h"
#include "sl_si91x_m4_ps.h"

// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
#define BUTTON_PRESSED 1
bool btn0_pressed = false;
#endif // SL_ICD_ENABLED && SIWX_917

#include "dhcp_client.h"
#include "sl_wifi.h"
#include "wfx_host_events.h"
Expand All @@ -52,6 +62,11 @@
#define ADV_MULTIPROBE 1
#define ADV_SCAN_PERIODICITY 10

#ifdef SIWX_917
#include "sl_si91x_trng.h"
#define TRNGKEY_SIZE 4
#endif // SIWX_917

struct wfx_rsi wfx_rsi;

/* Declare a variable to hold the data associated with the created event group. */
Expand Down Expand Up @@ -198,6 +213,44 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t
}

#if SL_ICD_ENABLED

#if SIWX_917
jmartinez-silabs marked this conversation as resolved.
Show resolved Hide resolved
/******************************************************************
* @fn sl_wfx_host_si91x_sleep_wakeup()
* @brief
* M4 going to sleep
*
* @param[in] None
* @return
* None
*********************************************************************/
void sl_wfx_host_si91x_sleep_wakeup()
{
if (wfx_rsi.dev_state & WFX_RSI_ST_SLEEP_READY)
{
// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
if (!RSI_NPSSGPIO_GetPin(SL_BUTTON_BTN0_PIN) && !btn0_pressed)
{
sl_button_on_change(SL_BUTTON_BTN0_NUMBER, BUTTON_PRESSED);
btn0_pressed = true;
}
if (RSI_NPSSGPIO_GetPin(SL_BUTTON_BTN0_PIN))
{
#ifdef DISPLAY_ENABLED
// if LCD is enabled, power down the lcd before setting the M4 to sleep
sl_si91x_hardware_setup();
#endif
btn0_pressed = false;
/* Configure RAM Usage and Retention Size */
sl_si91x_m4_sleep_wakeup();
#if SILABS_LOG_ENABLED
silabsInitLog();
#endif
}
}
}
#endif /* SIWX_917 */

/******************************************************************
* @fn wfx_rsi_power_save()
* @brief
Expand All @@ -217,14 +270,14 @@ int32_t wfx_rsi_power_save()
return status;
}

sl_wifi_performance_profile_t wifi_profile = { ASSOCIATED_POWER_SAVE };
sl_wifi_performance_profile_t wifi_profile = { .profile = ASSOCIATED_POWER_SAVE };
status = sl_wifi_set_performance_profile(&wifi_profile);
if (status != RSI_SUCCESS)
{
SILABS_LOG("Powersave Config Failed, Error Code : 0x%lX", status);
return status;
}
SILABS_LOG("Powersave Config Success");
wfx_rsi.dev_state |= WFX_RSI_ST_SLEEP_READY;
return status;
}
#endif /* SL_ICD_ENABLED */
Expand Down Expand Up @@ -283,7 +336,17 @@ static sl_status_t wfx_rsi_init(void)
SILABS_LOG("wfx_rsi_init failed %x", status);
return status;
}
#endif
#else // For SoC
#if SL_ICD_ENABLED
uint8_t xtal_enable = 1;
status = sl_si91x_m4_ta_secure_handshake(SL_SI91X_ENABLE_XTAL, 1, &xtal_enable, 0, NULL);
if (status != SL_STATUS_OK)
{
SILABS_LOG("Failed to bring m4_ta_secure_handshake: 0x%lx\r\n", status);
return status;
}
#endif /* SL_ICD_ENABLED */
#endif /* SLI_SI91X_MCU_INTERFACE */

sl_wifi_firmware_version_t version = { 0 };
status = sl_wifi_get_firmware_version(&version);
Expand All @@ -301,6 +364,25 @@ static sl_status_t wfx_rsi_init(void)
SILABS_LOG("sl_wifi_get_mac_address failed: %x", status);
return status;
}
#ifdef SIWX_917
const uint32_t trngKey[TRNGKEY_SIZE] = { 0x16157E2B, 0xA6D2AE28, 0x8815F7AB, 0x3C4FCF09 };
jmartinez-silabs marked this conversation as resolved.
Show resolved Hide resolved

// To check the Entropy of TRNG and verify TRNG functioning.
status = sl_si91x_trng_entropy();
if (status != SL_STATUS_OK)
{
SILABS_LOG("TRNG Entropy Failed");
return status;
}

// Initiate and program the key required for TRNG hardware engine
status = sl_si91x_trng_program_key(trngKey, TRNGKEY_SIZE);
if (status != SL_STATUS_OK)
{
SILABS_LOG("TRNG Key Programming Failed");
return status;
}
#endif // SIWX_917
wfx_rsi.events = xEventGroupCreateStatic(&rsiDriverEventGroup);
wfx_rsi.dev_state |= WFX_RSI_ST_DEV_READY;
osSemaphoreRelease(sl_rs_ble_init_sem);
Expand Down Expand Up @@ -500,6 +582,10 @@ static sl_status_t wfx_rsi_do_join(void)

sl_wifi_set_join_callback(join_callback_handler, NULL);

// Setting the listen interval to 0 which will set it to DTIM interval
sl_wifi_listen_interval_t sleep_interval = { .listen_interval = 0 };
status = sl_wifi_set_listen_interval(SL_WIFI_CLIENT_INTERFACE, sleep_interval);

/* Try to connect Wifi with given Credentials
* untill there is a success or maximum number of tries allowed
*/
Expand Down
2 changes: 0 additions & 2 deletions examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
//! Disable feature
#define RSI_DISABLE 0

#define SI91X_LISTEN_INTERVAL 0

static const sl_wifi_device_configuration_t config = {
.boot_option = LOAD_NWP_FW,
.mac_address = NULL,
Expand Down
5 changes: 5 additions & 0 deletions examples/platform/silabs/SiWx917/SiWx917/wfx_rsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#define WFX_RSI_ST_STA_READY (WFX_RSI_ST_STA_CONNECTED | WFX_RSI_ST_STA_DHCP_DONE)
#define WFX_RSI_ST_STARTED (0x200) /* RSI task started */
#define WFX_RSI_ST_SCANSTARTED (0x400) /* Scan Started */
#define WFX_RSI_ST_SLEEP_READY (0x800) /* Notify the M4 to go to sleep*/

struct wfx_rsi
{
Expand Down Expand Up @@ -92,6 +93,10 @@ int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info);
int32_t wfx_rsi_reset_count();
int32_t wfx_rsi_disconnect();
int32_t wfx_wifi_rsi_init(void);
#if SL_ICD_ENABLED
void sl_wfx_host_si91x_sleep_wakeup();
int32_t wfx_rsi_power_save();
#endif /* SL_ICD_ENABLED */

#ifdef __cplusplus
}
Expand Down
12 changes: 11 additions & 1 deletion examples/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ source_set("efr32-common") {
}

if (chip_enable_wifi) {
if (use_rs9116 || use_SiWx917) {


shgutte marked this conversation as resolved.
Show resolved Hide resolved
if (use_rs9116) {
sources += rs911x_src_plat

# All the stuff from wiseconnect
Expand All @@ -290,6 +292,14 @@ source_set("efr32-common") {

#add compilation flags for rs991x build. This will be addressed directly in wiseconnect sdk in the next version release of that sdk
cflags = rs911x_cflags
} else if (use_SiWx917) {
sources += rs911x_src_plat

# All the stuff from wiseconnect
sources += rs9117_src_sapi
include_dirs += rs9117_inc_plat

#add compilation flags for rs991x build. This will be addressed directly in wiseconnect sdk in the next version release of that sdk
} else if (use_wf200) {
sources += wf200_plat_src
include_dirs += wf200_plat_incs
Expand Down
Loading