cancel
Showing results for 
Search instead for 
Did you mean: 

[BUG] STM32CubeProgrammer "Error: Download verification failed" only for some specific file size.

KnarfB
Principal III

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:

0690X00000DBQg7QAH.png

0690X00000DBQg2QAH.png

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.

1 ACCEPTED SOLUTION

Accepted Solutions
berendi
Principal
4 REPLIES 4
berendi
Principal

I've had the same problem, worked around it by changing ALIGN(4) to ALIGN(16) at a few places in the linker script.

https://community.st.com/s/question/0D50X0000BcRdMKSQ0/flashing-stm32f0-fails-in-cubeide-when-the-firmware-has-a-certain-length-0x1c04-or-0x1c08-bytes

KnarfB
Principal III

Thanks, berendi.

It's good to have a workaround, thanks, berendi.

But it's still a bug, or not?

JW

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.