nrf52: hardfault recorder v aplikaci a v .noinit (#5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-10-18 22:59:02 +02:00
1 parent 6e4e52d181
commit 993a14504e
4 files changed
+50 -3

No files matched your search

+7
View File
@@ -1697,6 +1697,13 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, char *command, char *reply
}
while (*command == ' ') command++; // skip leading spaces
#ifdef BENCH_FAULT_CMD
// Bench builds only (PLATFORMIO_BUILD_FLAGS=-D BENCH_FAULT_CMD): crash on
// purpose, to prove the hardfault record survives the reset and gets printed.
if (strcmp(command, "hardfault") == 0) {
__builtin_trap(); // UDF -> UsageFault, escalates to HardFault
}
#endif
if (strlen(command) > 4 && command[2] == '|') { // optional prefix (for companion radio CLI)
memcpy(reply, command, 3); // reflect the prefix back