From 91e41119aabaa6206a0799e50f0522bfbd935b99 Mon Sep 17 00:00:00 2001 From: arun-silabs <141724790+arun-silabs@users.noreply.github.com> Date: Tue, 22 Oct 2024 23:43:56 +0530 Subject: [PATCH] [Silabs] Update WiseConnect to v3.3.3 (#36086) * Update wifi sdk to v3.3.3 * Updated matter_support pointer * Updated docker image WiseConnect v3.3.3 * Reverting the docker changes * Updated comments in DockerFile * Removed unused source file * Updated workflow to pick-up latest docker image * Updated docker version in the build files * Added changes to resolve build errors for brd2605a * Corrected variable name in gn file * Removed TO-DO comment * Replaced SI917_DEVKIT macro to SL_MATTER_RGB_LED_ENABLED * Resolved review comments * Updated WiseMcuSpam.cpp as per the latest defines * Update third_party/silabs/silabs_board.gni * Added sl_enable_rgb_led in inside if-else of soc board condition --------- Co-authored-by: bhmanda Co-authored-by: Mathieu Kardous <84793247+mkardous-silabs@users.noreply.github.com> Co-authored-by: bhmanda-silabs <107180296+bhmanda-silabs@users.noreply.github.com> --- .github/workflows/examples-efr32.yaml | 2 +- .github/workflows/release_artifacts.yaml | 2 +- .gitmodules | 2 +- .../silabs/SiWx917/SiWx917/sl_wlan_config.h | 8 +++++ examples/platform/silabs/uart.cpp | 1 - integrations/cloudbuild/smoke-test.yaml | 14 ++++---- .../platformAbstraction/WiseMcuSpam.cpp | 26 +++++++++++--- src/platform/silabs/rs911x/rsi_ble_config.h | 12 +++++-- third_party/silabs/SiWx917_sdk.gni | 35 ++++++++++++++++--- third_party/silabs/matter_support | 2 +- third_party/silabs/silabs_board.gni | 6 ++++ third_party/silabs/wifi_sdk | 2 +- 12 files changed, 86 insertions(+), 26 deletions(-) diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 57337d553128b5..9a483ab5ec4c9e 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -41,7 +41,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:81 + image: ghcr.io/project-chip/chip-build-efr32:83 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 22cf6b335eaa12..45ef34c5ee5aae 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-efr32:81 + image: ghcr.io/project-chip/chip-build-efr32:83 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.gitmodules b/.gitmodules index ed472c937c5e0d..c26ee8f792c1c3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -223,7 +223,7 @@ [submodule "third_party/silabs/wifi_sdk"] path = third_party/silabs/wifi_sdk url = https://github.com/SiliconLabs/wiseconnect.git - branch = v3.3.2 + branch = v3.3.3 platforms = silabs [submodule "editline"] path = third_party/editline/repo diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h b/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h index cd605b0f0a5152..57622a61ff65f4 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wlan_config.h @@ -29,6 +29,14 @@ //! Disable feature #define RSI_DISABLE 0 +// Temmporary work-around for wifi-init failure in ACX modules with WiseConnect v3.3.3. This can be removed after integrating with +// WiseConnect v3.4.0 +#if (SL_SI91X_ACX_MODULE == 1) +#define REGION_CODE IGNORE_REGION +#else +#define REGION_CODE US +#endif + static const sl_wifi_device_configuration_t config = { .boot_option = LOAD_NWP_FW, .mac_address = NULL, diff --git a/examples/platform/silabs/uart.cpp b/examples/platform/silabs/uart.cpp index 1af3cb75d9f507..390e151cb7fbbf 100644 --- a/examples/platform/silabs/uart.cpp +++ b/examples/platform/silabs/uart.cpp @@ -38,7 +38,6 @@ extern "C" { #include "rsi_board.h" #include "rsi_debug.h" #include "rsi_rom_egpio.h" -#include "sl_si91x_usart.h" #else // For EFR32 #if (_SILICON_LABS_32B_SERIES < 3) #include "em_core.h" diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index 99bc5042ed9939..b8c44cfa30c565 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:83" entrypoint: "bash" args: - "-c" @@ -7,7 +7,7 @@ steps: git config --global --add safe.directory "*" python scripts/checkout_submodules.py --shallow --recursive --platform esp32 nrfconnect silabs linux android id: Submodules - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:83" # NOTE: silabs boostrap is NOT done with the rest as it requests a conflicting # jinja2 version (asks for 3.1.3 when constraints.txt asks for 3.0.3) env: @@ -24,7 +24,7 @@ steps: path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:83" id: ESP32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -45,7 +45,7 @@ steps: volumes: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:83" id: NRFConnect env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -66,7 +66,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:83" id: EFR32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -88,7 +88,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:83" id: Linux env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -141,7 +141,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:81" + - name: "ghcr.io/project-chip/chip-build-vscode:83" id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv diff --git a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp index a99ac5ea2908f9..cf60cf5c5892fe 100644 --- a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp +++ b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp @@ -36,8 +36,15 @@ extern "C" { #include "sl_event_handler.h" #include "sl_si91x_button.h" #include "sl_si91x_button_pin_config.h" +#if defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED +#include "sl_si91x_rgb_led.h" +#include "sl_si91x_rgb_led_config.h" +#include "sl_si91x_rgb_led_instances.h" +#else #include "sl_si91x_led.h" #include "sl_si91x_led_config.h" +#include "sl_si91x_led_instances.h" +#endif // defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED #if CHIP_CONFIG_ENABLE_ICD_SERVER == 0 void soc_pll_config(void); @@ -51,14 +58,15 @@ void soc_pll_config(void); #if SILABS_LOG_OUT_UART || ENABLE_CHIP_SHELL #include "uart.h" #endif -// TODO Remove this when SI91X-16606 is addressed -#ifdef SI917_DEVKIT -#define SL_LED_COUNT 1 -uint8_t ledPinArray[SL_LED_COUNT] = { SL_LED_LEDB_PIN }; + +#if defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED +#define SL_LED_COUNT SL_SI91X_RGB_LED_COUNT +const sl_rgb_led_t * ledPinArray[SL_LED_COUNT] = { &led_led0 }; +#define SL_RGB_LED_INSTANCE(n) (ledPinArray[n]) #else #define SL_LED_COUNT SL_SI91x_LED_COUNT uint8_t ledPinArray[SL_LED_COUNT] = { SL_LED_LED0_PIN, SL_LED_LED1_PIN }; -#endif +#endif // defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED namespace chip { namespace DeviceLayer { @@ -111,7 +119,11 @@ void SilabsPlatform::InitLed(void) CHIP_ERROR SilabsPlatform::SetLed(bool state, uint8_t led) { VerifyOrReturnError(led < SL_LED_COUNT, CHIP_ERROR_INVALID_ARGUMENT); +#if defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED + (state) ? sl_si91x_simple_rgb_led_on(SL_RGB_LED_INSTANCE(led)) : sl_si91x_simple_rgb_led_off(SL_RGB_LED_INSTANCE(led)); +#else (state) ? sl_si91x_led_set(ledPinArray[led]) : sl_si91x_led_clear(ledPinArray[led]); +#endif // defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED return CHIP_NO_ERROR; } @@ -124,7 +136,11 @@ bool SilabsPlatform::GetLedState(uint8_t led) CHIP_ERROR SilabsPlatform::ToggleLed(uint8_t led) { VerifyOrReturnError(led < SL_LED_COUNT, CHIP_ERROR_INVALID_ARGUMENT); +#if defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED + sl_si91x_simple_rgb_led_toggle(SL_RGB_LED_INSTANCE(led)); +#else sl_si91x_led_toggle(ledPinArray[led]); +#endif // defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED return CHIP_NO_ERROR; } #endif // ENABLE_WSTK_LEDS diff --git a/src/platform/silabs/rs911x/rsi_ble_config.h b/src/platform/silabs/rs911x/rsi_ble_config.h index de207a99af1601..f508c3396f4e09 100644 --- a/src/platform/silabs/rs911x/rsi_ble_config.h +++ b/src/platform/silabs/rs911x/rsi_ble_config.h @@ -232,7 +232,6 @@ //! Scan types #define SCAN_TYPE_ACTIVE (0x01) -#define SCAN_TYPE_PASSIVE (0x00) //! Scan filters #define SCAN_FILTER_TYPE_ALL (0x00) @@ -267,15 +266,22 @@ (SL_SI91X_TCP_IP_FEAT_DHCPV4_CLIENT) //! TCP/IP feature select bitmap for selecting TCP/IP features #define RSI_CUSTOM_FEATURE_BIT_MAP SL_SI91X_CUSTOM_FEAT_EXTENTION_VALID //! To set custom feature select bit map +// Enable front-end internal switch control for ACX module boards +#if (SL_SI91X_ACX_MODULE == 1) +#define FRONT_END_SWITCH_CTRL SL_SI91X_EXT_FEAT_FRONT_END_INTERNAL_SWITCH +#else +#define FRONT_END_SWITCH_CTRL SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0 +#endif + #ifdef SLI_SI917 #if WIFI_ENABLE_SECURITY_WPA3_TRANSITION // Adding Support for WPA3 transition #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \ (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | SL_SI91X_RAM_LEVEL_NWP_BASIC_MCU_ADV | \ - SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0 | SL_SI91X_EXT_FEAT_IEEE_80211W) + FRONT_END_SWITCH_CTRL | SL_SI91X_EXT_FEAT_IEEE_80211W) #else #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \ (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | SL_SI91X_RAM_LEVEL_NWP_BASIC_MCU_ADV | \ - SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0) + FRONT_END_SWITCH_CTRL) #endif /* WIFI_ENABLE_SECURITY_WPA3_TRANSITION */ #else // EXP_BOARD #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2)) diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index d338ea7d0a9162..3accbed0bc12f2 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -137,8 +137,6 @@ template("siwx917_sdk") { "${efr32_sdk_root}/platform/service/iostream/inc", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/inc", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/config", - "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/inc", - "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/config", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/config", # sl memory manager @@ -156,6 +154,18 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/power_manager/inc", ] + if (sl_enable_rgb_led) { + _include_dirs += [ + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/rgb_led/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/rgb_led/config", + ] + } else { + _include_dirs += [ + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/inc", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/config", + ] + } + if (use_system_view) { _include_dirs += [ "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER", @@ -299,6 +309,12 @@ template("siwx917_sdk") { defines += [ "ENABLE_WSTK_LEDS" ] } + if (sl_enable_rgb_led) { + defines += [ "SL_MATTER_RGB_LED_ENABLED=1" ] + } else { + defines += [ "SL_MATTER_RGB_LED_ENABLED=0" ] + } + if (chip_enable_icd_server) { defines += [ "SL_ICD_ENABLED=1", @@ -649,7 +665,6 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_temp_sensor.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_ulpss_clk.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/src/sl_si91x_driver_gpio.c", - "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/src/sl_si91x_usart.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_peripheral_drivers/src/sl_si91x_peripheral_gpio.c", "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/rsi_hal_mcu_m4_ram.c", "${wifi_sdk_root}/components/device/silabs/si91x/wireless/ahb_interface/src/rsi_hal_mcu_m4_rom.c", @@ -687,11 +702,9 @@ template("siwx917_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_event_handler.c", "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_button_instances.c", - "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_led_instances.c", "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_ulp_timer_init.c", "${sdk_support_root}/matter/si91x/support/hal/rsi_hal_mcu_m4.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/src/sl_si91x_button.c", - "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/src/sl_si91x_led.c", "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/nvm3/src/sl_si91x_nvm3_hal_flash.c", # sl memory manager @@ -716,6 +729,18 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/device/silabs/si91x/wireless/firmware_upgrade/firmware_upgradation.c", ] + if (sl_enable_rgb_led) { + sources += [ + "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_rgb_led_instances.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/rgb_led/src/sl_si91x_rgb_led.c", + ] + } else { + sources += [ + "${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_led_instances.c", + "${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/led/src/sl_si91x_led.c", + ] + } + if (use_system_view) { sources += [ "${chip_root}/examples/platform/silabs/sl_systemview_config.h", diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 841d43db7e8687..8dd7b9bb5f8577 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 841d43db7e86877636cd73b5244da4c34d38d544 +Subproject commit 8dd7b9bb5f8577834140bcc54f7497ae3f4b9bd0 diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index 03b2ea7cb67cb5..aa51817fffdae7 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -56,6 +56,9 @@ declare_args() { # Temperature Sensor support sl_enable_si70xx_sensor = false + + # RGB LED support + sl_enable_rgb_led = false } declare_args() { @@ -74,6 +77,9 @@ assert(silabs_board != "", "silabs_board must be specified") # Si917 WIFI board ---------- if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") { + if (silabs_board == "BRD2605A") { + sl_enable_rgb_led = true + } silabs_family = "SiWx917-common" silabs_mcu = "SiWG917M111MGTBA" wifi_soc = true diff --git a/third_party/silabs/wifi_sdk b/third_party/silabs/wifi_sdk index b5d6422f300cc0..a6390dd746f006 160000 --- a/third_party/silabs/wifi_sdk +++ b/third_party/silabs/wifi_sdk @@ -1 +1 @@ -Subproject commit b5d6422f300cc075c7eaeec96e9f7e3f4e23bf06 +Subproject commit a6390dd746f0067b855a6b41293159244f3ca1b4