Skip to content

Commit

Permalink
arch/boardctl: Add printing board reset caller pid.
Browse files Browse the repository at this point in the history
To check who called to reset the board, add outputting the pid running the boardctl.

And, Since, before the log is completely printed out, the board is rebooted, so the log does not print out.
So, Add  a delay of 100ms until the UART FIFO is completely empty.

Signed-off-by: eunwoo.nam <[email protected]>
  • Loading branch information
ewoodev authored and sunghan-chang committed Dec 9, 2024
1 parent a648f76 commit ec21aa3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion os/arch/boardctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include <stdint.h>
#include <errno.h>
#include <assert.h>
#include <unistd.h>

#include <tinyara/board.h>
#include <tinyara/arch.h>
Expand Down Expand Up @@ -150,7 +151,9 @@ int boardctl(unsigned int cmd, uintptr_t arg)
sched_lock();
/* Add 100ms delay for flushing another logs like printf. */
up_mdelay(100);
lldbg("Board will Reboot now.\n");
lldbg("Board will Reboot now. pid: %d\n", getpid());
/* Add 100ms delay for flushing UART FIFO. */
up_mdelay(100);
ret = board_reset((int)arg);
break;
#endif
Expand Down

0 comments on commit ec21aa3

Please sign in to comment.