mcuboot icon indicating copy to clipboard operation
mcuboot copied to clipboard

PSoC6: BUG leading to 95MB Image size

Open tomoveu opened this issue 6 months ago • 1 comments

When building MCUboot for PSoC6 with WiFi stack enabled, I get a monstrous image size of 95 MegaBytes 🤯

Error: Image size (0x5fefeaa) + trailer (0x20) exceeds requested size 0x1a7000

I checked the output HEX file is about 2MB in size and the actual firmware size is about 700kB.

The bug feels similar to this MCUBoot bug on Nuttx https://github.com/apache/nuttx/issues/14151 that was solved with these linker changes https://github.com/apache/nuttx/pull/14563

What would be the psoc6 related fix for this bug?

Below is the psoc6 build output

[561/561] Linking, creating elf file build/BOOT/APP_CY8CKIT-062S2-AI/Debug/main_app.elf
/Applications/ModusToolbox/tools_3.4/gcc/bin/arm-none-eabi-objcopy -O ihex /Users/dimitomov/psoc62/MCUboot-Based_Basic_Bootloader/main_app/build/BOOT/APP_CY8CKIT-062S2-AI/Debug/main_app.elf /Users/dimitomov/psoc62/MCUboot-Based_Basic_Bootloader/main_app/build/BOOT/APP_CY8CKIT-062S2-AI/Debug/main_app.hex
cp -f ./build/BOOT/APP_CY8CKIT-062S2-AI/Debug/main_app.hex ./build/BOOT/APP_CY8CKIT-062S2-AI/Debug/main_app_raw.hex; rm -f ./build/BOOT/APP_CY8CKIT-062S2-AI/Debug/main_app.hex; /Applications/ModusToolbox/tools_3.4/gcc/bin/arm-none-eabi-objcopy --change-addresses=0 -O ihex ./build/BOOT/APP_CY8CKIT-062S2-AI/Debug/main_app.elf ./build/BOOT/APP_CY8CKIT-062S2-AI/Debug/main_app_unsigned.hex; ../../mtb_shared/core-make/release-v3.6.1/make/scripts/python3.bash ../../mtb_shared/mcuboot/v1.9.1-cypress/scripts/imgtool.py sign --header-size 0x400 --pad-header --align 8 -M 512 -v 1.0.0 -d "(1,1.0.0)" -S 0x1a7000 -R 0xff --overwrite-only -k ../keys/cypress-test-ec-p256.pem ./build/BOOT/APP_CY8CKIT-062S2-AI/Debug/main_app_unsigned.hex ./build/BOOT/APP_CY8CKIT-062S2-AI/Debug/main_app.hex;
Usage: imgtool.py sign [OPTIONS] INFILE OUTFILE
Try 'imgtool.py sign -h' for help.

Error: Image size (0x5fefeaa) + trailer (0x20) exceeds requested size 0x1a7000
make: *** [_mtb_build__legacy_project_postbuild] Error 2

tomoveu avatar May 22 '25 13:05 tomoveu

Quote @d3zd3z from mcuboot discord (support) channel

I also think Infineon generally uses their own branch, and not mainline.

I have raised Infineon Support Ticket with reference IFX-250522-1715123

tomoveu avatar May 22 '25 20:05 tomoveu