EMI kills USB and causes a FATAL on the ECU #4310

only:small-can-board_debug
This commit is contained in:
rusefillc 2023-10-21 16:24:38 -04:00
parent 29487e084a
commit 09c3f3aa5e
2 changed files with 15 additions and 0 deletions

View File

@ -35,6 +35,9 @@ void checkLastBootError() {
efiPrintf("Last boot had firmware error: %s", sramState->ErrorString);
break;
case ErrorCookie::HardFault: {
efiPrintf("Last boot had raw: %s", sramState->rawMsg);
efiPrintf("Last boot had hardFile: %s", sramState->hardFile);
efiPrintf("Last boot had line: %d", sramState->hardLine);
efiPrintf("Last boot had error: %s", sramState->ErrorString);
efiPrintf("Last boot had hard fault type: %x addr: %x CSFR: %x", sramState->FaultType, sramState->FaultAddress, sramState->Csfr);
if (engineConfiguration->rethrowHardFault) {
@ -102,6 +105,15 @@ void chDbgPanic3(const char *msg, const char * file, int line) {
__asm volatile("BKPT #0\n");
#endif
#if EFI_BACKUP_SRAM
auto sramState = getBackupSram();
if (sramState != nullptr) {
strncpy(sramState->hardFile, file, efi::size(sramState->hardFile));
sramState->hardLine = line;
strncpy(sramState->rawMsg, msg, efi::size(sramState->rawMsg));
}
#endif // EFI_BACKUP_SRAM
if (hasOsPanicError())
return;
dbg_panic_file = file;

View File

@ -52,6 +52,9 @@ struct BackupSramData {
ErrorCookie Cookie;
critical_msg_t ErrorString;
critical_msg_t hardFile;
int hardLine;
critical_msg_t rawMsg;
port_extctx FaultCtx;
uint32_t FaultType;
uint32_t FaultAddress;