This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to enable J-Link RTT Viewer on nRF5340 using the Enhanced shock burst (esb) sample code?

Hi,

I am trying to get my nrf24L01+ to communicate with nrf5340 using the enhanced shock burst sample code. In the sample code there are LOG_INF, LOG_ERR, LOG_DBG commands available? How do I print them out on the console? I would prefer to use the J-LINK RTT Viewer. I have compiled the code for the cpu_net core.

Tank you so much for your help.

Parents
  • Hi Surya,

    Thank you for your prompt reply. Where exactly are they to be enabled? Are these #defines that I need to add in the main.c file? I did that and it still does not work.

    Are there header files I need to add to the sample code to enable logging? Are there other files I need to add to the project that needs to be compiled and  linked? This update of adding #defines seems insufficient.

    To move forwards my first step is to 1st enable logging.  I want to see "Enhanced ShockBurst prx sample" logged on the console as soon as the program starts. This logging info is provided by the sdk itself. Just not sure how to make it work. Please help what other change are needed to get this working..

    Thank you once again for your prompt reply.

  • Hi,

    Surya's answer is correct for the nRF5 SDK, but since you are using the new nRF connect SDK it does not apply in your case.

    To enable RTT you change the configuration in your prj.conf file as shown below. The ESB sample has only logging over UART enabled by default. 

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_LOG=y
    CONFIG_ASSERT=y
    CONFIG_ASSERT_NO_COND_INFO=y
    CONFIG_ASSERT_NO_MSG_INFO=y
    CONFIG_HW_STACK_PROTECTION=y
    CONFIG_USE_SEGGER_RTT=y
    
    CONFIG_ESB=y
    
    

    With this configuration you should get the following output (tested with SDK version 1.7.0)

    Best regards,

    Vidar

Reply
  • Hi,

    Surya's answer is correct for the nRF5 SDK, but since you are using the new nRF connect SDK it does not apply in your case.

    To enable RTT you change the configuration in your prj.conf file as shown below. The ESB sample has only logging over UART enabled by default. 

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_LOG=y
    CONFIG_ASSERT=y
    CONFIG_ASSERT_NO_COND_INFO=y
    CONFIG_ASSERT_NO_MSG_INFO=y
    CONFIG_HW_STACK_PROTECTION=y
    CONFIG_USE_SEGGER_RTT=y
    
    CONFIG_ESB=y
    
    

    With this configuration you should get the following output (tested with SDK version 1.7.0)

    Best regards,

    Vidar

Children
No Data
Related