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

Debug nRF5340 net-core using SES

The nRF5340 net-core examples (e.g., radio_test, hci_rpmsg) work fine with the 'west' build system. However, with SES, download fails with the error similar to below although it compiles successfully. I'd like to debug my net-core code in SES to enable timeslot alongside BLE. How can I debug net-core in SES?

  • Hi Woosuk, 

    What NCS version are you using? Are you using DK or PDK?  If you are using PDK, please be aware that The nRF5340 PDK has been deprecated with the introduction of the production-level nRF5340 DK. See the note that nRF Connect SDK v1.4.0 documentation for the last release supporting the nRF5340 PDK. 

    When you load the radio_test to debug on the net core, you also need to load empty_app_core to the app core. 

    To debug hci_rpmsg in the net core:

    1. Open hci_rpmsg project, Rebuild the project (Build -> Rebuild), connect the target (Target ->Connect J-Link) and load the image (Target -> Download zephyr/merged.hex). 
    2. Open application sample like peripheral_lbs project, Rebuild the project (Build -> Rebuild), connect the target (Target ->Connect J-Link) and load the image (Target -> Download zephyr/merged.hex). 
      1. You should see the "Download successful" in the log. 
      2. If it got Download failed, you should run the following command to recover and download again.  
        nrfjprog --recover --coprocessor CP_NETWORK
        nrfjprog --recover
    3. Start the debug session of the application and it will stop at the entry.

    4. Start the debug session of the hci_rpmsg and it will stop at the entry.

    5. Set a breakpoint at Line.195 in main.c of the peripheral_lbs and start the debug session, and let the debugger run to stop at the breakpoint. 

    6. Run the debugger in the hci_rpmsg, it will stop at Line. 260 in the main.c of the hci_rpmsg. 

    Best regards,

    -Amanda H.

  • nrfjprog --recover --coprocessor CP_NETWORK
    nrfjprog --recover

    The 'recover' command was the key that solves the problem. Now I can debug both the app-core and the net-core in SES.

Related