2019-10-03 03:13 PM
Anybody have a solution to this?
STM32CubeProgrammer fails to re-program Bank 2 of STM32L476RC devices (256 kB FLASH), unless the device is blank (ie: after a Mass Erase). I suspect this has to do with the sector number jumping from 63 to 256 when the flash bank jumps from 1 to 2.
0x0801F800-0x0801FFFF Page 63
0x08020000-0x080207FF Page 256
ref: RM0351 Rev 6, p. 99
I have tested this on STM32CubeProgrammer v1.3.0 (bundled with Atollic TrueSTUDIO), v2.0.0 (standalone), and v2.1.0 (standalone and bundled with STM32CubeIDE v1.0.2) and they all exhibit the same behaviour.
ST-LINK Utility v4.5.0.0 does NOT have this problem.
STM32L476RG (full 1MB parts) also do NOT have this problem.
Here is an example of what you might see from STM32CubeIDE or TrueSTUDIO.
Note the last sector is >63, and the "Error: failed to download Segment[0]".
--
Erasing internal memory sectors [0 66]
Download in Progress:
Error: failed to download Segment[0]
Error: failed to download the File
--
I have attached:
One potential workaround is to Mass Erase the device before programming, but of course this is not practical with more complex linker scripts (bootloaders, sections of flash used to store non-volatile constants, etc).