cancel
Showing results for 
Search instead for 
Did you mean: 

Bug Report: STM32CubeProgrammer fails to program bank 2 of smaller dual bank STM32L4 devices

Dan Hepler
Associate III

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:

  • SampleSREC.zip which contains two SREC files you can alternately download with STM32CubeProgrammer. They have different data to ensure that the flash is actually written.
  • Success.log and Fail.log saved from STM32CubeProgrammer showing a successful programming (after mass erase), and a failed one (programming the other SREC). Hopefully those details help track down the root cause.
  • CubeIde_Fail.txt showing the failure that STM32CubeIDE shows the user.
  • l476rc_bank2.zip which contains a ready-to-run project that runs on a STM32L476RC device (you can easily solder one into a Nucleo64 board). If you alternate the START_AT_0 constant you can just program one then the other to see the bug exhibited from CubeIDE.

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).

0 REPLIES 0