This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Stack Pointer references pre-handler location in watchdog timeout handler.

static void wdt_timeout_handler(void)
{
  // Store a pointer of type *stack_t in r0.
  uint32_t r0;
  __ASM ("   mrs r0, msp        \n");   

  const stack_t pStack = (stack_t *)r0;
  dump_stack(pStack);
}

The dumped stack information (especially the PC) point to what was running when the WD fired. This makes sense to me, but conflicts with the advice posted in the question below, and I'd really like to understand why.

devzone.nordicsemi.com/.../saving-the-location-of-watchdog-timeout

Related