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

NCS-Zephyr - West flashes zephyr.bin instead of merged hex

I am using NCS-Zephyr, Zephyr version 2.3.0-rc1. If you need to know the NCS version too, please can you include how I can find this?

When I do west flash normally (which uses the nrfjprog runner), it properly flashes my device with the correct merged_nrf52dk_nrf52832.hex. When I use the J-link runner, by doing  west -v flash --erase --runner jlink it flashes zephyr.bin and does not boot properly or even run my code. It needs to flash the merged hex like nrfjprog. Do you know how I can fix this? 

I asked in the Zephyr slack and one of the developers of West said that NCS is overriding the flash file and causing it to flex the zephyr.bin instead.

Parents
  • Could you also tell me the address that the merged.hex should be flashed to in the J-Link runner? I have this currently (and it seems to work):

    loadfile /home/pi/flash/merged_nrf52dk_nrf52832.hex 0xc000

    I don't know enough about what the merged hex actually is, but I thought it was a combination of the bootloader and my images and child-images, so should i specify 0x000 instead?

     

  • I am using NCS-Zephyr, Zephyr version 2.3.0-rc1. If you need to know the NCS version too, please can you include how I can find this?

     Do the following in a terminal to figure out what version of NCS (nrf) you are using:

    cd <installation folder>ncs/nrf
    git status
    
    // I get this when running the above. And in my case I'm on NCS v1.3.0
    //  $ git status
    //  HEAD detached at v1.3.0
    //  ...

     

    When I do west flash normally (which uses the nrfjprog runner), it properly flashes my device with the correct merged_nrf52dk_nrf52832.hex. When I use the J-link runner, by doing  west -v flash --erase --runner jlink it flashes zephyr.bin and does not boot properly or even run my code. It needs to flash the merged hex like nrfjprog. Do you know how I can fix this? 

     Could you try to run the following (you may have to install the nRF Command Line Tools, which includes nrfjprog):

    cd <application folder>/build/zephyr
    nrfjprog --program merged.hex --sectorerase

    If your application/sample don't contain any child images, use zephyr.hex instead.

    By the way, how did you generate a hex file on the form merged_<board>.hex? I'm not seeing it when I build using NCS v1.3.0. What sample do you use? I am not sure if there are any difference between this file and the merged.hex file.

     

    Christian Holland said:
    I don't know enough about what the merged hex actually is, but I thought it was a combination of the bootloader and my images and child-images, so should i specify 0x000 instead?

    The merged.hex file should always get programmed onto location 0x00, since it contains all the images. When the chip boots up, it will start running at adress 0x00. The nrfjprog command above should program it to this location automatically.

    some additional information: If your aplication only contains the main application itself (no spm or mcuboot), the application starts at 0x00. If the application contains an SPM, the SPM is located on address 0x00. If the application contains mcuboot and spm, the mcuboot is located first on address 0x00.

    You could check out the Programmer app in nRF Connect for Desktop, which gives a nice visual overview of how the different images are placed in flash.

    Best regards,

    Simon

Reply
  • I am using NCS-Zephyr, Zephyr version 2.3.0-rc1. If you need to know the NCS version too, please can you include how I can find this?

     Do the following in a terminal to figure out what version of NCS (nrf) you are using:

    cd <installation folder>ncs/nrf
    git status
    
    // I get this when running the above. And in my case I'm on NCS v1.3.0
    //  $ git status
    //  HEAD detached at v1.3.0
    //  ...

     

    When I do west flash normally (which uses the nrfjprog runner), it properly flashes my device with the correct merged_nrf52dk_nrf52832.hex. When I use the J-link runner, by doing  west -v flash --erase --runner jlink it flashes zephyr.bin and does not boot properly or even run my code. It needs to flash the merged hex like nrfjprog. Do you know how I can fix this? 

     Could you try to run the following (you may have to install the nRF Command Line Tools, which includes nrfjprog):

    cd <application folder>/build/zephyr
    nrfjprog --program merged.hex --sectorerase

    If your application/sample don't contain any child images, use zephyr.hex instead.

    By the way, how did you generate a hex file on the form merged_<board>.hex? I'm not seeing it when I build using NCS v1.3.0. What sample do you use? I am not sure if there are any difference between this file and the merged.hex file.

     

    Christian Holland said:
    I don't know enough about what the merged hex actually is, but I thought it was a combination of the bootloader and my images and child-images, so should i specify 0x000 instead?

    The merged.hex file should always get programmed onto location 0x00, since it contains all the images. When the chip boots up, it will start running at adress 0x00. The nrfjprog command above should program it to this location automatically.

    some additional information: If your aplication only contains the main application itself (no spm or mcuboot), the application starts at 0x00. If the application contains an SPM, the SPM is located on address 0x00. If the application contains mcuboot and spm, the mcuboot is located first on address 0x00.

    You could check out the Programmer app in nRF Connect for Desktop, which gives a nice visual overview of how the different images are placed in flash.

    Best regards,

    Simon

Children
No Data
Related