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));
    }

  • Thank you for your reply.

    I think there is a deeper issue at play here.

    After the program is downloaded successfully, it says:

    Illegal value 0x21001450 written to register 66 (MSP_NS) ignored

    Is this something got to do with why the program/ console logs are not working?

    Yes, I added the for loop to print a msg. I still see nothing. I removed CONFIG_NCS_SAMPLES_DEFAULTS as well, and no logs seem to appear.

Reply Children
  • I see the same now when I try to use Segger Embedded Studio and I need more time to investigate. Are you able to work with the VS code extension or from the command line in the meantime?

    Building from the command line:

    // Update PATH to include the SDK build tools
    c:\Users\<user>\ncs\v1.7.0>toolchain\cmd\env.cmd
    
    // Change directory to sample folder
    c:\Users\<user>\ncs\v1.7.0>cd nrf\samples\esb\prx
    
    // Build command. Includes "empty app core" as a child image
    c:\Users\<user>\ncs\v1.7.0\nrf\samples\esb\prx>west build -b nrf5340dk_nrf5340_cpunet -- -DCONFIG_NCS_SAMPLE_EMPTY_APP_CORE_CHILD_IMAGE=y
    
    // Run recovery procedure, then flash both cores
    c:\Users\<user>\ncs\v1.7.0\nrf\samples\esb\prx>west flash --recover

Related