Skip to content

Commit

Permalink
[Silabs] Added new wifi BRD2605A board support in matter (#35225)
Browse files Browse the repository at this point in the history
* Added new wifi BRD2605A board support in matter

* Moved si91x support files to common place for brd4338a and brd2605a boards

* Updating matter_support pointer

* Updated matter_support pointer to latest main

* Added the default setting chip_device_platform to SiWx917 into build_for_wifi_gnfile.gn

* added brd2605a in efr32.py and targets.py
  • Loading branch information
bhmanda-silabs authored and pull[bot] committed Sep 23, 2024
1 parent 8be216f commit e447c6e
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 21 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,24 @@ jobs:
/tmp/bloat_reports/
- name: Clean out build output
run: rm -rf ./out
- name: Build BRD2605A WiFi Soc variants
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--enable-flashbundle \
--target efr32-brd2605a-light-skip-rps-generation \
--target efr32-brd2605a-lock-skip-rps-generation \
build \
--copy-artifacts-to out/artifacts \
"
- name: Prepare bloat report for brd2605a lock app
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
efr32 BRD2605a lock-app \
out/efr32-brd2605a-lock-skip-rps-generation/matter-silabs-lock-example.out \
/tmp/bloat_reports/
- name: Clean out build output
run: rm -rf ./out
- name: Build EFR32 with WiFi NCP
run: |
./scripts/run_in_build_env.sh \
Expand Down
1 change: 1 addition & 0 deletions examples/light-switch-app/silabs/build_for_wifi_gnfile.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_enable_wifi = true
chip_device_platform = "SiWx917"
import("//build_for_wifi_args.gni")
}
1 change: 1 addition & 0 deletions examples/lighting-app/silabs/build_for_wifi_gnfile.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_enable_wifi = true
chip_device_platform = "SiWx917"
import("//build_for_wifi_args.gni")
}
1 change: 1 addition & 0 deletions examples/lock-app/silabs/build_for_wifi_gnfile.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_enable_wifi = true
chip_device_platform = "SiWx917"
import("//build_for_wifi_args.gni")
}
1 change: 1 addition & 0 deletions examples/thermostat/silabs/build_for_wifi_gnfile.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_enable_wifi = true
chip_device_platform = "SiWx917"
import("//build_for_wifi_args.gni")
}
1 change: 1 addition & 0 deletions examples/window-app/silabs/build_for_wifi_gnfile.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_enable_wifi = true
chip_device_platform = "SiWx917"
import("//build_for_wifi_args.gni")
}
1 change: 1 addition & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ def BuildEfr32Target():
TargetPart('brd4186c', board=Efr32Board.BRD4186C),
TargetPart('brd2703a', board=Efr32Board.BRD2703A),
TargetPart('brd4338a', board=Efr32Board.BRD4338A, enable_wifi=True, enable_917_soc=True),
TargetPart('brd2605a', board=Efr32Board.BRD2605A, enable_wifi=True, enable_917_soc=True),
])

# apps
Expand Down
3 changes: 3 additions & 0 deletions scripts/build/builders/efr32.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class Efr32Board(Enum):
BRD4186C = 10
BRD4338A = 11
BRD2703A = 12
BRD2605A = 13

def GnArgName(self):
if self == Efr32Board.BRD2704B:
Expand All @@ -130,6 +131,8 @@ def GnArgName(self):
return 'BRD4338A'
elif self == Efr32Board.BRD2703A:
return 'BRD2703A'
elif self == Efr32Board.BRD2605A:
return 'BRD2605A'
else:
raise Exception('Unknown board #: %r' % self)

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/testdata/all_targets_linux_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bouffalolab-{bl602dk,bl704ldk,bl706dk,bl602-night-light,bl706-night-light,bl602-
cc32xx-{lock,air-purifier}
ti-cc13x4_26x4-{lighting,lock,pump,pump-controller}[-mtd][-ftd]
cyw30739-{cyw30739b2_p5_evk_01,cyw30739b2_p5_evk_02,cyw30739b2_p5_evk_03,cyw930739m2evb_01,cyw930739m2evb_02}-{light,light-switch,lock,thermostat}
efr32-{brd2704b,brd4316a,brd4317a,brd4318a,brd4319a,brd4186a,brd4187a,brd2601b,brd4187c,brd4186c,brd2703a,brd4338a}-{window-covering,switch,unit-test,light,lock,thermostat,pump}[-rpc][-with-ota-requestor][-icd][-low-power][-shell][-no-logging][-openthread-mtd][-heap-monitoring][-no-openthread-cli][-show-qr-code][-wifi][-rs9116][-wf200][-siwx917][-ipv4][-additional-data-advertising][-use-ot-lib][-use-ot-coap-lib][-no-version][-skip-rps-generation]
efr32-{brd2704b,brd4316a,brd4317a,brd4318a,brd4319a,brd4186a,brd4187a,brd2601b,brd4187c,brd4186c,brd2703a,brd4338a,brd2605a}-{window-covering,switch,unit-test,light,lock,thermostat,pump}[-rpc][-with-ota-requestor][-icd][-low-power][-shell][-no-logging][-openthread-mtd][-heap-monitoring][-no-openthread-cli][-show-qr-code][-wifi][-rs9116][-wf200][-siwx917][-ipv4][-additional-data-advertising][-use-ot-lib][-use-ot-coap-lib][-no-version][-skip-rps-generation]
esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,energy-management,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing]
genio-lighting-app
linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang]
Expand Down
3 changes: 1 addition & 2 deletions scripts/examples/gn_silabs_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,9 @@ else
fi

# 917 exception. TODO find a more generic way
if [ "$SILABS_BOARD" == "BRD4338A" ]; then
if [ "$SILABS_BOARD" == "BRD4338A" ] || [ "$SILABS_BOARD" == "BRD2605A" ]; then
echo "Compiling for 917 WiFi SOC"
USE_WIFI=true
optArgs+="chip_device_platform =\"SiWx917\" is_debug=false "
fi

if [ "$USE_GIT_SHA_FOR_VERSION" == true ]; then
Expand Down
19 changes: 14 additions & 5 deletions src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@

#include <app/icd/server/ICDServerConfig.h>

#include <lib/support/CodeUtils.h>
#if SILABS_LOG_ENABLED
#include "silabs_utils.h"

#endif // SILABS_LOG_ENABLED

// TODO add includes ?
Expand All @@ -49,6 +51,14 @@ 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 };
#else
#define SL_LED_COUNT SL_SI91x_LED_COUNT
uint8_t ledPinArray[SL_LED_COUNT] = { SL_LED_LED0_PIN, SL_LED_LED1_PIN };
#endif

namespace chip {
namespace DeviceLayer {
Expand Down Expand Up @@ -100,9 +110,8 @@ void SilabsPlatform::InitLed(void)

CHIP_ERROR SilabsPlatform::SetLed(bool state, uint8_t led)
{
// TODO add range check
(state) ? sl_si91x_led_set(led ? SL_LED_LED1_PIN : SL_LED_LED0_PIN)
: sl_si91x_led_clear(led ? SL_LED_LED1_PIN : SL_LED_LED0_PIN);
VerifyOrReturnError(led < SL_LED_COUNT, CHIP_ERROR_INVALID_ARGUMENT);
(state) ? sl_si91x_led_set(ledPinArray[led]) : sl_si91x_led_clear(ledPinArray[led]);
return CHIP_NO_ERROR;
}

Expand All @@ -114,8 +123,8 @@ bool SilabsPlatform::GetLedState(uint8_t led)

CHIP_ERROR SilabsPlatform::ToggleLed(uint8_t led)
{
// TODO add range check
sl_si91x_led_toggle(led ? SL_LED_LED1_PIN : SL_LED_LED0_PIN);
VerifyOrReturnError(led < SL_LED_COUNT, CHIP_ERROR_INVALID_ARGUMENT);
sl_si91x_led_toggle(ledPinArray[led]);
return CHIP_NO_ERROR;
}
#endif // ENABLE_WSTK_LEDS
Expand Down
22 changes: 11 additions & 11 deletions third_party/silabs/SiWx917_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ template("siwx917_sdk") {
"${efr32_sdk_root}/platform/emdrv/nvm3/inc",
"${efr32_sdk_root}/platform/emdrv/common/inc",
"${efr32_sdk_root}/platform/service/device_init/inc",
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen",
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/config",
"${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen",
"${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/config",

"${chip_root}/src/platform/silabs/rs911x",

Expand Down Expand Up @@ -131,7 +131,7 @@ template("siwx917_sdk") {
"${efr32_sdk_root}/platform/service/sleeptimer/inc",
"${efr32_sdk_root}/platform/service/sleeptimer/config",
"${efr32_sdk_root}/platform/service/sleeptimer/src",
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/support/inc",
"${sdk_support_root}/matter/si91x/support/inc",

"${efr32_sdk_root}/platform/service/iostream/inc",
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/hardware_drivers/button/inc",
Expand Down Expand Up @@ -684,11 +684,11 @@ template("siwx917_sdk") {
"${efr32_sdk_root}/util/third_party/freertos/kernel/stream_buffer.c",
"${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c",
"${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c",
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.c",
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_button_instances.c",
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_led_instances.c",
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_ulp_timer_init.c",
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/support/hal/rsi_hal_mcu_m4.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",
Expand All @@ -706,7 +706,7 @@ template("siwx917_sdk") {
# STARTUP FILES
"${efr32_sdk_root}/platform/service/iostream/src/sl_iostream.c",
"${efr32_sdk_root}/platform/service/iostream/src/sl_iostream_rtt.c",
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/support/src/startup_common_RS1xxxx.c",
"${sdk_support_root}/matter/si91x/support/src/startup_common_RS1xxxx.c",
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/nvm3/src/sl_si91x_common_flash_intf.c",

# OTA
Expand Down Expand Up @@ -758,8 +758,8 @@ template("siwx917_sdk") {

if (chip_enable_icd_server) {
sources += [
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_handler.c",
"${sdk_support_root}/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_wakeup_handler.c",
"${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_power_manager_handler.c",
"${sdk_support_root}/matter/si91x/siwx917/${silabs_board}/autogen/sl_si91x_power_manager_wakeup_handler.c",
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/sl_si91x_m4_ps.c",
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/power_manager/src/sl_si91x_power_manager.c",
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/service/power_manager/src/sli_si91x_power_manager.c",
Expand Down
2 changes: 1 addition & 1 deletion third_party/silabs/matter_support
Submodule matter_support updated 56 files
+2 −4 matter/efr32/bootloader_binaries/README.md
+0 −970 matter/efr32/bootloader_binaries/bootloader-storage-internal-single-512k-BRD4186C-gsdk4.1.s37
+1,010 −0 matter/efr32/bootloader_binaries/bootloader-storage-internal-single-512k-BRD4186C.s37
+0 −977 matter/efr32/bootloader_binaries/bootloader-storage-internal-single-512k-BRD4187C-gsdk4.1.s37
+1,016 −0 matter/efr32/bootloader_binaries/bootloader-storage-internal-single-512k-BRD4187C.s37
+34 −0 matter/si91x/siwx917/BRD2605A/autogen/RTE_Components.h
+33 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_component_catalog.h
+70 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_event_handler.c
+12 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_event_handler.h
+27 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_handles.c
+20 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_handles.h
+16 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_init_instances.h
+59 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_button_instances.c
+43 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_button_instances.h
+43 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_led_instances.c
+41 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_led_instances.h
+96 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_handler.c
+51 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_init.h
+37 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_wakeup_handler.c
+44 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_wakeup_handler.h
+49 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_ulp_timer_init.c
+53 −0 matter/si91x/siwx917/BRD2605A/autogen/sl_ulp_timer_instances.h
+49 −0 matter/si91x/siwx917/BRD2605A/autogen/sli_mbedtls_config_autogen.h
+51 −0 matter/si91x/siwx917/BRD2605A/autogen/sli_mbedtls_config_transform_autogen.h
+4,909 −0 matter/si91x/siwx917/BRD2605A/config/RTE_Device_917.h
+428 −0 matter/si91x/siwx917/BRD2605A/config/SEGGER_RTT_Conf.h
+45 −0 matter/si91x/siwx917/BRD2605A/config/emlib_core_debug_config.h
+62 −0 matter/si91x/siwx917/BRD2605A/config/nvm3_default_config.h
+140 −0 matter/si91x/siwx917/BRD2605A/config/pin_config.h
+23 −0 matter/si91x/siwx917/BRD2605A/config/sl_board_configuration.h
+22 −0 matter/si91x/siwx917/BRD2605A/config/sl_board_control.h
+44 −0 matter/si91x/siwx917/BRD2605A/config/sl_core_config.h
+118 −0 matter/si91x/siwx917/BRD2605A/config/sl_mbedtls_config.h
+70 −0 matter/si91x/siwx917/BRD2605A/config/sl_mbedtls_device_config.h
+49 −0 matter/si91x/siwx917/BRD2605A/config/sl_memory_manager_config.h
+49 −0 matter/si91x/siwx917/BRD2605A/config/sl_memory_manager_region_config.h
+149 −0 matter/si91x/siwx917/BRD2605A/config/sl_net_default_values.h
+28 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_btn0_config.h
+28 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_btn1_config.h
+25 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_pin_config.h
+52 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_dma_config.h
+36 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_led_config.h
+358 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_power_manager_config_3.h
+96 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_power_manager_wakeup_source_config.h
+35 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_stack_size_config.h
+84 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_timer_common_config.h
+67 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_timer_init_timer0_config.h
+43 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_uart_common_config.h
+104 −0 matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_uart_config.h
+82 −0 matter/si91x/siwx917/BRD2605A/config/sl_sleeptimer_config.h
+82 −0 matter/si91x/siwx917/BRD2605A/support/hal/rsi_hal_mcu_m4.c
+168 −0 matter/si91x/siwx917/BRD2605A/support/inc/system_si917.h
+514 −0 matter/si91x/siwx917/BRD2605A/support/src/startup_common_RS1xxxx.c
+82 −0 matter/si91x/support/hal/rsi_hal_mcu_m4.c
+168 −0 matter/si91x/support/inc/system_si917.h
+514 −0 matter/si91x/support/src/startup_common_RS1xxxx.c
2 changes: 1 addition & 1 deletion third_party/silabs/silabs_board.gni
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if (silabs_board == "") {
assert(silabs_board != "", "silabs_board must be specified")

# Si917 WIFI board ----------
if (silabs_board == "BRD4338A") {
if (silabs_board == "BRD4338A" || silabs_board == "BRD2605A") {
silabs_family = "SiWx917-common"
silabs_mcu = "SiWG917M111MGTBA"
wifi_soc = true
Expand Down

0 comments on commit e447c6e

Please sign in to comment.