Skip to content

Commit 2207074

Browse files
jmartinez-silabspull[bot]
authored andcommitted
Fix log disabling and the lock-app build for siwx917 (#25622)
1 parent a6dd083 commit 2207074

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

examples/lock-app/silabs/SiWx917/include/LockManager.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ static constexpr uint8_t kMaxHolidaySchedules = 10;
5858
static constexpr uint8_t kMaxCredentialSize = 20;
5959
static constexpr uint8_t kNumCredentialTypes = 6;
6060

61+
static constexpr uint8_t kMaxCredentials = kMaxUsers * kMaxCredentialsPerUser;
62+
6163
} // namespace ResourceRanges
6264

6365
namespace LockInitParams {
@@ -201,14 +203,14 @@ class LockManager
201203
static void ActuatorMovementTimerEventHandler(AppEvent * aEvent);
202204

203205
EmberAfPluginDoorLockUserInfo mLockUsers[kMaxUsers];
204-
EmberAfPluginDoorLockCredentialInfo mLockCredentials[kNumCredentialTypes][kMaxCredentialsPerUser];
206+
EmberAfPluginDoorLockCredentialInfo mLockCredentials[kNumCredentialTypes][kMaxCredentials];
205207
WeekDaysScheduleInfo mWeekdaySchedule[kMaxUsers][kMaxWeekdaySchedulesPerUser];
206208
YearDayScheduleInfo mYeardaySchedule[kMaxUsers][kMaxYeardaySchedulesPerUser];
207209
HolidayScheduleInfo mHolidaySchedule[kMaxHolidaySchedules];
208210

209211
char mUserNames[ArraySize(mLockUsers)][DOOR_LOCK_MAX_USER_NAME_SIZE];
210-
uint8_t mCredentialData[kNumCredentialTypes][kMaxCredentialsPerUser][kMaxCredentialSize];
211-
CredentialStruct mCredentials[kMaxUsers][kMaxCredentialsPerUser];
212+
uint8_t mCredentialData[kNumCredentialTypes][kMaxCredentials][kMaxCredentialSize];
213+
CredentialStruct mCredentials[kMaxUsers][kMaxCredentials];
212214

213215
static LockManager sLock;
214216
SI917DoorLock::LockInitParams::LockParam LockParams;

src/platform/silabs/Logging.cpp

+12-4
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,9 @@ extern "C" __attribute__((naked)) void HardFault_Handler(void)
432432
"debugHardfault_address: .word debugHardfault \n");
433433
}
434434

435+
#endif // HARD_FAULT_LOG_ENABLE && SILABS_LOG_ENABLED
436+
437+
#if HARD_FAULT_LOG_ENABLE
435438
extern "C" void vApplicationMallocFailedHook(void)
436439
{
437440
/* Called if a call to pvPortMalloc() fails because there is insufficient
@@ -440,8 +443,9 @@ extern "C" void vApplicationMallocFailedHook(void)
440443
timers, and semaphores. The size of the FreeRTOS heap is set by the
441444
configTOTAL_HEAP_SIZE configuration constant in FreeRTOSConfig.h. */
442445

446+
#if SILABS_LOG_ENABLED
443447
SILABS_LOG("Failed do a malloc on HEAP. Is it too small ?");
444-
448+
#endif
445449
/* Force an assert. */
446450
configASSERT((volatile void *) NULL);
447451
}
@@ -455,8 +459,11 @@ extern "C" void vApplicationStackOverflowHook(TaskHandle_t pxTask, char * pcTask
455459
/* Run time stack overflow checking is performed if
456460
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
457461
function is called if a stack overflow is detected. */
462+
463+
#if SILABS_LOG_ENABLED
458464
SILABS_LOG("TASK OVERFLOW");
459465
SILABS_LOG(pcTaskName);
466+
#endif
460467
/* Force an assert. */
461468
configASSERT((volatile void *) NULL);
462469
}
@@ -519,6 +526,7 @@ extern "C" void vApplicationGetTimerTaskMemory(StaticTask_t ** ppxTimerTaskTCBBu
519526
#ifndef BRD4325A
520527
extern "C" void RAILCb_AssertFailed(RAIL_Handle_t railHandle, uint32_t errorCode)
521528
{
529+
#if SILABS_LOG_ENABLED
522530
#ifdef RAIL_ASSERT_DEBUG_STRING
523531
static const char * railErrorMessages[] = RAIL_ASSERT_ERROR_MESSAGES;
524532
const char * errorMessage = "Unknown";
@@ -531,11 +539,11 @@ extern "C" void RAILCb_AssertFailed(RAIL_Handle_t railHandle, uint32_t errorCode
531539
SILABS_LOG("RAIL Assert : %s", errorMessage);
532540
#else
533541
SILABS_LOG("RAIL Assert : %ld", errorCode);
534-
#endif
535-
542+
#endif // RAIL_ASSERT_DEBUG_STRING
543+
#endif // SILABS_LOG_ENABLED
536544
while (1)
537545
;
538546
}
539547
#endif // BRD4325A
540548

541-
#endif // HARD_FAULT_LOG_ENABLE && SILABS_LOG_ENABLED
549+
#endif // HARD_FAULT_LOG_ENABLE

third_party/silabs/SiWx917_sdk.gni

+3-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ declare_args() {
3232
use_silabs_thread_lib = false
3333
enable_openthread_cli = true
3434

35-
kvs_max_entries = 75
35+
kvs_max_entries = 255
3636

3737
# Use Silabs factory data provider example.
3838
# Users can implement their own.
@@ -41,8 +41,7 @@ declare_args() {
4141
# Enable Segger System View
4242
use_system_view = false
4343

44-
# Argument to Disable IPv4 for wifi(rs911)
45-
chip_enable_wifi_ipv4 = false
44+
silabs_log_enabled = true
4645
}
4746

4847
assert(efr32_sdk_root != "", "efr32_sdk_root must be specified")
@@ -107,7 +106,7 @@ template("efr32_sdk") {
107106
"__STARTUP_CLEAR_BSS",
108107
"HARD_FAULT_LOG_ENABLE",
109108
"CORTEXM3_EFM32_MICRO",
110-
"SILABS_LOG_ENABLED=1",
109+
"SILABS_LOG_ENABLED=${silabs_log_enabled}",
111110
"NVM3_DEFAULT_NVM_SIZE=40960",
112111
"NVM3_DEFAULT_MAX_OBJECT_SIZE=4092",
113112
"KVS_MAX_ENTRIES=${kvs_max_entries}",
@@ -144,10 +143,6 @@ template("efr32_sdk") {
144143

145144
defines += board_defines
146145

147-
if (chip_enable_wifi_ipv4) {
148-
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_IPV4=1" ]
149-
}
150-
151146
# Enabling led interface
152147
if (use_wstk_leds) {
153148
defines += [ "ENABLE_WSTK_LEDS" ]

0 commit comments

Comments
 (0)