flipperzero-firmware
flipperzero-firmware copied to clipboard
Fix hard crash on some custom firmwares in RELEASE mode
What's new
- Fix crash on shutdown in RELEASE mode
- Code of RESTORE_REGISTERS_AND_HALT_MCU was separated to DEBUG and RELEASE mode
Verification
- Сompile the firmware in release mode and try to turn off the Flipper
Checklist (For Reviewer)
- [ ] PR has description of feature/bug or link to Confluence/Jira task
- [ ] Description contains actions to verify feature/bugfix
- [ ] I've built this code, uploaded it to the device and verified feature/bugfix
Can we have a little bit more information on what exactly removing bkpt fixes?
Ok, I've reproduced issue.
Can we have a little bit more information on what exactly removing
bkptfixes?
In previous version you had code like this, but in latest version enter to DEBUG state in RELEASE version gives error: HardFault
static FURI_NORETURN void __furi_halt_mcu() {
register const void* r12 asm("r12") = (void*)__furi_check_registers;
asm volatile("ldm r12, {r0-r11} \n"
#ifdef FURI_DEBUG
"bkpt 0x00 \n"
#endif
"loop%=: \n"
"wfi \n"
"b loop%= \n"
:
: "r"(r12)
: "memory");
__builtin_unreachable();
}
Yep, I forgot why I was adding it last time and decided to drop it. Now I've recalled why ;-) I'd like to analyze this thing a little bit more before merging this PR.
Superseded by #1957