Hello,
I am encountering a flash overflow issue in MCUboot when enabling external flash over SPI. After configuring SPI memory in the .conf
file and adding external flash support in the .dts
file, the bootloader's memory usage increases. This leads to a compilation error, with the flash memory exceeding the allocated size by 7 kB. Below are the details of my setup.
Environment:
- NCS Version: 2.7.0
- Default MCUboot Size: 48 kB
- Current MCUboot Memory Usage:
- Without external flash (SPI/QSPI): ~43 kB
- With external SPI flash defined (not used, only internal flash utilized in ): Overflow by 7 kB
Configurations and Files:
1. Device Tree (.dts)
2. Partition Manager (pm_static.yml)
3. Application Configuration (prj.conf)
4. MCUboot Configuration (mcuboot.conf)
Problem: Defining external SPI flash in the configuration (even without actively using it for MCUboot) causes the bootloader size to increase by ~9 kB. This results in a compilation error due to flash memory overflow by ~7 kB. I suspect the issue lies in additional driver inclusion or configuration conflicts caused by enabling SPI flash.
Even with configuration of memory layout like below without using external memory for mcuboot, defining external memory over SPI in .dts causes flash overflow:
Questions:
- What could be causing this significant increase in MCUboot memory usage?
- Are there optimization steps or alternative configurations to mitigate this flash memory usage?