Browse Source

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
sbg
David Sidrane 6 years ago
parent
commit
88d0b163b5
  1. 12
      src/drivers/boards/common/board_crashdump.c

12
src/drivers/boards/common/board_crashdump.c

@ -336,9 +336,15 @@ __EXPORT void board_crashdump(uintptr_t currentsp, FAR void *tcb, FAR const uint @@ -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 */

Loading…
Cancel
Save