mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 08:13:35 +08:00
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
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user