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

nRF5340 debug network core

Hi,

I'm seeking help on debugging the network core with Visual Studio Code. My project is not based on a standard SDK and hence I think VS code will be easier to setup than Segger IDE. The project builds for nRF52840 and nRF5340 with makefiles.

I use the Cortex-Debug plugin and have created a launch.json file. This works perfectly for the nRF52840 which only use a single core, but I would like to use the nRF5340 instead.

I'm able to debug the app core on the nRF5340 without any problems, but I can't find a way to debug the network core.

My application is only running in the network core and hence the app core image is based on the "empty app core project" which just starts the network core and suspends afterwards.

I'm only interestered in debugging the network core if that makes things easier. 

I have tried the following "start debug sequence" without any success.

1) Recover device to remove app protection

2) Build, flash and reset app core

3) Build network core

4) Flash and start debugging of network core.

When I start the debug session I get the following: Launching server: "JLinkGDBServerCL.exe" "-if" "swd" "-port" "50000" "-swoport" "50001" "-telnetport" "50002" "-device" "nRF5340_xxAA_NET" but i am not able to start debugging. I have attached my launch.json config below

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Cortex Debug",
            "cwd": "${workspaceRoot}",
            "preLaunchTask": "build",
            "executable": "light.elf",
            "request": "launch",
            "type": "cortex-debug",
            "servertype": "jlink",
            "device": "nRF5340_xxAA_NET",
            "interface": "swd",
            "runToMain": true,
        }
    ]
}
   

Parents
  • Hi

    I'm sorry, but it's taking some time to get to the bottom of this issue. One possible problem is that resetting the network core also resets the app core, which in turn shuts off the network core, only letting you come back once the app core has booted. If the time from startup to NET core enable is too long, you also might have some issues with the debugger timing out/detecting that the NET core is disabled.

    In order to get it to debug from start it might be necessary to move the network core startup point earlier in the Zephyr boot process. 

    Best regards,

    Simon

Reply
  • Hi

    I'm sorry, but it's taking some time to get to the bottom of this issue. One possible problem is that resetting the network core also resets the app core, which in turn shuts off the network core, only letting you come back once the app core has booted. If the time from startup to NET core enable is too long, you also might have some issues with the debugger timing out/detecting that the NET core is disabled.

    In order to get it to debug from start it might be necessary to move the network core startup point earlier in the Zephyr boot process. 

    Best regards,

    Simon

Children
Related