mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Merge branch 'zlo/tlsf-and-a-temple-of-memcorrupt' of https://github.com/flipperdevices/flipperzero-firmware into mntm-dev
This commit is contained in:
@@ -286,6 +286,47 @@ void MemManage_Handler(void) {
|
||||
}
|
||||
|
||||
void BusFault_Handler(void) {
|
||||
furi_log_puts("\r\n" _FURI_LOG_CLR_E "Bus fault:\r\n");
|
||||
if(FURI_BIT(SCB->CFSR, SCB_CFSR_LSPERR_Pos)) {
|
||||
furi_log_puts(" - lazy stacking for exception entry\r\n");
|
||||
}
|
||||
|
||||
if(FURI_BIT(SCB->CFSR, SCB_CFSR_STKERR_Pos)) {
|
||||
furi_log_puts(" - stacking for exception entry\r\n");
|
||||
}
|
||||
|
||||
if(FURI_BIT(SCB->CFSR, SCB_CFSR_UNSTKERR_Pos)) {
|
||||
furi_log_puts(" - unstacking for exception return\r\n");
|
||||
}
|
||||
|
||||
if(FURI_BIT(SCB->CFSR, SCB_CFSR_IMPRECISERR_Pos)) {
|
||||
furi_log_puts(" - imprecise data access\r\n");
|
||||
}
|
||||
|
||||
if(FURI_BIT(SCB->CFSR, SCB_CFSR_PRECISERR_Pos)) {
|
||||
furi_log_puts(" - precise data access\r\n");
|
||||
}
|
||||
|
||||
if(FURI_BIT(SCB->CFSR, SCB_CFSR_IBUSERR_Pos)) {
|
||||
furi_log_puts(" - instruction\r\n");
|
||||
}
|
||||
|
||||
if(FURI_BIT(SCB->CFSR, SCB_CFSR_BFARVALID_Pos)) {
|
||||
uint32_t busfault_address = SCB->BFAR;
|
||||
furi_log_puts(" -- at 0x");
|
||||
|
||||
char tmp_str[] = "0xFFFFFFFF";
|
||||
itoa(busfault_address, tmp_str, 16);
|
||||
furi_log_puts(tmp_str);
|
||||
|
||||
furi_log_puts("\r\n");
|
||||
|
||||
if(busfault_address == (uint32_t)NULL) {
|
||||
furi_log_puts(" -- NULL pointer dereference\r\n");
|
||||
}
|
||||
}
|
||||
furi_log_puts(_FURI_LOG_CLR_RESET);
|
||||
|
||||
furi_crash("BusFault");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user