zephyr icon indicating copy to clipboard operation
zephyr copied to clipboard

logging: add .is_ready for UART backend

Open hunterhu3000 opened this issue 2 years ago • 1 comments

Add .is_ready for UART backend and fix a bug in z_log_init Fixes #47987

Signed-off-by: Hu Zhenyu [email protected]

hunterhu3000 avatar Aug 05 '22 00:08 hunterhu3000

See my comment https://github.com/zephyrproject-rtos/zephyr/issues/47987#issuecomment-1210191227 Imo this change is not needed and i'm not sure why it fixes #47987.

nordic-krch avatar Aug 10 '22 05:08 nordic-krch

Please explain the motivation for the change in the commit message samples/boards/mec15xxevb_assy6853/power_management can pass until commit https://github.com/zephyrproject-rtos/zephyr/commit/5f60164a0fc36484b60004310320dfd6f3ef0525 merged in. This patch changes the sem take timeout of the log thread, and affect the run time of idle thread. Analyzed the coredump of the failed test case, it can be found that the program stucks at z_idle_stacks

Remote debugging using 127.0.0.1:1234
0x0011ed78 in z_idle_stacks ()
(gdb) bt
#0  0x0011ed78 in z_idle_stacks ()
#1  0x000e2ab8 in arch_swap (key=<optimized out>) at /home/ztest/zephyrproject/zephyr/arch/arm/core/aarch32/swap.c:58
#2  0x0011ec40 in z_main_stack ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) info thread
  Id   Target Id         Frame
* 1    Thread <main>     0x0011ed78 in z_idle_stacks ()

The CONFIG_IDLE_STACK_SIZE is set to 256 by default in the kernel/Kconfig. Change it to 512, and then the test case can pass. The history can be seen in https://github.com/zephyrproject-rtos/zephyr/issues/47987

hunterhu3000 avatar Aug 17 '22 13:08 hunterhu3000

@MaureenHelm, the git commit message is updated as well. Thanks to review.

hunterhu3000 avatar Aug 18 '22 07:08 hunterhu3000