Skip to content

Commit e8196ff

Browse files
[Silabs] Adds fix for hardfault in SiWx917 SoC and generator firmware updates (#36610)
* Update mbedTLS configuration * Addressing comments * Replace with use of public APIs * Updated Support SDK pointer * Updated Support SDK pointer * WIP: Wiseconnect 3.4.0 support * Adds IPMU changes * Update pointers * Add fix for LCD * Cleanup of duplicate entry * Refactor device attestation key handling in ProvisionStorageFlash.cpp * Revert changes --------- Co-authored-by: Andrei Litvin <andy314@gmail.com>
1 parent 5055cbe commit e8196ff

File tree

4 files changed

+30
-6
lines changed

4 files changed

+30
-6
lines changed

examples/platform/silabs/ldscripts/SiWx917-common.ld

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ SECTIONS
3939
.text :
4040
{
4141
KEEP(*(.isr_vector))
42-
KEEP(*(.reset_handler))
42+
. = ALIGN(32);
43+
KEEP(*(.reset_handler))
4344
*(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_hal_mcu_m4_rom.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 *sl_sleeptimer.c.o *sl_sleeptimer_hal_si91x_sysrtc.c.o *rsi_sysrtc.c.o *sl_si91x_low_power_tickless_mode.c.o *heap_*.c.o *sl_core_cortexm.c.o) .text*)
4445

4546
/* .ctors */

examples/platform/silabs/provision/ProvisionStorageFlash.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ CHIP_ERROR Storage::GetDeviceAttestationCSR(uint16_t vid, uint16_t pid, const Ch
649649

650650
CHIP_ERROR Storage::SignWithDeviceAttestationKey(const ByteSpan & message, MutableByteSpan & signature)
651651
{
652-
AttestationKey key;
653652
uint8_t temp[kDeviceAttestationKeySizeMax] = { 0 };
654653
size_t size = 0;
655654
CHIP_ERROR err = Flash::Get(Parameters::ID::kDacKey, temp, sizeof(temp), size);
@@ -661,8 +660,16 @@ CHIP_ERROR Storage::SignWithDeviceAttestationKey(const ByteSpan & message, Mutab
661660
}
662661
#endif // CHIP_DEVICE_CONFIG_ENABLE_EXAMPLE_CREDENTIALS
663662
ReturnErrorOnFailure(err);
663+
#if (defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE)
664+
uint8_t key_buffer[kDeviceAttestationKeySizeMax] = { 0 };
665+
MutableByteSpan private_key(key_buffer);
666+
AttestationKey::Unwrap(temp, size, private_key);
667+
return AttestationKey::SignMessageWithKey((const uint8_t *) key_buffer, message, signature);
668+
#else
669+
AttestationKey key;
664670
ReturnErrorOnFailure(key.Import(temp, size));
665671
return key.SignMessage(message, signature);
672+
#endif // SLI_SI91X_MCU_INTERFACE
666673
}
667674

668675
//

src/platform/silabs/provision/AttestationKey.h

+5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ class AttestationKey
4141
CHIP_ERROR GenerateCSR(uint16_t vid, uint16_t pid, const CharSpan & cn, MutableCharSpan & csr);
4242
CHIP_ERROR SignMessage(const ByteSpan & message, MutableByteSpan & out_span);
4343

44+
#if (defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE)
45+
static CHIP_ERROR Unwrap(const uint8_t * asn1, size_t size, MutableByteSpan & private_key);
46+
static CHIP_ERROR SignMessageWithKey(const uint8_t * private_key, const ByteSpan & message, MutableByteSpan & out_span);
47+
#endif // SLI_SI91X_MCU_INTERFACE
48+
4449
protected:
4550
uint32_t mId = 0;
4651
};

third_party/silabs/SiWx917_sdk.gni

+15-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ template("siwx917_sdk") {
5555
# Treat these includes as system includes, so warnings in them are not fatal.
5656
_include_dirs = [
5757
"${chip_root}",
58-
"${chip_root}/examples/platform/silabs/SiWx917/SiWx917",
58+
"${chip_root}/examples/platform/silabs/",
5959
"${efr32_sdk_root}/platform/emdrv/nvm3/config",
6060
"${efr32_sdk_root}/platform/emdrv/nvm3/inc",
6161
"${efr32_sdk_root}/platform/emdrv/common/inc",
@@ -79,7 +79,7 @@ template("siwx917_sdk") {
7979
"${wifi_sdk_root}/components/device/silabs/si91x/wireless/sl_net/inc",
8080

8181
# siwx917_soc component
82-
"${wifi_sdk_root}/components/board/silabs/config/brd4338a",
82+
"${wifi_sdk_root}/components/board/silabs/config/${silabs_board}",
8383
"${wifi_sdk_root}/components/board/silabs/inc",
8484
"${wifi_sdk_root}/components/common/inc",
8585
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/core/chip/inc",
@@ -251,6 +251,8 @@ template("siwx917_sdk") {
251251
"TIMER_ROMDRIVER_PRESENT=1",
252252
"UDMA_ROMDRIVER_PRESENT=1",
253253
"PLL_ROMDRIVER_PRESENT=1",
254+
"SL_CODE_COMPONENT_FREERTOS_KERNEL=freertos_kernel",
255+
"SLI_CODE_CLASSIFICATION_DISABLE=1",
254256
"SL_MATTER_GN_BUILD=1",
255257
"SILABS_LOG_OUT_UART=${sl_uart_log_output}",
256258
]
@@ -261,7 +263,10 @@ template("siwx917_sdk") {
261263
defines += [ "SILABS_LOG_ENABLED=0" ]
262264
}
263265

264-
defines += [ "LWIP_NETIF_API=1" ]
266+
defines += [
267+
"LWIP_NETIF_API=1",
268+
"SLI_SI91X_LWIP_HOSTED_NETWORK_STACK=1",
269+
]
265270
if (chip_enable_wifi_ipv4) {
266271
defines += [
267272
"LWIP_IPV4=1",
@@ -300,6 +305,7 @@ template("siwx917_sdk") {
300305

301306
if (!disable_lcd) {
302307
defines += [
308+
"SI917_MEMLCD=1",
303309
"SYSCALLS_WRITE",
304310
"SPI_MULTI_SLAVE",
305311
"SL_ULP_TIMER",
@@ -612,7 +618,7 @@ template("siwx917_sdk") {
612618
"${sdk_support_root}/matter/mbedtls/tinycrypt/src/ecc_dsa.c",
613619
"${sdk_support_root}/matter/mbedtls/tinycrypt/src/tinycrypt_util.c",
614620

615-
# Sisdk platform/security
621+
# GECKO SDK
616622
"${efr32_sdk_root}/platform/security/sl_component/sli_psec_osal/src/sli_psec_osal_cmsis_rtos2.c",
617623
]
618624

@@ -630,9 +636,11 @@ template("siwx917_sdk") {
630636
# si91x component
631637
"${efr32_sdk_root}/platform/CMSIS/RTOS2/Source/os_systick.c",
632638
"${efr32_sdk_root}/platform/common/src/sl_assert.c",
639+
"${efr32_sdk_root}/platform/common/src/sl_cmsis_os2_common.c",
633640
"${efr32_sdk_root}/platform/common/src/sl_core_cortexm.c",
634641
"${efr32_sdk_root}/platform/common/src/sl_slist.c",
635642
"${efr32_sdk_root}/platform/common/src/sl_string.c",
643+
"${efr32_sdk_root}/platform/common/src/sl_syscalls.c",
636644
"${efr32_sdk_root}/platform/common/src/sli_cmsis_os2_ext_task_register.c",
637645
"${efr32_sdk_root}/platform/security/sl_component/sl_mbedtls_support/src/sl_mbedtls.c",
638646
"${efr32_sdk_root}/util/third_party/freertos/cmsis/Source/cmsis_os2.c",
@@ -692,10 +700,12 @@ template("siwx917_sdk") {
692700
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_udma.c",
693701
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_udma_wrapper.c",
694702
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/peripheral_drivers/src/rsi_usart.c",
703+
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/rom_driver/src/rsi_rom_table_si91x.c",
695704
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_bod.c",
696705
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_ipmu.c",
697706
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_pll.c",
698707
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_power_save.c",
708+
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_rtc.c",
699709
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_temp_sensor.c",
700710
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/systemlevel/src/rsi_ulpss_clk.c",
701711
"${wifi_sdk_root}/components/device/silabs/si91x/mcu/drivers/unified_api/src/sl_si91x_adc.c",
@@ -750,6 +760,7 @@ template("siwx917_sdk") {
750760
"${efr32_sdk_root}/platform/service/memory_manager/src/sl_memory_manager_cpp.cpp",
751761
"${efr32_sdk_root}/platform/service/memory_manager/src/sl_memory_manager_dynamic_reservation.c",
752762
"${efr32_sdk_root}/platform/service/memory_manager/src/sl_memory_manager_pool.c",
763+
"${efr32_sdk_root}/platform/service/memory_manager/src/sl_memory_manager_pool_common.c",
753764
"${efr32_sdk_root}/platform/service/memory_manager/src/sl_memory_manager_region.c",
754765
"${efr32_sdk_root}/platform/service/memory_manager/src/sl_memory_manager_retarget.c",
755766
"${efr32_sdk_root}/platform/service/memory_manager/src/sli_memory_manager_common.c",

0 commit comments

Comments
 (0)