This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can I view NRF_LOG_DEBUG logging in keil without an actual uart port? How?

Hello:

I have been trying to figure out the proper app ram address base by calling sd_ble_enable.

I am using keil's debug mode, and when the program hit the breakpoint I set at:

err_code = sd_ble_enable(&app_ram_base);

I press F10, move my mouse over to &app_ram_base, in hoping that I will get the updated value.

No, not really. Instead I get the old value. Even if the return error code is 0 (NRF_SUCCESS).

So now I'm thinking maybe I looked at the wrong direction, maybe this is not how it's done. Maybe I should use keil's UART window, or Debug(printf) viewer, or trace window etc to get the job done.

So I keep hearing this logging thing that is available since sdk 12. And I'm here asking:

  1. Is obtaining that base address value possible in this way (using keil only, my custom board does not have uart pin out, sadly, my bad)
  2. How do I do it?

This is what I tried:

in sdk_config.h, I changed:

#define CLOCK_CONFIG_LOG_ENABLED 0

to

#define CLOCK_CONFIG_LOG_ENABLED 1

and

#define CLOCK_CONFIG_LOG_LEVEL 3

to

#define CLOCK_CONFIG_LOG_LEVEL 4

And nothing really happened. All the windows I mentioned above were blank.

Can someone please help me? Thanks in advance.

Parents
  • Hi,

    If you do not have UART pin output from your board, you cannot use logging over UART. You can use RTT for logging if using a J-Link programmer. NRF_LOG support RTT as the backend for logging, you can enable this by setting the following in sdk_config.h:

    #define NRF_LOG_ENABLED 1
    #define NRF_LOG_BACKEND_SERIAL_USES_UART 0
    #define NRF_LOG_BACKEND_SERIAL_USES_RTT 1
    

    Note that if NRF_LOG_DEFERRED is set, you need to call NRF_LOG_PROCESS() or NRF_LOG_FLUSH() to process the log queue.

    You can view the output from the RTT using J-Link RTT viewer.

    Best regards,

    Jørgen

  • Hello Jørgen, a few more questions:

    • Do I have to add addtional files from segger co, ltd in order to use it? Includes and .c source codes?

    • What do you mean by "Note that if NRF_LOG_DEFERRED is set, you need to call NRF_LOG_PROCESS() or NRF_LOG_FLUSH() to process the log queue.“? It was set by default. Can I disable it to reduce the amount of hassle?

    If I can't, do I have to call the 2 functions every time I want to view the log?

Reply
  • Hello Jørgen, a few more questions:

    • Do I have to add addtional files from segger co, ltd in order to use it? Includes and .c source codes?

    • What do you mean by "Note that if NRF_LOG_DEFERRED is set, you need to call NRF_LOG_PROCESS() or NRF_LOG_FLUSH() to process the log queue.“? It was set by default. Can I disable it to reduce the amount of hassle?

    If I can't, do I have to call the 2 functions every time I want to view the log?

Children
No Data
Related