Skip to content
Snippets Groups Projects
Commit 88d0b163 authored by David Sidrane's avatar David Sidrane
Browse files

common:board_crashdump must end in reset!

   Upstream changes defer the board reset based on the vaule of
   CONFIG_BOARD_RESET_ON_ASSERT
      0 (or not defined) Do not reset on assert
      >= 1 reset if assertion is in an interrupt handler or the idle task
      >= 2 on any asertion.

  up_assert is called from up_hardfault or an asertion failure.
  Part 1 of up_assert will call out to the board_crashdump
  Part 2 on return from board_crashdump will then perform
  the reset.

  board_crashdump needs a chunk of ram to save the complete
  context in. It uses  &_sdata which is the lowest memory and
  it will corrupt that memeory.  We can therfore can not allow
  return to the OS, as it could depend on that area of RAM.

  So all boards need to do a reset at the end of board_crashdump
parent e358486e
No related branches found
No related tags found
No related merge requests found
......@@ -336,9 +336,15 @@ __EXPORT void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR const uint
#endif /* BOARD_CRASHDUMP_RESET_ONLY */
#if defined(CONFIG_BOARD_RESET_ON_CRASH)
board_reset(0);
#endif
/* All boards need to do a reset here!
*
* Since we needed a chunk of ram to save the complete
* context in and have corrupted it. We can not allow
* the OS to run again. We used &_sdata which is the lowest memory
* and it could be used by the OS.
*/
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
}
#endif /* CONFIG_BOARD_CRASHDUMP */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment