Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

May I ask, what's the change of nrf_log in sdk 15.3?

Hi,

I am migrating sdk 15.2 to 15.3. Everything works fine, except the nrf logging. Currently, I am using RTT configuration, with default backend enabled. The code is simple:

// Initialize SDK Logger.

APP_ERROR_CHECK(NRF_LOG_INIT(app_timer_cnt_get));

NRF_LOG_DEFAULT_BACKENDS_INIT();

Things odd is that: the log is dumped in a quite slow speed. It acts like, the logging buffer stored in rnf52840 chip. Without event triggered, they are not dumped into RTT viewer. That is to say, the log is dumped in a very deferred way. The latest logs are always not shown in RTT viewer.

BTW, other code is the same, with usbd enabled and also BLE. The functional thing works fine.

The same code works well under sdk 15.2, with the logging is dumped immediately. 

environment:

j-link 6.40

win7

sdk15.3

Since I can not find a way to debug it, would you please give me some suggestions on this? A list of the nrf_log changes in sdk 15.3 would be fine. I attached my sdk_config.h

Thanks

sdk_config.h

Parents Reply Children
  • Hi Awneil,

    Thanks for your reply.  My loop code is as follows. Should not have that issue. Also, please see me comment:

    "By investigation, I found SEGGER_RTT_WriteNoLock() is correctly called during the idle task. So it is a problem of fetching log by pc side? I did not dig into the logging module(the logging is only for debugging in my case). Would you please give me some tips on how the log can be fetched by pc? So that I can do more work."

    I set a breakpoint in NRF_LOG_PROCESS() and debug it step by step and found SEGGER_RTT_WriteNoLock() is correctly called with the latest log. However, the RTT viewer didn't show. Would you please let me know how I debug it further? 

    Thanks,

    Vincent

    static void idle_task(void *p_context)
    {
        // Enter main loop.
        for (;;)
        {
    
    				while (app_usbd_event_queue_process())
    				{
    						/* Nothing to do */
    				}
            /* Handle background and debug events one by one, go to sleep when done. */
            do
            {
    
            }
            while (NRF_LOG_PROCESS());
    
    
            if (run_power_saving) 
            {
                mgmt_run();
            }
    #
        }
    }

Related