Skip to content

Commit 3871b6b

Browse files
mkardous-silabschirag-silabs
authored andcommitted
[Silabs] Update platform source files (project-chip#34865)
* Update matter support submodule * Add missing define guards * Merge SiWx917 and EFR32 uart source file * Remove references to BRD4325A * restyle * Add uart define * Fix uart define usage * Update uart.cpp --------- Co-authored-by: Chirag Bansal <Chirag.Bansal@silabs.com>
1 parent 7f82026 commit 3871b6b

File tree

14 files changed

+158
-248
lines changed

14 files changed

+158
-248
lines changed

examples/platform/silabs/OTAConfig.h

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
#include <platform/silabs/OTAImageProcessorImpl.h>
3030
#endif
3131

32+
#if (SL_MATTER_GN_BUILD == 0)
33+
#include "sl_matter_ota_config.h"
34+
#endif
35+
3236
class OTAConfig
3337
{
3438
public:

examples/platform/silabs/SiWx917/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ source_set("siwx917-common") {
210210
]
211211

212212
if (chip_enable_pw_rpc || chip_build_libshell || sl_uart_log_output) {
213-
sources += [ "uart.cpp" ]
213+
sources += [ "${silabs_common_plat_dir}/uart.cpp" ]
214214
}
215215

216216
if (chip_enable_ota_requestor) {

examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp

+40
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
#include <stdlib.h>
2020
#include <string.h>
2121

22+
#if (SL_MATTER_GN_BUILD == 0)
23+
#include "sl_matter_wifi_config.h"
24+
#endif // SL_MATTER_GN_BUILD
25+
2226
#include "sl_status.h"
2327
#include <app/icd/server/ICDServerConfig.h>
2428
#include <inet/IPAddress.h>
@@ -52,9 +56,15 @@ extern "C" {
5256
#include "sl_si91x_m4_ps.h"
5357
}
5458

59+
namespace {
5560
// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
5661
#define BUTTON_PRESSED 1
5762
bool btn0_pressed = false;
63+
64+
#ifdef ENABLE_CHIP_SHELL
65+
bool ps_requirement_added = false;
66+
#endif // ENABLE_CHIP_SHELL
67+
} // namespace
5868
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
5969

6070
#include "dhcp_client.h"
@@ -288,6 +298,26 @@ void sl_si91x_invoke_btn_press_event()
288298
{
289299
btn0_pressed = false;
290300
}
301+
302+
#ifdef ENABLE_CHIP_SHELL
303+
// Checking the UULP PIN 1 status to reinit the UART and not allow the device to go to sleep
304+
if (RSI_NPSSGPIO_GetPin(RTE_UULP_GPIO_1_PIN))
305+
{
306+
if (!ps_requirement_added)
307+
{
308+
sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS4);
309+
ps_requirement_added = true;
310+
}
311+
}
312+
else
313+
{
314+
if (ps_requirement_added)
315+
{
316+
sl_si91x_power_manager_remove_ps_requirement(SL_SI91X_POWER_MANAGER_PS4);
317+
ps_requirement_added = false;
318+
}
319+
}
320+
#endif // ENABLE_CHIP_SHELL
291321
}
292322

293323
/******************************************************************
@@ -426,6 +456,16 @@ static sl_status_t wfx_rsi_init(void)
426456
ChipLogError(DeviceLayer, "sl_si91x_m4_ta_secure_handshake failed: 0x%lx", static_cast<uint32_t>(status));
427457
return status;
428458
}
459+
#ifdef ENABLE_CHIP_SHELL
460+
// While using the matter shell with the ICD server, the GPIO 1 is used to check the UULP PIN 1 status
461+
// since UART doesn't act as a wakeup source in the UULP mode
462+
/*Configuring the NPS GPIO 1*/
463+
RSI_NPSSGPIO_SetPinMux(RTE_UULP_GPIO_1_PIN, 0);
464+
/*Configure the NPSS GPIO direction to input */
465+
RSI_NPSSGPIO_SetDir(RTE_UULP_GPIO_1_PIN, 1);
466+
/*Enable the REN*/
467+
RSI_NPSSGPIO_InputBufferEn(RTE_UULP_GPIO_1_PIN, 1);
468+
#endif // ENABLE_CHIP_SHELL
429469
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
430470
#endif /* SLI_SI91X_MCU_INTERFACE */
431471

examples/platform/silabs/SiWx917/uart.cpp

-169
This file was deleted.

examples/platform/silabs/SoftwareFaultReports.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@
2626
#include <platform/CHIPDeviceLayer.h>
2727
#include <platform/DiagnosticDataProvider.h>
2828

29-
#ifndef BRD4325A
29+
#if !defined(SLI_SI91X_MCU_INTERFACE) || !defined(SLI_SI91X_ENABLE_BLE)
3030
#include "rail_types.h"
3131

3232
#ifdef RAIL_ASSERT_DEBUG_STRING
3333
#include "rail_assert_error_codes.h"
3434
#endif
35-
#endif // BRD4325A
35+
#endif // !defined(SLI_SI91X_MCU_INTERFACE) || !defined(SLI_SI91X_ENABLE_BLE)
36+
37+
#if defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE
3638

37-
#ifdef BRD4325A // For SiWx917 Platform only
3839
#include "core_cm4.h"
39-
#endif
40+
#endif // defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE
4041

4142
// Technically FaultRecording is an octstr up to 1024 bytes.
4243
// We currently only report short strings. 100 char will more than enough for now.
@@ -227,7 +228,7 @@ extern "C" void vApplicationGetTimerTaskMemory(StaticTask_t ** ppxTimerTaskTCBBu
227228
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
228229
}
229230

230-
#ifndef BRD4325A
231+
#if !defined(SLI_SI91X_MCU_INTERFACE) || !defined(SLI_SI91X_ENABLE_BLE)
231232
extern "C" void RAILCb_AssertFailed(RAIL_Handle_t railHandle, uint32_t errorCode)
232233
{
233234
char faultMessage[kMaxFaultStringLen] = { 0 };
@@ -251,6 +252,5 @@ extern "C" void RAILCb_AssertFailed(RAIL_Handle_t railHandle, uint32_t errorCode
251252

252253
chipAbort();
253254
}
254-
#endif // BRD4325A
255-
255+
#endif // !defined(SLI_SI91X_MCU_INTERFACE) || !defined(SLI_SI91X_ENABLE_BLE)
256256
#endif // HARD_FAULT_LOG_ENABLE

examples/platform/silabs/efr32/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ source_set("efr32-common") {
248248
]
249249

250250
if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) {
251-
sources += [ "uart.cpp" ]
251+
sources += [ "${silabs_common_plat_dir}/uart.cpp" ]
252252
}
253253

254254
if (chip_enable_ota_requestor) {

0 commit comments

Comments
 (0)