2025-07-31 1:36 AM - edited 2025-07-31 1:47 AM
Hello, I have the same problem but with the new version STM32CubeIDE_1.19.0. All the symptoms are the same as in this post but in the STM32G473RB processor and when the firmware becomes more than 64KB.
Cube programmer normally writes the .elf taken from the project
10:46:40 : Data read successfully
10:46:40 : Time elapsed during the read operation is: 00:00:00.007
10:46:44 : External loader sector number is too big, displaying only the first 4000 sectors
10:47:12 : Memory Programming ...
10:47:12 : Opening and parsing file: bms_g474.elf
10:47:12 : File : bms_g474.elf
10:47:12 : Size : 64.05 KB
10:47:12 : Address : 0x08000000
10:47:12 : Erasing memory corresponding to segment 0:
10:47:12 : Erasing internal memory sectors [0 65280]
10:47:13 : Download in Progress:
10:47:14 : File download complete
10:47:14 : Time elapsed during download operation: 00:00:01.891
10:47:14 : Verifying ...
10:47:14 : Read progress:
10:47:14 : Download verified successfully
10:47:14 : RUNNING Program ...
10:47:14 : Address: : 0x08000000
10:47:14 : Application is running, Please Hold on...
10:47:14 : Start operation achieved successfully
2025-07-31 1:57 AM - edited 2025-07-31 5:15 AM
I managed to get around this bug in the following ways, but it does not solve the root of the problem:
1) I enable this checkbox:
after that the IDE writes only those sectors to Flash that have been changed
2) Every time after generating a new elf file, you need to flash it through the
STM32CubeProgrammer utility
3) Run Debug directly in STM32CubeIDE 1.19.0
Since the latest version of the code is flashed, STM32CubeIDE will see this and will only run debug.
4) do this every time something has been changed in the code
Otherwise, if we try to run debug with the flag [Incremental flash
programming (experimental)] is enabled, without prior firmware via STM32CubeProgrammer, we get this: