19
19
20
20
#include " AppConfig.h"
21
21
#include " OTAConfig.h"
22
- #include < matter_config .h>
22
+ #include < MatterConfig .h>
23
23
24
24
#include < FreeRTOS.h>
25
25
@@ -165,6 +165,12 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
165
165
SILABS_LOG (" Init CHIP Stack" );
166
166
// Init Chip memory management before the stack
167
167
ReturnErrorOnFailure (chip::Platform::MemoryInit ());
168
+
169
+ // WiFi needs to be initialized after Memory Init for some reason
170
+ #ifdef SL_WIFI
171
+ InitWiFi ();
172
+ #endif
173
+
168
174
ReturnErrorOnFailure (PlatformMgr ().InitChipStack ());
169
175
170
176
SetDeviceInstanceInfoProvider (&Silabs::SilabsDeviceDataProvider::GetDeviceDataProvider ());
@@ -231,10 +237,6 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
231
237
SILABS_LOG (" Starting Platform Manager Event Loop" );
232
238
ReturnErrorOnFailure (PlatformMgr ().StartEventLoopTask ());
233
239
234
- #ifdef SL_WIFI
235
- InitWiFi ();
236
- #endif
237
-
238
240
#ifdef ENABLE_CHIP_SHELL
239
241
chip::startShellTask ();
240
242
#endif
@@ -251,15 +253,14 @@ void SilabsMatterConfig::InitWiFi(void)
251
253
#ifdef SL_WFX_USE_SECURE_LINK
252
254
wfx_securelink_task_start (); // start securelink key renegotiation task
253
255
#endif // SL_WFX_USE_SECURE_LINK
254
- #endif /* WF200_WIFI */
255
-
256
- #ifdef RS911X_WIFI
257
- /*
258
- * Start up any RSI interface stuff
259
- * (Not required) - Note that wfx_wifi_start will deal with
260
- * starting up a rsi task - which will initialize the SPI interface.
261
- */
262
- #endif
256
+ #elif defined(SIWX_917)
257
+ SILABS_LOG (" Init RSI 917 Platform" );
258
+ if (wfx_rsi_platform () != SL_STATUS_OK)
259
+ {
260
+ SILABS_LOG (" RSI init failed" );
261
+ return CHIP_ERROR_INTERNAL;
262
+ }
263
+ #endif /* WF200_WIFI */
263
264
}
264
265
#endif // SL_WIFI
265
266
0 commit comments