Skip to content

Commit

Permalink
[Silabs] Adds wifi-sdk v3.1.0 and required changes for it (#29204)
Browse files Browse the repository at this point in the history
* Adds wifi-sdk 3.1.0 and required changes for it

* updated path in gni for dual-flash

* restyled

* Updated gni with board specific path

* Added time unit and fix for soc ble range issue

* restyled
  • Loading branch information
silabs-srishylam authored and pull[bot] committed Sep 20, 2023
1 parent 2c2a5c7 commit 5bb439f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 24 deletions.
1 change: 1 addition & 0 deletions src/platform/silabs/rs911x/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void sl_ble_event_handling_task(void)
// Requests the connection parameters change with the remote device
rsi_ble_conn_params_update(event_msg.resp_enh_conn.dev_addr, BLE_MIN_CONNECTION_INTERVAL_MS,
BLE_MAX_CONNECTION_INTERVAL_MS, BLE_SLAVE_LATENCY_MS, BLE_TIMEOUT_MS);
rsi_ble_set_data_len(event_msg.resp_enh_conn.dev_addr, RSI_BLE_TX_OCTETS, RSI_BLE_TX_TIME);
}
break;
case RSI_BLE_DISCONN_EVENT: {
Expand Down
11 changes: 10 additions & 1 deletion src/platform/silabs/rs911x/rsi_ble_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
#define ADD_DEVICE_TO_WHITELIST (0x01)
#define DELETE_DEVICE_FROM_WHITELIST (0x02)

#define CLEAR_ACCEPTLIST (0x00)
#define ADD_DEVICE_TO_ACCEPTLIST (0x01)
#define DELETE_DEVICE_FROM_ACCEPTLIST (0x02)

#define RSI_BLE_TX_OCTETS 251
#define RSI_BLE_TX_TIME 2120 // microseconds
#define RSI_BLE_CS_DATA_LENGTH 240

#define ALL_PHYS (0x00)

#define RSI_BLE_DEV_ADDR_RESOLUTION_ENABLE (0)
Expand Down Expand Up @@ -263,7 +271,8 @@
#define RSI_CUSTOM_FEATURE_BIT_MAP SL_SI91X_FEAT_CUSTOM_FEAT_EXTENTION_VALID //! To set custom feature select bit map
#ifdef CHIP_9117
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \
(SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | RAM_LEVEL_NWP_BASIC_MCU_ADV | FRONT_END_SWITCH_SEL2)
(SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | RAM_LEVEL_NWP_BASIC_MCU_ADV | \
SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0)
#else
#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2))
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/platform/silabs/rs911x/wfx_sl_ble_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ void rsi_ble_add_char_val_att(void * serv_handler, uint16_t handle, uuid_t att_t

uint32_t rsi_ble_add_matter_service(void)
{
uuid_t custom_service = { RSI_BLE_MATTER_CUSTOM_SERVICE_UUID };
custom_service.size = RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE;
custom_service.val.val16 = RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16;
uint8_t data[230] = { RSI_BLE_MATTER_CUSTOM_SERVICE_DATA };
uuid_t custom_service = { RSI_BLE_MATTER_CUSTOM_SERVICE_UUID };
custom_service.size = RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE;
custom_service.val.val16 = RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16;
uint8_t data[RSI_BLE_CS_DATA_LENGTH] = { RSI_BLE_MATTER_CUSTOM_SERVICE_DATA };

static const uuid_t custom_characteristic_RX = { .size = RSI_BLE_CUSTOM_CHARACTERISTIC_RX_SIZE,
.reserved = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_RESERVED },
Expand Down
38 changes: 20 additions & 18 deletions third_party/silabs/SiWx917_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,28 @@ template("siwx917_sdk") {
"${wifi_sdk_root}/components/si91x/sl_net/inc",

# siwx917_soc component
"${wifi_sdk_root}/components/siwx917_soc/boards/config/${silabs_board_lower}",
"${wifi_sdk_root}/components/siwx917_soc/boards/inc",
"${wifi_sdk_root}/components/siwx917_soc/core/chip/inc",
"${wifi_sdk_root}/components/siwx917_soc/core/config",
"${wifi_sdk_root}/components/siwx917_soc/inc",
"${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver",
"${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/config",
"${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/CMSIS/Driver/Include",
"${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/inc",
"${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/inc",
"${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/inc",
"${wifi_sdk_root}/components/siwx917_soc/drivers/rom_driver/inc",
"${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/inc",
"${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/config",
"${wifi_sdk_root}/components/siwx917_soc/boards/brd4325x/inc",
"${wifi_sdk_root}/components/siwx917_soc/wifi_inc",
"${wifi_sdk_root}/components/siwx917_soc/hal/inc",
"${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/inc",
"${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/wifi_inc",

# wifi component
"${wifi_sdk_root}/components/protocol/wifi/inc",

# si91x_support component
"${wifi_sdk_root}/components/si91x_support/inc",
"${wifi_sdk_root}/components/si91x_support/brd4325b",
"${wifi_sdk_root}/components/si91x_support/siwx917_soc",

# wifi_resources component
"${wifi_sdk_root}/resources/certificates",
Expand Down Expand Up @@ -170,6 +172,7 @@ template("siwx917_sdk") {
"FLASH_PAGE_SIZE",
"SL_NVM3_PRESENT",
"ROM_WIRELESS",
"BRD4325A", #TODO: should be removed after SoC macro clean-up
]

if (silabs_board == "BRD4325B") {
Expand Down Expand Up @@ -326,14 +329,13 @@ template("siwx917_sdk") {

# si91x_support component
"${wifi_sdk_root}/components/si91x_support/src/sl_utility.c",
"${wifi_sdk_root}/components/siwx917_soc/boards/brd4325x/src/rsi_board.c",
"${wifi_sdk_root}/components/siwx917_soc/boards/src/rsi_board.c",
"${wifi_sdk_root}/components/siwx917_soc/core/chip/src/rsi_deepsleep_soc.c",
"${wifi_sdk_root}/components/siwx917_soc/core/chip/src/rsi_system_config.c",
"${wifi_sdk_root}/components/siwx917_soc/core/chip/src/system_si91x.c",
"${wifi_sdk_root}/components/siwx917_soc/core/config/src/rsi_nvic_priorities_config.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/UDMA.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/USART.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/ipmu/ipmu_apis.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/ipmu/rsi_system_config_9117.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/clock_update.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_egpio.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_udma.c",
Expand All @@ -347,13 +349,13 @@ template("siwx917_sdk") {
"${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_temp_sensor.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_ulpss_clk.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/src/sl_si91x_usart.c",
"${wifi_sdk_root}/components/siwx917_soc/rsi_hal_mcu_m4_ram.c",
"${wifi_sdk_root}/components/siwx917_soc/rsi_hal_mcu_m4_rom.c",
"${wifi_sdk_root}/components/siwx917_soc/sl_platform.c",
"${wifi_sdk_root}/components/siwx917_soc/sl_platform_wireless.c",
"${wifi_sdk_root}/components/siwx917_soc/sl_si91x_bus.c",
"${wifi_sdk_root}/components/siwx917_soc/sl_si91x_timer.c",
"${wifi_sdk_root}/components/siwx917_soc/sli_siwx917_soc.c",
"${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/rsi_hal_mcu_m4_ram.c",
"${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/rsi_hal_mcu_m4_rom.c",
"${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_platform.c",
"${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_platform_wireless.c",
"${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_si91x_bus.c",
"${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_si91x_timer.c",
"${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sli_siwx917_soc.c",

# modified hal
"${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_default_common_linker.c",
Expand All @@ -372,7 +374,7 @@ template("siwx917_sdk") {
"${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/autogen/sl_event_handler.c",
"${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/hal/rsi_hal_mcu_m4.c",
"${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/hal/rsi_hal_mcu_platform_init.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_nvm3_hal_flash.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_nvm3_hal_flash.c",

# mbedtls
"${chip_root}/third_party/mbedtls/repo/library/aes.c",
Expand Down Expand Up @@ -415,14 +417,14 @@ template("siwx917_sdk") {
if (silabs_board == "BRD4325B") {
sources += [
"${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/src/startup_RS1xxxx.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_dual_flash_intf.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_dual_flash_intf.c",
]
}

if (wifi_soc_common_flash) {
sources += [
"${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/src/startup_common_RS1xxxx.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_common_flash_intf.c",
"${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_common_flash_intf.c",
]
}

Expand Down
5 changes: 5 additions & 0 deletions third_party/silabs/silabs_board.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
declare_args() {
# EFR32 board used
silabs_board = ""
silabs_board_lower = ""

# LCD is enabled by default
# Boards BRD4166A, BRD2601B, BRD2703A and BRD4319A do not have a LCD so they disable it explicitly
Expand Down Expand Up @@ -106,27 +107,31 @@ if (silabs_board == "BRD4304A") {
disable_lcd = true
show_qr_code = false
wifi_soc = true
silabs_board_lower = "brd4325b"
} else if (silabs_board == "BRD4325C") {
silabs_family = "SiWx917-common"
silabs_mcu = "SiWG917M111MGTBA"
disable_lcd = true
show_qr_code = false
wifi_soc = true
wifi_soc_common_flash = true
silabs_board_lower = "brd4325c"
} else if (silabs_board == "BRD4325G") {
silabs_family = "SiWx917-common"
silabs_mcu = "SiWG917M111MGTBA"
disable_lcd = true
show_qr_code = false
wifi_soc = true
wifi_soc_common_flash = true
silabs_board_lower = "brd4325g"
} else if (silabs_board == "BRD4338A") {
silabs_family = "SiWx917-common"
silabs_mcu = "SiWG917M111MGTBA"
disable_lcd = true
show_qr_code = false
wifi_soc = true
wifi_soc_common_flash = true
silabs_board_lower = "brd4338a"
} else if (silabs_board == "BRD4180A") {
assert(
false,
Expand Down
2 changes: 1 addition & 1 deletion third_party/silabs/wifi_sdk
Submodule wifi_sdk updated 1961 files

0 comments on commit 5bb439f

Please sign in to comment.