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

SDK 14.2.0 and NRF_LOG_DEFERRED 0

Hi,
it's my first post in this forum, and I glad to join to Nordic Community.

After few month of developing project on Nordic MCU, I try to migrate form SDK 12.2.0 to SDK 14.2.0. (S132, SES, Windows 10 Pro, nRF52 DK)
I decided to do it step by step, according to the migration guides (12.2.0 to 13.0.0 and then 13.0.0 to 14.2.0).

After first step (SDK 13.0.0) my application work. But on 14.2.0, when i set NRF_LOG_DEFERRED to 0, my application, after several second, get reset, logging faster (RTT) than normal and I'm not able to connect to device via BLE.

I noticed difference in file nrf_log_control_internal.h between SDK 14.2.0 and 13.0.0. In 13.0.0 and 12.2.0 when:

#if NRF_LOG_DEFERRED == 0
#define NRF_LOG_INTERNAL_PROCESS() false

I added similar condition to 14.2.0 in file nrf_log_ctrl.h

replaced line 101:

#define NRF_LOG_PROCESS()    NRF_LOG_INTERNAL_PROCESS()

to:

#if (NRF_LOG_DEFERRED == 0)
#define NRF_LOG_PROCESS() false
#else
#define NRF_LOG_PROCESS()    NRF_LOG_INTERNAL_PROCESS()
#endif

problem disappear/"is resolved".

My questions:

  1. Is there any reason not to do my modification?
  2. Why do non-deferred log in my app work with 12.0.0, but with 14.2.0 not?
  3. Why must non-deferred log to be processed by nrf_log_frontend_dequeue() when i want to use SDK 14.2.0?
  4. Or did i miss something during migration?

BTW. I think, my problem is similar to https://devzone.nordicsemi.com/f/nordic-q-a/35527/hang-in-logger-frontend

During debug of broken app, rd_idx is bigger than wr_idx, and it is not good. Is it possible, that I want log to much?

Parents
  • Hi,

    I'm not sure I understand what you are trying to do. Do you still call NRF_LOG_PROCESS() even with NRF_LOG_DEFERRED set to 0? I would expect rd_idx and wr_idx to always be zero when you get to the processing call, as the logs should be processed before proceeding (blocking logging). In general, I would recommend using deferred logging, to avoid spending more time than necessary in IRQ handler etc.

    Note that logger module is experimental in SDK 14.2.0. I would recommend migrating to SDK 15.2.0.

    Best regards,
    Jørgen

Reply
  • Hi,

    I'm not sure I understand what you are trying to do. Do you still call NRF_LOG_PROCESS() even with NRF_LOG_DEFERRED set to 0? I would expect rd_idx and wr_idx to always be zero when you get to the processing call, as the logs should be processed before proceeding (blocking logging). In general, I would recommend using deferred logging, to avoid spending more time than necessary in IRQ handler etc.

    Note that logger module is experimental in SDK 14.2.0. I would recommend migrating to SDK 15.2.0.

    Best regards,
    Jørgen

Children
Related