diff --git a/lib/debugcommands/debugcommands.c b/lib/debugcommands/debugcommands.c index 11976c654..361c858cb 100644 --- a/lib/debugcommands/debugcommands.c +++ b/lib/debugcommands/debugcommands.c @@ -432,9 +432,14 @@ static int cmd_timeh(int argc, const console_cmd_args *argv) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" static int cmd_crash(int argc, const console_cmd_args *argv) { +#if ARCH_ARM && ARM_ONLY_THUMB + /* a branch directly to an aligned address should trigger a fault */ + asm("bx %0":: "r"(0)); +#else /* should crash */ volatile uint32_t *ptr = (void *)1; *ptr = 1; +#endif /* if it didn't, panic the system */ panic("crash");