case about CONFIG_LOG_DEFAULT_LEVEL=4 case nRF52840 error

Hi,

1. Please help me resolve the log error that occurs with CONFIG_LOG_DEFAULT_LEVEL=4

2. I created a very simple example of log printing and it worked fine when I set CONFIG_LOG_DEFAULT_LEVEL=3.

3. When I set CONFIG_LOG_DEFAULT_LEVEL=4, the printed log shows the error message as follows:

4. The code is as follows:

[17:18:27.649]收←◆[00:00:1[00:00:00.306,945] <dbg> os: setup_thread_stack: stack 0x20002340 for thread 0x20000828: obj_size=4160 buf_start=0x20002380  buf_size 4096 stack_ptr=0x20003380
[00:00:00.306,976] <dbg> os: setup_thread_stack: stack 0x200021c0 for thread 0x20000788: obj_size=384 buf_start=0x20002200  buf_size 320 stack_ptr=0x20002340
--- 24 messages dropped ---
[00:00:00.306,976] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:00.307,006] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:00.307,006] <dbg> mpu: region_init: [2] 0x20002340 0x150b000a
[00:00:00.307,037] <dbg> clock_control: clkstarted_handle: lfclk: Clock started
[00:00:00.307,067] <dbg> os: setup_thread_stack: stack 0x20001640 for thread 0x20000288: obj_size=832 buf_start=0x20001680  buf_size 768 stack_ptr=0x20001980
[00:00:00.307,128] <dbg> os: setup_thread_stack: stack 0x20003380 for thread 0x200008e8: obj_size=2112 buf_start=0x200033c0  buf_size 2048 stack_ptr=0x20003bc0
[00:00:00.307,159] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:00.307,159] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:00.307,189] <dbg> mpu: region_init: [2] 0x20003380 0x150b000a
[00:00:00.307,189] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:00.307,220] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:00.307,220] <dbg> mpu: region_init: [2] 0x20002340 0x150b000a
[00:00:00.307,250] <dbg> os: setup_thread_stack: stack 0x20001200 for thread 0x200001e8: obj_size=1088 buf_start=0x20001240  buf_size 1024 stack_ptr=0x20001640
[00:00:00.307,281] <dbg> os: k_sched_unlock: scheduler unlocked (0x20000828:0)
[00:00:00.307,281] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:00.307,312] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:00.307,312] <dbg> mpu: region_init: [2] 0x20002340 0x150b000a
LOG_PRINTK Hello World! nrf52840dk_nrf52840
LOG_RAW Hello World! nrf52840dk_nrf52840
[00:00:00.307,434] <err> hello_world: LOG_ERR Hello World! nrf52840dk_nrf52840

[00:00:00.307,464] <wrn> hello_world: LOG_WRN Hello World! nrf52840dk_nrf52840

[00:00:00.307,495] <inf> hello_world: LOG_INF Hello World! nrf52840dk_nrf52840

[00:00:00.307,525] <dbg> hello_world: log_test: LOG_DBG Hello World! nrf52840dk_nrf52840

[00:00:00.307,556] <err> hello_world: LOG_HEXDUMP_ERR Hello World!

                                      6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                      30                                               |0                

[17:18:28.897]收←◆[00:00:00.555,725] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:00.555,755] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:00.555,755] <dbg> mpu: region_init: [2] 0x200021c0 0x150b000a
[00:00:00.555,786] <dbg> pm: pm_system_suspend: No PM operations done.
[00:00:01.555,755] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:01.555,786] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:01.555,786] <dbg> mpu: region_init: [2] 0x20001640 0x150b000a

[17:18:29.951]收←◆[00:00:01.608,734] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:01.608,764] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:01.608,795] <dbg> mpu: region_init: [2] 0x200021c0 0x150b000a
[00:00:01.608,795] <dbg> pm: pm_system_suspend: No PM operations done.
[00:00:02.608,795] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:02.608,825] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:02.608,825] <dbg> mpu: region_init: [2] 0x20001640 0x150b000a

[17:18:30.650]收←◆[00:00:02.661,804] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:02.661,804] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:02.661,834] <dbg> mpu: region_init: [2] 0x200021c0 0x150b000a
[00:00:02.661,865] <dbg> pm: pm_system_suspend: No PM operations done.
[00:00:03.307,800] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:03.307,830] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:03.307,830] <dbg> mpu: region_init: [2] 0x20002340 0x150b000a
LOG_PRINTK Hello World! nrf52840dk_nrf52840
LOG_RAW Hello World! nrf52840dk_nrf52840
[00:00:03.307,922] <err> hello_world: LOG_ERR Hello World! nrf52840dk_nrf52840

[00:00:03.307,983] <wrn> hello_world: LOG_WRN Hello World! nrf52840dk_nrf52840

[00:00:03.308,013] <inf> hello_world: LOG_INF Hello World! nrf52840dk_nrf52840

[00:00:03.308,044] <dbg> hello_world: log_test: LOG_DBG Hello World! nrf52840dk_nrf52840

[00:00:03.308,074] <err> hello_world: LOG_HEXDUMP_ERR Hello World!

                                      6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                      30                                               |0                
[00:00:03.308,105] <wrn> hello_world: LOG_HEXDUMP_WRN Hello World!

                                      6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                      30                                               |0                
[00:00:03.308,105] <inf> hello_world: LOG_HEXDUMP_INF Hello World!

                                      6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                      30                                               |0                
[00:00:03.308,135] <dbg> hello_world: log_test: LOG_HEXDUMP_DBG Hello World!

                                      6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                      30                                               |0                
[00:00:03.308,166] <dbg> os: z_tick_sleep: thread 0x20000828 for 98304 ticks
[00:00:03.308,197] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:03.308,197] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:03.308,227] <dbg> mpu: region_init: [2] 0x20001640 0x150b000a

[17:18:31.874]收←◆[00:00:03.533,081] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:03.533,111] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:03.533,111] <dbg> mpu: region_init: [2] 0x200021c0 0x150b000a
[00:00:03.533,142] <dbg> pm: pm_system_suspend: No PM operations done.
[00:00:04.533,111] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:04.533,142] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:04.533,142] <dbg> mpu: region_init: [2] 0x20001640 0x150b000a

[17:18:32.928]收←◆[00:00:04.586,151] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:04.586,181] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:04.586,181] <dbg> mpu: region_init: [2] 0x200021c0 0x150b000a
[00:00:04.586,212] <dbg> pm: pm_system_suspend: No PM operations done.
[00:00:05.586,181] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:05.586,212] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:05.586,212] <dbg> mpu: region_init: [2] 0x20001640 0x150b000a

[17:18:33.651]收←◆[00:00:05.639,190] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:05.639,190] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:05.639,221] <dbg> mpu: region_init: [2] 0x200021c0 0x150b000a
[00:00:05.639,251] <dbg> pm: pm_system_suspend: No PM operations done.
[00:00:06.308,258] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:06.308,288] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:06.308,288] <dbg> mpu: region_init: [2] 0x20002340 0x150b000a
LOG_PRINTK Hello World! nrf52840dk_nrf52840
LOG_RAW Hello World! nrf52840dk_nrf52840
[00:00:06.308,410] <err> hello_world: LOG_ERR Hello World! nrf52840dk_nrf52840

[00:00:06.308,441] <wrn> hello_world: LOG_WRN Hello World! nrf52840dk_nrf52840

[00:00:06.308,471] <inf> hello_world: LOG_INF Hello World! nrf52840dk_nrf52840

[00:00:06.308,502] <dbg> hello_world: log_test: LOG_DBG Hello World! nrf52840dk_nrf52840

[00:00:06.308,532] <err> hello_world: LOG_HEXDUMP_ERR Hello World!

                                      6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                      30                                               |0                
[00:00:06.308,563] <wrn> hello_world: LOG_HEXDUMP_WRN Hello World!

                                      6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                      30                                               |0                
[00:00:06.308,563] <inf> hello_world: LOG_HEXDUMP_INF Hello World!

                                      6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                      30                                               |0                
[00:00:06.308,593] <dbg> hello_world: log_test: LOG_HEXDUMP_DBG Hello World!

                                      6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                      30                                               |0                
[00:00:06.308,624] <dbg> os: z_tick_sleep: thread 0x20000828 for 98304 ticks
[00:00:06.308,654] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
[00:00:06.308,654] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
[00:00:06.308,685] <dbg> mpu: region_init: [2] 0x20001640 0x150b000a

5. Test environment:

ncs v2.4.0

DK:PCA10056 3.0.0

Thank you for all your assistance.
Kind regards,
Peter.Min

  • Hi test,

    1. set  CONFIG_LOG_MODE_DEFERRED=y is ok.

    [16:39:45.065]收←◆[00:00:02.238,555] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:02.238,586] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:02.238,616] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:02.238,616] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:03.238,586] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:03.238,616] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:03.238,616] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    [00:00:03.293,395] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:03.293,426] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:03.293,426] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:03.293,457] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:03.293,670] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:03.293,701] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:03.293,701] <dbg> mpu: region_init: [2] 0x20003e80 0x150b000a
    LOG_PRINTK Hello World! nrf52840dk_nrf52840
    LOG_RAW Hello World! nrf52840dk_nrf52840
    [00:00:03.293,792] <err> app: LOG_ERR Hello World! nrf52840dk_nrf52840
    
    [00:00:03.293,823] <wrn> app: LOG_WRN Hello World! nrf52840dk_nrf52840
    
    [00:00:03.293,884] <inf> app: LOG_INF Hello World! nrf52840dk_nrf52840
    
    [00:00:03.293,914] <dbg> app: log_test: LOG_DBG Hello World! nrf52840dk_nrf52840
    
    [00:00:03.293,945] <err> app: LOG_HEXDUMP_ERR Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:03.293,945] <wrn> app: LOG_HEXDUMP_WRN Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:03.293,975] <inf> app: LOG_HEXDUMP_INF Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:03.294,006] <dbg> app: log_test: LOG_HEXDUMP_DBG Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:03.294,036] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:03.294,067] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:03.294,067] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:46.335]收←◆[00:00:03.508,605] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:03.508,636] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:03.508,666] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:03.508,697] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:04.508,666] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:04.508,697] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:04.508,697] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:47.389]收←◆[00:00:04.563,476] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:04.563,507] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:04.563,507] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:04.563,537] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:05.563,507] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:05.563,537] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:05.563,537] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:48.121]收←◆[00:00:05.618,316] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:05.618,316] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:05.618,347] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:05.618,347] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:06.294,097] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:06.294,128] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:06.294,128] <dbg> mpu: region_init: [2] 0x20003e80 0x150b000a
    LOG_PRINTK Hello World! nrf52840dk_nrf52840
    LOG_RAW Hello World! nrf52840dk_nrf52840
    [00:00:06.294,219] <err> app: LOG_ERR Hello World! nrf52840dk_nrf52840
    
    [00:00:06.294,250] <wrn> app: LOG_WRN Hello World! nrf52840dk_nrf52840
    
    [00:00:06.294,311] <inf> app: LOG_INF Hello World! nrf52840dk_nrf52840
    
    [00:00:06.294,342] <dbg> app: log_test: LOG_DBG Hello World! nrf52840dk_nrf52840
    
    
    [16:39:48.232]收←◆[00:00:06.294,372] <err> app: LOG_HEXDUMP_ERR Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:06.294,372] <wrn> app: LOG_HEXDUMP_WRN Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:06.294,403] <inf> app: LOG_HEXDUMP_INF Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:06.294,433] <dbg> app: log_test: LOG_HEXDUMP_DBG Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:06.294,464] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:06.294,494] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:06.294,494] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:49.335]收←◆[00:00:06.509,063] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:06.509,094] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:06.509,124] <d
    [16:39:49.375]收←◆bg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:06.509,124] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:07.509,124] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:07.509,155] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:07.509,155] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:50.389]收←◆[00:00:07.563,934] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:07.563,964] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:07.563,964] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:07.563,995] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:08.563,964] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    
    [16:39:50.450]收←◆[00:00:08.563,995] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:08.563,995] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:51.121]收←◆[00:
    [16:39:51.140]收←◆00:08.618,774] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:08.618,804] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:08.618,804] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:08.618,835] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:09.294,525] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:09.294,555] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:09.294,555] <dbg> mpu: region_init: [2] 0x20003e80 0x150b000a
    LOG_PRINTK Hello World! nrf52840dk_nrf52840
    [16:39:51.204]收←◆
    LOG_RAW Hello World! nrf52840dk_nrf52840
    [00:00:09.294,647] <err> app: LOG_ERR Hello World! nrf52840dk_nrf52840
    
    [00:00:09.294,677] <wrn> app: LOG_WRN Hello World! nrf52840dk_nrf52840
    
    [00:00:09.294,738] <inf> app: LOG_INF Hello World! nrf52840dk_nrf52840
    
    [00:00:09.294,769] <dbg> app: log_test: LOG_DBG Hello World! nrf52840dk_nrf52840
    
    [00:00:09.294,799] <err> app: LOG_HEXDUMP_ERR Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:09.294,799] <wrn> app: LOG_HEXDUMP_
    [16:39:51.263]收←◆WRN Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:09.294,830] <inf> app: LOG_HEXDUMP_INF Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:09.294,860] <dbg> app: log_test: LOG_HEXDUMP_DBG Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:09.294,891] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:09.294,921] <dbg> mpu: regi
    [16:39:51.341]收←◆on_allocate_and_init: Program MPU region at index 0x2
    [00:00:09.294,921] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:52.336]收←◆[00:00:09.509,429] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:09.509,460] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:0
    [16:39:52.373]收←◆9.509,490] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:09.509,490] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:10.509,460] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:10.509,490] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:10.509,490] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:53.390]收←◆[00:00:10.564,239] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:10.564,270] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    
    [16:39:53.435]收←◆[00:00:10.564,270] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:10.564,300] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:11.564,270] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:11.564,300] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:11.564,300] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:54.122]收←◆[00:00:11.619,049] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:11.619,049] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:11.619,079] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:11.619,079] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:12.294,952] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:12.294,982] <dbg> mpu: region_allocate_and_init: Program MPU regio
    [16:39:54.188]收←◆n at index 0x2
    [00:00:12.294,982] <dbg> mpu: region_init: [2] 0x20003e80 0x150b000a
    LOG_PRINTK Hello World! nrf52840dk_nrf52840
    LOG_RAW Hello World! nrf52840dk_nrf52840
    [00:00:12.295,074] <err> app: LOG_ERR Hello World! nrf52840dk_nrf52840
    
    [00:00:12.295,104] <wrn> app: LOG_WRN Hello World! nrf52840dk_nrf52840
    
    [00:00:12.295,166] <inf> app: LOG_INF Hello World! nrf52840dk_nrf52840
    
    [00:00:12.295,196] <dbg> app: log_test: LOG_DBG Hello World! nrf52840dk_nrf52840
    
    [00:00:12.295,227] <err> app: LOG_HEXDUMP_ERR Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf
    [16:39:54.253]收←◆916
                                  30                                               |0                
    [00:00:12.295,227] <wrn> app: LOG_HEXDUMP_WRN Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:12.295,257] <inf> app: LOG_HEXDUMP_INF Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:12.295,288] <dbg> app: log_test: LOG_HEXDUMP_DBG Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                 
    [16:39:54.326]收←◆                              |0                
    [00:00:12.295,318] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:12.295,349] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:12.295,349] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:55.335]收←◆[00:00:12.509,857] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:12.509,887] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [16:39:55.373]收←◆
    [00:00:12.509,887] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:12.509,918] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:13.509,887] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:13.509,918] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:13.509,918] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:56.391]收←◆[00:00:13.564,697] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:13.564,727] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:13.564,758] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:13.564,758] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:14.564,727] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:14.564,758] <dbg> mpu: r
    [16:39:56.453]收←◆egion_allocate_and_init: Program MPU region at index 0x2
    [00:00:14.564,758] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    
    [16:39:57.122]收←◆[00:00:14.619,537] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:14.619,567] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:14.619,567] <dbg> mpu: region_init: [2] 0x20003d00 0x150b000a
    [00:00:14.619,598] <dbg> pm: pm_system_suspend: No PM operations done.
    [00:00:15.295,379] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:15.295,410] <dbg> mpu: region_allocat
    [16:39:57.185]收←◆e_and_init: Program MPU region at index 0x2
    [00:00:15.295,410] <dbg> mpu: region_init: [2] 0x20003e80 0x150b000a
    LOG_PRINTK Hello World! nrf52840dk_nrf52840
    LOG_RAW Hello World! nrf52840dk_nrf52840
    [00:00:15.295,501] <err> app: LOG_ERR Hello World! nrf52840dk_nrf52840
    
    [00:00:15.295,532] <wrn> app: LOG_WRN Hello World! nrf52840dk_nrf52840
    
    [00:00:15.295,593] <inf> app: LOG_INF Hello World! nrf52840dk_nrf52840
    
    [00:00:15.295,623] <dbg> app: log_test: LOG_DBG Hello World! nrf52840dk_nrf52840
    
    [00:00:15.295,654] <err> app: LOG_HEXDUMP_ERR Hello World!
    
                                  6e 72 66 39 
    [16:39:57.250]收←◆31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:15.295,654] <wrn> app: LOG_HEXDUMP_WRN Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:15.295,684] <inf> app: LOG_HEXDUMP_INF Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30                                               |0                
    [00:00:15.295,715] <dbg> app: log_test: LOG_HEXDUMP_DBG Hello World!
    
                                  6e 72 66 39 31 36 30 64  6b 5f 6e 72 66 39 31 36 |nrf9160d k_nrf916
                                  30           
    [16:39:57.331]收←◆                                    |0                
    [00:00:15.295,745] <dbg> mpu: mpu_configure_region: Configure MPU region at index 0x2
    [00:00:15.295,776] <dbg> mpu: region_allocate_and_init: Program MPU region at index 0x2
    [00:00:15.295,776] <dbg> mpu: region_init: [2] 0x20003180 0x150b000a
    

    2.But how do I configure prj.conf to turn off the mpu part of the log

    Thank you for all your assistance.
    Kind regards,
    Peter.Min

  • Hi,

    You can set MPU log level through the CONFIG_MPU_LOG_LEVEL_* options, where * is one of DBG, DEFAULT, ERR, INF, OFF or WRN. So for instance CONFIG_MPU_LOG_LEVEL_OFF=y should turn off all logging for MPU.

    Regards,
    Terje

  • Hi tesc,

    Your suggestion is very good

    log printing is ok after the following modification

    CONFIG_MPU_LOG_LEVEL_OFF=y
    #CONFIG_MPU_LOG_LEVEL_ERR=y
    #CONFIG_MPU_LOG_LEVEL_WRN=y
    #CONFIG_MPU_LOG_LEVEL_INF=y
    #CONFIG_MPU_LOG_LEVEL_DBG=y

    CONFIG_KERNEL_LOG_LEVEL_OFF=y
    #CONFIG_KERNEL_LOG_LEVEL_ERR=y
    #CONFIG_KERNEL_LOG_LEVEL_WRN=y
    #CONFIG_KERNEL_LOG_LEVEL_INF=y
    #CONFIG_KERNEL_LOG_LEVEL_DBG=y
    Thank you for all your assistance.
    Kind regards,
    Peter.Min
Related