This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Determining source of "reset"

Hello all,

I have a simple C++ application flashed to my device to operate the UART - every time I send a char from an external source, the device appears to reset - specifically, the disassembly window leaps to 0xfffffffe. The call stack shows - I'm speculating that perhaps I need to be handling an interrupt that isn't currently handled?

How can I trace back to see which (if any) interrupt has fired (and maybe not been handled)?

Regards, Richard.

Parents
  • You can look at NRF_POWER->RESETREAS register to determine the source of the reset.

    A soft reset should not kill the state of memory. You'll know this because at the time the processor jumps to the reset vector, your stack pointer will still be valid (sp register is nonzero). If this is the case, then another trick you can use is to put the stack pointer in the memory window and see what was on the stack at the time of the reset. Of particular interest will be values corresponding to function return addresses (anything in the memory range 0x00000000 - SIZE_OF_FLASH_IN_HEX). You can then match those return addresses up using the .map file and work out the sequence of calls at the time the reset occurred.

    My guess is that somewhere you have an undefined event handler which is invoked when UART characters are received, so the processor is executing a BLX instruction to address zero.

  • RESETREAS indicates LOCKUP (and only that - I clear RESETREAS at the start of main()). Does that sound consistent with a missing handler, or should I be looking elsewhere now?

Reply Children
No Data
Related