@@ -70,7 +70,11 @@ void OnSoftwareFaultEventHandler(const char * faultRecordString)
70
70
softwareFault.id = taskDetails.xTaskNumber ;
71
71
softwareFault.faultRecording .SetValue (ByteSpan (Uint8::from_const_char (faultRecordString), strlen (faultRecordString)));
72
72
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 ));
74
78
#endif // MATTER_DM_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER
75
79
}
76
80
@@ -145,9 +149,6 @@ extern "C" void vApplicationMallocFailedHook(void)
145
149
#endif
146
150
Silabs::OnSoftwareFaultEventHandler (faultMessage);
147
151
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 ));
151
152
/* Force an assert. */
152
153
configASSERT ((volatile void *) NULL );
153
154
}
@@ -167,9 +168,6 @@ extern "C" void vApplicationStackOverflowHook(TaskHandle_t pxTask, char * pcTask
167
168
#endif
168
169
Silabs::OnSoftwareFaultEventHandler (faultMessage);
169
170
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 ));
173
171
/* Force an assert. */
174
172
configASSERT ((volatile void *) NULL );
175
173
}
@@ -251,9 +249,6 @@ extern "C" void RAILCb_AssertFailed(RAIL_Handle_t railHandle, uint32_t errorCode
251
249
#endif // SILABS_LOG_ENABLED
252
250
Silabs::OnSoftwareFaultEventHandler (faultMessage);
253
251
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 ));
257
252
chipAbort ();
258
253
}
259
254
#endif // BRD4325A
0 commit comments