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

multiple images

Hi,

I have 3 images that I need to flash on the device (nrf52840 on the nrf9160DK if it matters). They are a trivial boot manager and two application images. I have read through the partition manager documentation several times and have a basic understanding of what it does, but I can't make the jump to what I need to do. My gray areas:

  1. It seems that I would need to consider probably the bootloader as the "app" and the other two as child images.
  2. I have manually calculated the sizes of all three images and placed them manually on the flash appropriately. This seems to be what the partition manager is supposed to do.
  3. I found the mergehex.py script. Why not just run that as a post-build step?
  4. Since I have defined the image max sizes in the C code, the pm_static.yml looks like it may be the way to go

Can anybody help explain what I need to do? Ideally, a set of sample pm.yml or pm_static.yml files would be ideal.

Thanks,

Mike

Parents Reply Children
  • Hi Mike, 

    Sorry for the delayed answer, I had to get some help from one of our developers in the R&D team. Here are his answers to your questions:

    seems that I would need to consider probably the bootloader as the "app" and the other two as child images.

     You are free to select any of your three images as the "app" (ie the only dynamically sized image).
    In NCS we treat the last boot stage (or stages in the case of TrustZone enabled devices) the app. This because these are the ones that vary the most in terms of code size.

    To make an image the "parent/root" simply use this as your starting point, and then have the other images added through the "add_child_image" function in your CMake. Look at ncs/nrf/samples/CMakeLists.txt for reference.
    I have manually calculated the sizes of all three images and placed them manually on the flash appropriately. This seems to be what the partition manager is supposed to do.

     Only the child images' sizes must be configured. This is done through the pm.yml file located in the sample directory of the child images. Note that the size of the child image is typically configured through the Kconfig of the child image itself in the case of NCS. See ncs/nrf/samples/bootloader/pm.yml . You can, however hard code the sizes directly in your pm.yml if you define those yourself.

    The placement is only relative, either to start, app or end, or the other images. So for your custom images, you might want to say that child image 1 is after start and child image 2 is after child image 1 and so on.
    I found the mergehex.py script. Why not just run that as a post-build step?

     Not quite sure I get your point, but the partition manager automatically merges all the spans as defined in the documentation.

    Since I have defined the image max sizes in the C code, the pm_static.yml looks like it may be the way to go

    pm_static.yml is intended for use when you have deployed a product in which the child images are not being updated (among other use cases). In your case, it should not be necessary. As long as you define the pm.yml for your child images, and set the size and relative placement there, you should be all good.

    Kind regards,
    Øyvind

Related