Firmware does not fit this chip
Part of the image is addressed outside the memory this target has, so writing it would leave the chip with an incomplete firmware.
FLASH_IMAGE_DOES_NOT_FIT
Symptoms
- Flashing refuses to start and nothing was written — the chip still runs what it had.
- The same image flashes fine onto a different board with the same family name.
- It started after switching part variants, or after picking a .bin instead of a .hex or .elf.
Likely causes
- The image was built for a variant with more flash. Within one family the suffix carries the size: an STM32F103C8 has 64 KB where an STM32F103CB has 128 KB.
- A .bin carries no addresses of its own, so it is written from the start of flash. If it was built to live at an offset — behind a bootloader — it runs off the end.
- The linker script came from another board and places sections at addresses this chip does not implement.
- The wrong part number is selected, so the memory map being checked against is not this chip’s.
How to fix it
-
Check the part number against the chip
Read the marking on the package and compare it with the target selected in the MCUHex footer, suffix included. The suffix carries the flash size.
-
Check what the build reported
Your linker prints the flash usage at the end of a build. If it already exceeds the chip’s size, the image is the problem, not the tool.
arm-none-eabi-size firmware.elf -
Prefer .hex or .elf over .bin
Both carry their own addresses, so the image lands where it was built to land. A .bin relies on an assumption that is easy to get wrong.
-
Rebuild for this chip
If the image genuinely belongs to a larger variant, rebuild against this part’s linker script rather than trying to place it by hand.