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

NCS/Zephyr/MCUBoot - Image too large for flash region

Hi,

I've recently updated to the latest NCS repo. I'm not entirely sure what version of NCS i was on before (perhaps if you could tell me how to check - as i made a copy of that entire directory before updating), but I was on Zephyr 2.3.0 and I'm now on 2.3.99.

When building my image before, the image was too big for the flash region, but I was able to change MCUBoot's prj.conf to include: CONFIG_BOOT_SWAP_USING_MOVE=y. This then allowed my image to fit in because there was no swap partition. This was the rom_report for my image on the previous version:

[2/2] Running utility command for rom_report
Partition Manager report
FLASH (0x80000):
+-----------------------------------------+
| 0x0: mcuboot (0x98f0) |
| 0x98f0: EMPTY_0 (0x710) |
+---0xa000: mcuboot_primary (0x29000)-----+
| 0xa000: mcuboot_pad (0x200) |
+---0xa200: mcuboot_primary_app (0x28e00)-+
| 0xa200: app (0x28e00) |
| 0x33000: mcuboot_scratch (0x1e000) |
| 0x51000: mcuboot_secondary (0x29000) |
| 0x7a000: littlefs_storage (0x6000) |
+-----------------------------------------+


After upgrading and building the same project, I now get the following error:

Memory region         Used Size  Region Size  %age Used

           FLASH:      270804 B     212480 B    127.45%

            SRAM:       50696 B        64 KB     77.36%

        IDT_LIST:         216 B         2 KB     10.55/home/chris/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/../../../../arm-zephyr-eabi/bin/ld: zephyr/zephyr_prebuilt.elf section `text' will not fit in region `FLASH'

/home/chris/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/../../../../arm-zephyr-eabi/bin/ld: region `FLASH' overflowed by 58324 bytes

Could you please tell me what I can do to make this work like on the old version?

Parents
  • it seems like the amount of space allowed for the entire flash region has shrunk after I've upgraded. This is the build output on the older version of NCS:

    Memory region         Used Size  Region Size  %age Used

               FLASH:      203836 B     224768 B     90.69%

                SRAM:       38232 B        64 KB     58.34%

            IDT_LIST:         200 B         2 KB      9.77%

    Notice the region size - the builds fine. The region size on my original post (later version) is 212480, lower than above. Not sure how I've lost this allocated space? 
    I have checked, and MCUBoot has increased in size by 2kb from the older version. This doesn't explain the difference in region size though...

  • Hi,

    It's the Partition Manager that handles the flash partitions. By default, the Partition Manager dynamically places the partitions in memory. See the documentation for the Partition Manager here.

    Not sure how I've lost this allocated space? 

    Take a look at the Partition Manager yml and config files in your build folder to see how the space is allocated.

Reply Children
No Data
Related