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

which .hex cpunet or cpuapp to load for blue nrf5340

Hi,
I would like to test sample bluetooth code ( ex: central)  with nrf5340 dk,
what's the difference between central for cpuapp and cpunet ?

which one i have to load , cpunet or cpuapp or both to work?

thank's

Parents
  • Hi,

    The nRF5340 DK has to processors, a network core (cpunet) and an application core (cpuapp), so the difference is the type of core. The network core is used for radio communication, and should be used for real-time processing tasks involving low-level radio protocol layers, while the application core should be used for tasks that require high performance and for application-level logic. 

    which one i have to load , cpunet or cpuapp or both to work?

     This depends on which sample you want to use. For some samples you only need to program the application core (such as NCS samples or other samples that does not use radio), while for others you must program both the network and the application core. You must always program the application core, even if the firmware is supposed to only run on the network core, as the application core is responsible for starting the network core and connecting its GPIO pins. 

    If you look at the documentation for the Bluetooth Central samples in NCS, you will see that the build target is always nrf5340dk_nrf5340_cpuapp or nrf5340dk_nrf5340_cpuappns. This is because the application itself should run on the application core, since as I mentioned above, the application core should be used for application-level logic. However, these samples uses Bluetooth Low Energy, so you must program the Bluetooth: HCI RPMsg sample to the network core in order to run BLE samples on nRF5340.

    When programming both cores, you have two options for how to do this. You can either build and program both images separately, or you can do it combined as a multi-image build. For the latter, you must explicitly add the network core image as a child image to one of the application core images. 

    I strongly recommend reading the working with nRF53 Series guide before starting, specifically building and programming a sample to get a clearer picture of what to do when you have two cores. Programming network samples are not as straightforward, so you should follow the guide and see how this is done when doing it yourself.

    I hope this answers your questions!

    Best regards,

    Marte

  • thank you for your answer, it's very usefull,

    I have other question, , how i can configure project to generate .hex not elf to programme twice projects  for netcore & appcore with nrf connect programmer  ?

    thank you,

    Best regards

Reply Children
  • Hi,

    The file zephyr.elf is for single-image applications, so if you are building a multi-image application, you should get the file merged.hex by default. If you are building a single-image application, you can get a zephyr.hex file by selecting "Build Solution" instead of "Build zephyr/zephyr.elf" in SES (Segger Embedded Studio). This will generate both an .elf and a .hex file. If you are using west to build on the command line, then you should get the same as when selecting build solution. You can use this zephyr.hex file in nRF Connect Programmer.

    Best regards,

    Marte

Related