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 Vidar,

    I just tried your suggestion. I still cannot seem to get it working. Sorry about that. What am i missing. This is the change to the prj.conf file.

    After making the changes, I imported the project once again to segger embedded studio.

    The main.c file is as per the 1.7.1 sdk. I removed the #defines previously stated in this thread. (Even with adding those #defines it does not log)

    Compiled the file and have downloaded it to nrf5340-DK. Disconnected the RTT viewer and enabled it again. Pressed the reset button to restart the code.

    I do not see any logging.

  • Hi,

    Pressed the reset button to restart the code.

    The problem with this is that a pinreset will cause the debugger to loose connection with your device so you will have to manually re-connect afterwards. UART is better in that regard. You also need to remove the CONFIG_NCS_SAMPLES_DEFAULTS setting as it selects CONFIG_LOG_MINIMAL that doesn't support the RTT backend.

    To make debugging this easier, you could consider adding a loop like the one below at end of your main function  to make the app print something periodically and not just on startup.

    for (;;) {
        LOG_INF("main loop");
        k_sleep(K_MSEC(500));
    }

Reply
  • Hi,

    Pressed the reset button to restart the code.

    The problem with this is that a pinreset will cause the debugger to loose connection with your device so you will have to manually re-connect afterwards. UART is better in that regard. You also need to remove the CONFIG_NCS_SAMPLES_DEFAULTS setting as it selects CONFIG_LOG_MINIMAL that doesn't support the RTT backend.

    To make debugging this easier, you could consider adding a loop like the one below at end of your main function  to make the app print something periodically and not just on startup.

    for (;;) {
        LOG_INF("main loop");
        k_sleep(K_MSEC(500));
    }

Children
  • I have tried to verify the code.

    It appears nothing is downloaded to the the network core's flash. Is the core locked? How do I unlock it? When I compile and download It keeps saying successfully  downloaded, not sure what is it successfully downloading if the verification fails.

    Any comment on what all this is? I literally just need a console log out put. Seems like there are other issues that need to be addressed here :( .

  • Hi Vidar,

    I tried following the process using the command line tool. I am able to build using the command line tools. But unable to flash.

    So I used the nrf connect GUI tool:

    But still, I see no logging.

    Can you tell me what tools, setup and configuration, O.S you used to get the logging enabled. May be if I can replicate it exactly, I may be successful.

  • Hi, 

    Please run the commands from cmd.exe instead. I see from the log that west is not invoking the python interpreter located in the SDKs toolchain directory indicating that the PATH was not updated correctly. Also, the file you want to program is merged_domains.hex as it includes the empty app core image needed for the Application processor. Zephyr.hex contains the esb application.

    I have the SDK installed via the toolchain manager and I’m running windows 10. Hope this helps.

  • PERFECT!!! IT Worked! Yahoooo...

    .

Related