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
  • Okay, looks like your network application isn't correctly handling the hardened AP protection then. After programming your application, could you check the value of NET_UICR->APPROTECT? This should be 0x01FF8000. This value will be used by the systeminit code to set up ap protection unless ENABLE_APPROTECT or ENABLE_APPROTECT_USER_HANDLING c macros are set.

    Best regards,

    Simon

Reply
  • Okay, looks like your network application isn't correctly handling the hardened AP protection then. After programming your application, could you check the value of NET_UICR->APPROTECT? This should be 0x01FF8000. This value will be used by the systeminit code to set up ap protection unless ENABLE_APPROTECT or ENABLE_APPROTECT_USER_HANDLING c macros are set.

    Best regards,

    Simon

Children
Related