Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SL-UP] 917ncp init failure fix #133

12 changes: 7 additions & 5 deletions examples/platform/silabs/MatterConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@
#include "MemMonitoring.h"
#endif

#if defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE == 1
#include <platform/silabs/SiWx917/SiWxPlatformInterface.h>
#if ( ( defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE == 1 ) || defined(EXP_BOARD) )
#include <platform/silabs/wifi/wiseconnect-abstraction/WiseconnectInterfaceAbstraction.h>
#endif // SLI_SI91X_MCU_INTERFACE
#if !defined(EXP_BOARD)
#include <platform/silabs/SiWx917/SiWxPlatformInterface.h>
#endif //!defined(EXP_BOARD)
#endif // ( ( defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE == 1 ) || defined(EXP_BOARD) )

#include <crypto/CHIPCryptoPAL.h>
// If building with the EFR32-provided crypto backend, we can use the
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/platform/silabs/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
6 changes: 0 additions & 6 deletions src/platform/silabs/wifi/SiWx/WifiInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t>(status)));
#endif // SLI_SI91X_MCU_INTERFACE

sl_wifi_firmware_version_t version = { 0 };
Expand Down
13 changes: 6 additions & 7 deletions src/platform/silabs/wifi/rs911x/platform/efx32_ncp_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
#include <platform/silabs/wifi/wf200/platform/spi_multiplex.h>
#include <stdbool.h>
#include <string.h>
#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"
Expand All @@ -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
arun-silabs marked this conversation as resolved.
Show resolved Hide resolved
#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;
Expand Down
Loading