2020-02-16 04:40 AM
Tools used:
STM32CubeProgrammer 2.3.0.
STM32CubeIDE 1.2.1 for code generation
(gnu-arm-embedded.7-2018-q2-update.win32_1.0.0.201904081647)
I generate some simple STM32CubeIDE C project with default settings.
Build completes, but debugging throws an error during the program+verification phase with "Error: Data mismatch found at address 0x08003001 (byte = 0x18 instead of 0x00)".
Log file attached.
Same when running STM32CubeProgrammer stand-alone.
The two screen shots show the difference between .elf and flash mem at 0x08003000:
The device was completely erased beforehand.
A generated .bin file also shows 00 00 00 00 00 00 00 00 at offset 0x3000.
When I add some dummy code, the file size increases and verification passes and debugging runs without errors as expected.
Solved! Go to Solution.
2020-02-17 02:27 AM
I've had the same problem, worked around it by changing ALIGN(4) to ALIGN(16) at a few places in the linker script.
2020-02-17 02:27 AM
I've had the same problem, worked around it by changing ALIGN(4) to ALIGN(16) at a few places in the linker script.
2020-02-17 01:00 PM
Thanks, berendi.
2020-02-17 03:10 PM
It's good to have a workaround, thanks, berendi.
But it's still a bug, or not?
JW
2020-02-18 02:07 AM
Of course it's still a bug in STM32CubeProgrammer. ST-Link Utility can write a .hex file having the same length and contents without problems.
Apparently STM32CubeProgrammer fails on the STM32F0 series when it tries to write 4 or 8 bytes into a flash page.