diff --git a/examples/platform/silabs/MatterConfig.cpp b/examples/platform/silabs/MatterConfig.cpp index b7f007b07b..63e6b2ff10 100644 --- a/examples/platform/silabs/MatterConfig.cpp +++ b/examples/platform/silabs/MatterConfig.cpp @@ -48,10 +48,12 @@ #include "MemMonitoring.h" #endif -#if defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE == 1 -#include +#if ( ( defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE == 1 ) || defined(EXP_BOARD) ) #include -#endif // SLI_SI91X_MCU_INTERFACE +#if !defined(EXP_BOARD) +#include +#endif //!defined(EXP_BOARD) +#endif // ( ( defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE == 1 ) || defined(EXP_BOARD) ) #include // If building with the EFR32-provided crypto backend, we can use the @@ -379,9 +381,9 @@ CHIP_ERROR SilabsMatterConfig::InitWiFi(void) #endif // SL_WFX_USE_SECURE_LINK #endif // WF200_WIFI -#if defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE == 1 +#if ( ( defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE == 1 ) || defined(EXP_BOARD) ) VerifyOrReturnError(sl_matter_wifi_platform_init() == SL_STATUS_OK, CHIP_ERROR_INTERNAL); -#endif // SLI_SI91X_MCU_INTERFACE +#endif // ( ( defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE == 1 ) || defined(EXP_BOARD) ) return CHIP_NO_ERROR; } diff --git a/src/platform/silabs/PlatformManagerImpl.cpp b/src/platform/silabs/PlatformManagerImpl.cpp index 9ffb217103..5739fb7e20 100644 --- a/src/platform/silabs/PlatformManagerImpl.cpp +++ b/src/platform/silabs/PlatformManagerImpl.cpp @@ -84,10 +84,10 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) err = chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init(); SuccessOrExit(err); -#if CHIP_SYSTEM_CONFIG_USE_LWIP && !defined(SLI_SI91X_MCU_INTERFACE) +#if CHIP_SYSTEM_CONFIG_USE_LWIP && !defined(SLI_SI91X_MCU_INTERFACE) && !defined(EXP_BOARD) // Initialize LwIP. tcpip_init(NULL, NULL); -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP && !defined(SLI_SI91X_MCU_INTERFACE) +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP && !defined(SLI_SI91X_MCU_INTERFACE) && !defined(EXP_BOARD) ReturnErrorOnFailure(System::Clock::InitClock_RealTime()); diff --git a/src/platform/silabs/wifi/SiWx/WifiInterface.cpp b/src/platform/silabs/wifi/SiWx/WifiInterface.cpp index 0e8181cc06..12b8b3733c 100644 --- a/src/platform/silabs/wifi/SiWx/WifiInterface.cpp +++ b/src/platform/silabs/wifi/SiWx/WifiInterface.cpp @@ -254,12 +254,6 @@ sl_status_t sl_wifi_siwx917_init(void) RSI_NPSSGPIO_InputBufferEn(RTE_UULP_GPIO_1_PIN, 1); #endif // ENABLE_CHIP_SHELL #endif // CHIP_CONFIG_ENABLE_ICD_SERVER - -#else - // NCP Configurations - status = sl_matter_wifi_platform_init(); - VerifyOrReturnError(status == SL_STATUS_OK, status, - ChipLogError(DeviceLayer, "sl_matter_wifi_platform_init failed: 0x%lx", static_cast(status))); #endif // SLI_SI91X_MCU_INTERFACE sl_wifi_firmware_version_t version = { 0 }; diff --git a/src/platform/silabs/wifi/rs911x/platform/efx32_ncp_host.c b/src/platform/silabs/wifi/rs911x/platform/efx32_ncp_host.c index 0d269f5806..1c7fe2d194 100644 --- a/src/platform/silabs/wifi/rs911x/platform/efx32_ncp_host.c +++ b/src/platform/silabs/wifi/rs911x/platform/efx32_ncp_host.c @@ -33,6 +33,9 @@ #include #include #include +#include "sl_spidrv_exp_config.h" +#include "sl_spidrv_instances.h" +#include "spidrv.h" #if defined(SL_CATLOG_POWER_MANAGER_PRESENT) #include "sl_power_manager.h" @@ -42,25 +45,21 @@ #include "sl_board_control.h" #endif // SL_BOARD_NAME -#include "sl_spidrv_exp_config.h" -#include "sl_spidrv_instances.h" -#include "spidrv.h" -#define MAX_DATA_PACKET_SIZE 1800 #define LDMA_MAX_TRANSFER_LENGTH 4096 #define LDMA_DESCRIPTOR_ARRAY_LENGTH (LDMA_MAX_TRANSFER_LENGTH / 2048) +#define SPI_HANDLE sl_spidrv_exp_handle +#define MAX_DATA_PACKET_SIZE 1800 // use SPI handle for EXP header (configured in project settings) extern SPIDRV_Handle_t sl_spidrv_exp_handle; -#define SPI_HANDLE sl_spidrv_exp_handle static uint8_t dummy_buffer[MAX_DATA_PACKET_SIZE] = { 0 }; +static sl_si91x_host_init_configuration init_config = { 0 }; uint32_t rx_ldma_channel; uint32_t tx_ldma_channel; osMutexId_t ncp_transfer_mutex = 0; -static sl_si91x_host_init_configuration init_config = { 0 }; - // LDMA descriptor and transfer configuration structures for USART TX channel LDMA_Descriptor_t ldmaTXDescriptor[LDMA_DESCRIPTOR_ARRAY_LENGTH]; LDMA_TransferCfg_t ldmaTXConfig;