Problem with V2.16.0 and STM32G0B0, Erasing Too Many Sectors
STM32CubeProgrammer version 2.16.0
Target STM32G0B0RET6, device ID 0x467, Rev Z, 512KB flash, bootloader 0xD0
When loading a large bin file (425kB), the programmer tries to erase 65364 sectors! There's only 256 sectors in target, and the image only needs 212 sectors erased.
When using an ST-Link SWD interface it gets past this (albeit erasing entire flash) and programs the flash OK, but when using USB it just locks up.
It doesn't happen with smaller files that will fit in bank 1, just larger files that require 2 banks.
If I do a full chip erase first, then tick "skip flash erase before prog" then it avoids this problem. However I need to preserve config data at top of flash, so this is not a good workaround.
I think it's a similar problem to this post so I replied to that, then thought I should start a separate thread.
Here's some basic logs in case it helps. Via ST-Link:-
15:32:16 : File : wf3835-tank-combined.bin
15:32:16 : Size : 425.17 KB
15:32:16 : Address : 0x08000000
15:32:16 : Erasing memory corresponding to segment 0:
15:32:16 : Erasing internal memory sectors [0 65364]
15:32:20 : Download in Progress:
15:32:25 : File download complete
Via USB:-
12:14:06 : File : wf3835-tank-combined.bin
12:14:06 : Size : 425.17 KB
12:14:06 : Address : 0x08000000
12:14:06 : Erasing memory corresponding to segment 0:
12:14:06 : Erasing internal memory sectors [0 65364]
12:14:06 : erasing sector 0000 @: 0x08000000 done
...
12:14:12 : erasing sector 0255 @: 0x0807f800 done
12:14:12 : sector 0256 does not exist
etc until it locks up
Happy to post more info, logs etc, here, just ask. I can send you the bin file privately, pm me
Many thanks, Ben
