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

nRF91: questions related to merged image (App , smp & mcuboot)

Hi,

Sorry for putting so many questions in to single thread :)

----

I am looking for information on what all images been integrated to zephyr/merged.hex, can you point to the scripts which does this?

Whenever i choose board = nrf9160_pca10090ns, automatically the smp is been built and merged to zephyr/merged.hex, is there anything else been merged to  the final image?

Can I flash the app and spm separately using jlink?

----

Coming to the sample “http_application_update” there are three images clubbed to merged.hex i.e App + spm + mcuboot, Can you please point to the documentation/scrips which dictates where a particular image needs to be placed?

regards

KK

 

Parents Reply Children
  • You can change the memory allocation of SPM, mcuboot; and application by using the partition manager. You will find the documentation here.

    I gone through the documentation pointed above but it dint explains anything about the memory map of any sample projects, but i learnt something about mcuboot+spm+app for the dts file "~\ncs\zephyr\boards\arm\nrf9160_pca10090\nrf9160_pca10090_common.dts" and other threads

    https://devzone.nordicsemi.com/f/nordic-q-a/52329/what-address-to-manually-flash-zephyr-and-application/216304#216304

    https://devzone.nordicsemi.com/f/nordic-q-a/46787/application-won-t-run---erroneous-flash-address-range

    Do you have any more information other than "The board dint boots up"? Like output log and error messages.

    I have enabled the CONFIG_BOOTLOADER_MCUBOOT=y in my project and then flashing the following three file using JLINK

    1. MCUboot zephyr image     \build_nrf9160_pca10090ns\mcuboot\zephyr\zephyr.hex
    2. SPM zephyr image            \build_nrf9160_pca10090ns\spm\zephyr\zephyr.hex
    3. user app zephyr image     \build_nrf9160_pca10090ns\zephyr\zephyr.hex

    After reset i see the below error message

    *** Booting Zephyr OS build v2.1.99-ncs1-2-g30f47eace36c  ***
    [00:00:00.006,134] [0m<inf> mcuboot: Starting bootloader[0m
    [00:00:00.014,282] [0m<inf> mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3[0m
    [00:00:00.027,557] [0m<inf> mcuboot: Boot source: none[0m
    [00:00:00.034,667] [1;33m<wrn> mcuboot: Failed reading image headers; Image=0[0m
    [00:00:00.044,433] [1;31m<err> mcuboot: Unable to find bootable image[0m

  • Hi , based on the memory layout, 256KB may be insufficient for our application consider future scalability. Can you pl help in modifying the memory layout to get something around 350K-400K for the application

    Sharath

  • You probably need to sign the application image before flashing it. You can sign it with imgtool. I'm testing this right now.

  • One more update. I was able to flash the images separately by running

    nrfjprog -f nrf91 --program mcuboot/zephyr/zephyr.hex --sectorerase
    nrfjprog -f nrf91 --program spm/zephyr/zephyr.hex --sectorerase
    nrfjprog -f nrf91 --program zephyr/mcuboot_primary.hex --sectorerase
    nrfjprog -f nrf91 --program zephyr/zephyr.hex --sectorerase
    nrfjprog -f nrf91 --program zephyr/app_signed.hex --sectorerase

    in this specific order. Then after that the application would boot properly.

  • Image Address Location
    1 0x00000000
    0x00008960 mcuboot/zephyr/zephyr.hex
     
    2 0x00010200
    0x00017ff0 spm/zephyr/zephyr.hex
     
    3 0x00010200
    0x0002a77a zephyr/mcuboot_primary.hex
     
    4 0x0001c200
    0x0002a770 zephyr/zephyr.hex
     
    5 0x00010000
    0x0002a8c0 zephyr/app_signed.hex

    I did some analysis on where the individual images address are mapped in the flash and i found that only 1& 5 images are sufficient for your application to get up and running.

    Image 5 is combination of images 2,3 & 4.

    As per the nrf9160_pca10090_common.dts file the SPM should be places @0x00010000 and user app @0x00040000 but here its starting @0x0001c200, can you help me understand what going on there?

Related