Skip to content

Commit

Permalink
Fix OnSoftwareFaultDetect chiplock assert occuring on appError() (pro…
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinez-silabs authored Mar 26, 2024
1 parent 9f7d0a1 commit 5bb5c9e
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions examples/platform/silabs/SoftwareFaultReports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ void OnSoftwareFaultEventHandler(const char * faultRecordString)
softwareFault.id = taskDetails.xTaskNumber;
softwareFault.faultRecording.SetValue(ByteSpan(Uint8::from_const_char(faultRecordString), strlen(faultRecordString)));

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

Expand Down Expand Up @@ -145,9 +149,6 @@ extern "C" void vApplicationMallocFailedHook(void)
#endif
Silabs::OnSoftwareFaultEventHandler(faultMessage);

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

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

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

0 comments on commit 5bb5c9e

Please sign in to comment.