Skip to content

Commit 5bb5c9e

Browse files
Fix OnSoftwareFaultDetect chiplock assert occuring on appError() (#32713)
1 parent 9f7d0a1 commit 5bb5c9e

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

examples/platform/silabs/SoftwareFaultReports.cpp

+5-10
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ void OnSoftwareFaultEventHandler(const char * faultRecordString)
7070
softwareFault.id = taskDetails.xTaskNumber;
7171
softwareFault.faultRecording.SetValue(ByteSpan(Uint8::from_const_char(faultRecordString), strlen(faultRecordString)));
7272

73-
SoftwareDiagnosticsServer::Instance().OnSoftwareFaultDetect(softwareFault);
73+
SystemLayer().ScheduleLambda([&softwareFault] { SoftwareDiagnosticsServer::Instance().OnSoftwareFaultDetect(softwareFault); });
74+
// Allow some time for the Fault event to be sent as the next action after exiting this function
75+
// is typically an assert or reboot.
76+
// Depending on the task at fault, it is possible the event can't be transmitted.
77+
vTaskDelay(pdMS_TO_TICKS(1000));
7478
#endif // MATTER_DM_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER
7579
}
7680

@@ -145,9 +149,6 @@ extern "C" void vApplicationMallocFailedHook(void)
145149
#endif
146150
Silabs::OnSoftwareFaultEventHandler(faultMessage);
147151

148-
// Allow some time for the Fault event to be sent before the chipAbort action
149-
// Depending of the task at fault, it is possible the event can't be transmitted.
150-
vTaskDelay(pdMS_TO_TICKS(1000));
151152
/* Force an assert. */
152153
configASSERT((volatile void *) NULL);
153154
}
@@ -167,9 +168,6 @@ extern "C" void vApplicationStackOverflowHook(TaskHandle_t pxTask, char * pcTask
167168
#endif
168169
Silabs::OnSoftwareFaultEventHandler(faultMessage);
169170

170-
// Allow some time for the Fault event to be sent before the chipAbort action
171-
// Depending of the task at fault, it is possible the event can't be transmitted.
172-
vTaskDelay(pdMS_TO_TICKS(1000));
173171
/* Force an assert. */
174172
configASSERT((volatile void *) NULL);
175173
}
@@ -251,9 +249,6 @@ extern "C" void RAILCb_AssertFailed(RAIL_Handle_t railHandle, uint32_t errorCode
251249
#endif // SILABS_LOG_ENABLED
252250
Silabs::OnSoftwareFaultEventHandler(faultMessage);
253251

254-
// Allow some time for the Fault event to be sent before the chipAbort action
255-
// Depending of the task at fault, it is possible the event can't be transmitted.
256-
vTaskDelay(pdMS_TO_TICKS(1000));
257252
chipAbort();
258253
}
259254
#endif // BRD4325A

0 commit comments

Comments
 (0)