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

Enabling RTT viewer in nRF52840 ble_app_blinky

Hello,

 

I am using nRF52840, SDK_16.0.0, S140 SoftDevice and Segger 4.16 for flashing the image. I am using ‘ble_app_blinky’.

 

1) Instead of UART, I am trying to enable RTT in ble_app_blinky so that I can see debug prints in RTT. For this I changed below settings.

                NRF_LOG_BACKEND_RTT_ENABLED 1

                NRF_LOG_ENABLED 1

 

                NRF_LOG_BACKEND_UART_ENABLED 0

 

                With below code

 

                NRF_LOG_INFO("\nBlinky example started_NRF_LOG_INFO");

                 printf("\nBlinky example started_printf");

 

                Still I am not able to see debug prints in RTT tool. Any settings to be changed.

a) Whether printf() will and NRF_LOG_INFO(), both are same ?

2) Below are my RTT settings in J-Link. Are they fine.

a) I got pop-up window. Any path to be specified as part of “Script file”.

               

 b) After clicking on OK, in tool I am seeing connection getting established. But still no prints on “Termonal 0”.

3) When I connected I am seeing partial debug prints. I am not sure why is this ?

4) Last try I checked with “RTT” within Segger IDE. There I am able to see debug prints in “RTT” window. But this is not my use case. I want to see debug prints in external RTT tool without any Segger IDE. Please correct me if I am wrong in my understanding.

Thanks & Regards

Vishnu Beema

Parents
  • beemavishnu said:
    What is the difference between NRF_LOG_INFO() and printf(). Whether both will redirect to RTT.

     NRF_LOG_INFO is Nordic' SDK logging library and it uses a backend SEGGER_RTT or UART.  

    beemavishnu said:
    printf("\nBlinky example started_printf");

    If you have set NRF_LOG_ENABLED to 0 in your sdk_config.h file then you can use printf like you did, then you can redirect the log from stdout to uart using redirect.c file. 

    beemavishnu said:
    2) Whether "Debug Terminal" in Segger IDE and RTT viewer are similar ?

    Yes, Segger IDE debug terminal have a capability to capture RTT output. But you must set this in your project settings like below. Then your RTT log output would be captured here in SES IDE

     

    beemavishnu said:
    3) As mentioned in point '4' above, whether can I open both RTT in Segger and external RTT viewer.

    No you cannot do that. I do not see the point in doing that. Why do you want to have two terminals in different IDE to log the same messages? The RTT logs are captured using the debug port, and only one terminal at a time can own this port.

Reply
  • beemavishnu said:
    What is the difference between NRF_LOG_INFO() and printf(). Whether both will redirect to RTT.

     NRF_LOG_INFO is Nordic' SDK logging library and it uses a backend SEGGER_RTT or UART.  

    beemavishnu said:
    printf("\nBlinky example started_printf");

    If you have set NRF_LOG_ENABLED to 0 in your sdk_config.h file then you can use printf like you did, then you can redirect the log from stdout to uart using redirect.c file. 

    beemavishnu said:
    2) Whether "Debug Terminal" in Segger IDE and RTT viewer are similar ?

    Yes, Segger IDE debug terminal have a capability to capture RTT output. But you must set this in your project settings like below. Then your RTT log output would be captured here in SES IDE

     

    beemavishnu said:
    3) As mentioned in point '4' above, whether can I open both RTT in Segger and external RTT viewer.

    No you cannot do that. I do not see the point in doing that. Why do you want to have two terminals in different IDE to log the same messages? The RTT logs are captured using the debug port, and only one terminal at a time can own this port.

Children
No Data
Related