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

Unable to flash nRF5340-PDK net core

Hi,

I'm trying to flash my network kernel code to the nRF5340-PDK network core over JTAG. It's a custom research OS called Tock that you can look at here. The code is fairly simple and only attempts to turn on an LED, but it does not appear to run properly. The code that I am attempting to flash to the network core can be found here.

I'm flashing the network kernel to address 0x1000000, I have made sure to enable the network core and assign the GPIO pins I'm using to the network core from the application core, and the application core runs fine. Any ideas as to what I should look into next?

Thanks

Parents Reply Children
  • Ah thanks, that handled it. I tried flashing the empty app core firmware along with the zephyr blinky sample firmware for the net core, which worked. However, my net core firmware didn't work with the empty app core firmware. Seems like this suggests the issue is with my network firmware? I'll try comparing my code against the blinky sample.

  • Yes, that would be my assumption. Do you have any debug-tools in the OS framework you are using, that you could use to check if the code on the network core is running correctly? If not, you can also use Segger Ozone for this purpose. Load the .ELF file into Ozone and run it on the cpunet-core.

  • Hey, sorry for the late response. I'm trying to flash my network image again so that I can take a look at it with Ozone, but it seems that I'm not able to able to overwrite the Zephyr blinky example that I flashed previously. I've tried running `nrfjprog --recover` and erasing the network core with JLinkExe, but neither seem to work. Admittedly, I'm not familiar with any of these tools, so I'm not sure if I'm doing that correctly.

    Additionally, I'm not sure if I'm even flashing my own network image properly using my project's own flashing tool. Is there a way I can try flashing my own bin or elf file to the network core using west or some other better supported tool?

    Thanks again

  • You need to use the --coprocessor argument when flashing/erasing/recovering the network core:

    nrfjprog --recover --coprocessor CP_NETWORK

    As you can see from this snippet, writing memory or running the recover argument does not affect the flash area in the network core when the CP_NETWORK coprocessor is chosen:

    >nrfjprog --memwr 0x01001000 --val 0x00000000
    Parsing parameters.
    Writing.
    
    >nrfjprog --memrd 0x01001000 --coprocessor CP_NETWORK
    0x01001000: FFFFFFFF                              |....|
    
    >nrfjprog --memwr 0x01001000 --val 0x00000000 --coprocessor CP_NETWORK
    Parsing parameters.
    Writing.
    
    >nrfjprog --memrd 0x01001000 --coprocessor CP_NETWORK
    0x01001000: 00000000                              |....|
    
    >nrfjprog --recover
    Recovering device. This operation might take 30s.
    Writing image to disable ap protect.
    Erasing user code and UICR flash areas.
    
    >nrfjprog --memrd 0x01001000 --coprocessor CP_NETWORK
    0x01001000: 00000000                              |....|
    
    >nrfjprog --recover --coprocessor CP_NETWORK
    Recovering device. This operation might take 30s.
    Writing image to disable ap protect.
    Erasing user code and UICR flash areas.
    
    >nrfjprog --memrd 0x01001000 --coprocessor CP_NETWORK
    0x01001000: FFFFFFFF                              |....|

    nrfjprog only supports hex-files, but if you can make your build system output a hex-file, or convert it from the .bin/.elf file, you should be able to flash it using nrfjprog.

  • Hey Jørgen, thanks for all of the help. I finally got the network core flashed and booting properly, it turns out that I had also included the errata fixes for the application core in the network core image on accident, oops.

Related