Enabling CONFIG_LOG_MODE_IMMEDIATE causes Zephyr fatal error on ncs v2.4.2

The following is RTT log messages of setting CONFIG_LOG_MODE_DEFERRED=y in prj.conf file.

00> *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
00> Starting button Test example
00> w25q256jv@0: device is ready
00> jedec-id = [ef 40 19];
00> rbuf[0]=0xff
00> rbuf[0]=0x0

The following is RTT log messages of setting CONFIG_LOG_MODE_IMMEDIATE=y in prj.conf file and removing CONFIG_LOG_MODE_DEFERRED=y from prj.conf file.

00> *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
00> Starting button Test example
00> [00:00:00.601,196] <err> os: ***** USAGE FAULT *****
00> [00:00:00.601,470] <err> os:   Stack overflow (context area not valid)
00> [00:00:00.601,806] <err> os: r0/a1:  0x00008a53  r1/a2:  0x00008a49  r2/a3:  0x00008a48
00> [00:00:00.602,203] <err> os: r3/a4:  0x00006c65 r12/ip:  0x20001c14 r14/lr:  0x00000000
00> [00:00:00.602,600] <err> os:  xpsr:  0x00008a00
00> [00:00:00.602,874] <err> os: Faulting instruction address (r15/pc): 0x00000000
00> [00:00:00.603,210] <err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
00> [00:00:00.603,576] <err> os: Current thread: 0x200002a0 (unknown)
00> [00:00:00.623,931] [1;31m<err> fatal_error: Resetting system[0m

Procedures to reproduce this issue are as follows.

1. Unzipping custom_nrf5340.zip to C:\ncs\v2.4.2\nrf\boards\arm folder.

2. Unzipping minimal_log_flash_jesd216.zip to C:\ncs\v2.4.2\nrf\samples folder.

3. cd C:\ncs\v2.4.2\nrf\samples\minimal_log_flash_jesd216

4. west build -b custom_nrf5340_cpuapp

5. west flash

6. Rebooting nRF5340 device and connecting to RTT Viewer.

Parents Reply Children
Related