mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 23:41:37 +08:00
Fix non-determinstic boot hang with crashdumps
On boot, if board_hardfault_init finds a hardfault stored in BBSRAM, it checks if there is any data available on stdin to see if there is somebody there to respond to a prompt. But on boards such as cubeorange where there is not a serial console by default, the ioctl fails and bytesWaiting is uninitialized. So it will non-deterministally hang the boot process with no outside feedback if that value is not zero. Signed-off-by: Alex Mikhalev <alexmikhalevalex@gmail.com>
This commit is contained in:
committed by
David Sidrane
parent
149ac16bb4
commit
91d1825fcf
@@ -130,7 +130,7 @@ int board_hardfault_init(int display_to_console, bool allow_prompt)
|
|||||||
|
|
||||||
/* Also end the misery for a user that holds for a key down on the console */
|
/* Also end the misery for a user that holds for a key down on the console */
|
||||||
|
|
||||||
int bytesWaiting;
|
int bytesWaiting = 0;
|
||||||
ioctl(fileno(stdin), FIONREAD, (unsigned long)((uintptr_t) &bytesWaiting));
|
ioctl(fileno(stdin), FIONREAD, (unsigned long)((uintptr_t) &bytesWaiting));
|
||||||
|
|
||||||
if (reboots > display_to_console || bytesWaiting != 0) {
|
if (reboots > display_to_console || bytesWaiting != 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user