RTT Viewer doesn't show any debug messages from nrf52833.

We use nrf52833 chip but I don't know which SDK and version.

but I used "s113_nrf52_7.2.0_softdevice.hex" in our project having started on 2021.01.27.

So, It's old project starting before.

The problem is as followings:

Our target device is connected with RTT Viewer.

However, RTT Viewer dosen't show any log messages from our target device.

Our project's current configuration for RTT logging are as followings on "sdk_config.h" header file.

1. define belows. 

#define NRF_LOG_ENABLED 1
#define NRF_LOG_BACKEND_RTT_ENABLED 1

2. call on main() function.

NRF_LOG_DEFAULT_BACKENDS_INIT();
Do we have to do more anything for logging on RTT Viewer?
In addition, I attach our "sdk_config.h" file.
Please check it and advice me.
  • We also define below:

    #define NRF_LOG_DEFAULT_LEVEL 4
    More anything for us to do logging?
  • Hi,

    From what I can tell, the configurations in your sdk_config.h file are good.

    I see from your sdk_config.h file that you are also disabling NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED, which is good. Enabling that setting is known to prevent RTT logs from being displayed, at least in the Segger Embedded Studio (SES) debug terminal.

    Please note that all settings in sdk_config.h can be overridden, typically through use of an app_config.h file. Please check to see if you have any such overrides, of any of the configs you have mentioned, or of the one I mentioned above. See the SDK configuration header file documentation for details, and in particular the section Overriding the sdk_config.h configuration.

    For RTT to work, you must have a debugger connected to your board. Please confirm this is what you do, as well as describe what kind of board you use, how you connect it (physically), as well as all steps and any configurations done with RTT Viewer. Also, please share any errors, warnings or log output provided by RTT Viewer.

    For nRF5 SDK based projects, I personally find it the easiest to just start a debug session in SES, for getting the RTT output up and running, as with the RTT Viewer I find it to be slightly more cumbersome to set up. If your project is a SES project, an easy way to check if RTT works from the device point of view is to run a debug session in SES.

    Regards,
    Terje

  • Hi again,

    Please note also, that in SDK examples the log is initiated at the very beginning of main, typically through a call to the following function (also defined in the main.c of each example.)

    /**@brief Function for initializing the nrf log module.
     */
    static void log_init(void)
    {
        ret_code_t err_code = NRF_LOG_INIT(NULL);
        APP_ERROR_CHECK(err_code);
    
        NRF_LOG_DEFAULT_BACKENDS_INIT();
    }

    In other words, you should both initiate logging, and initiate the log backends, as well as check the return value of the former.

    Regards,
    Terje

  • Thanks for your reply.

    I'll response for your check points.

    1. 

    We don't use app_config.h with USE_APP_CONFIG undefined.

    2.

    we use nrf52833 on our target device.

    we have swd connection between our custom target board via j-link debugger.

    3. For RTT to work, I attach the two screen shots. (setting and log on our RTT Viewer)

    -setting:

        

    -log:

    4. Our project is already not a SES project having started on 2021 year.

        So, for the logging from device, we'll use RTT viewer.

     

    5. We already use calling log_init() from our source. our log_init() are as followings:

    void log_init(void) {
      ret_code_t err_code;
    
      lfclk_config();
      err_code = NRF_LOG_INIT(get_rtc_counter);
      APP_ERROR_CHECK(err_code);
    
      NRF_LOG_DEFAULT_BACKENDS_INIT();
    }

    Any checking points?

    Please advice us.

  • Hi,

    Is your application running successfully, except for getting no logging? For an nRF5 SDK application, you typically need both a SoftDevice and the applicaiton, and if you lack the SoftDevice then the application simply will not run. This might be the issue.

    Do you get RTT to work properly with an SDK example, such as e.g. \examples\ble_peripheral\ble_app_hrs when doing the same configuration changes?

    Regards,
    Terje

Related