Unable to program STM32 using ST Link utility: programming error @: 0x00000001


I have been trying to get my grips around programming STM32. I have got a Nornir developed Dash7/sensor board (for which absolutely no documentation exists somehow...), which has a STM32L100RBT6 MCU. So I'd like to program my own software for this board.

So far I have succesfully made a project and build the firmware. At this point I am trying to flash the .hex file onto the MCU using a official ST-link v2 programmer, in combination with the ST-Link utility software (under windows 10). I am using the JTAG interface on the board.

In the ST-link utility, I can connect to the board, and read it out. I have erased the chip, and I only read zeros in the memory, for both memory pages (0x00000000 and 0x08000000).

When I try Target > Program it however, after selecting my .hex file and hitting Start, the console tells me:

16:54:48 : Connected via JTAG.
16:54:48 : Connection mode : Normal.
16:54:48 : Debug in Low Power mode enabled.
16:54:49 : Device ID:0x416 
16:54:49 : Device flash Size : 128KBytes
16:54:49 : Device family :STM32L100x8/L15xx8
16:54:52 : Memory programmed in 0s and 250ms.

But when I read out the memory, it is not programmed. It only shows me zeros on both pages (0x00000000 and 0x08000000).

When I select Target > Program & Verify, I get a error message 'programming error @: 0x00000001' and the following console output:

16:55:39 : Connected via JTAG.
16:55:39 : Connection mode : Normal.
16:55:39 : Debug in Low Power mode enabled.
16:55:39 : Device ID:0x416 
16:55:39 : Device flash Size : 128KBytes
16:55:39 : Device family :STM32L100x8/L15xx8
16:56:16 : No OnChip verification function found. Verify after programming will be performed.
16:56:17 : Programming error @: 0x00000001

My memory linker script (mem.ld) is as follows:

  FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
  RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 10K

   * Optional sections; define the origin and length to match
   * the the specific requirements of your hardware. The zero
   * length prevents inadvertent allocation.
  CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0
  FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
  EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
  EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
  EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
  EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0

I am stuck at this point, and have so far been unable to find any resources pointing me in the right direction. Any ideas?

asked on Stack Overflow Nov 9, 2016 by Arvest • edited Nov 11, 2016 by Arvest

1 Answer


ST Link utilty caches the files that you use. It's not documented anywhere but it does this. If you want to be 100% sure you've programmed the latest binary/hex file change the name of the file (from the previous version) and program again

answered on Stack Overflow Sep 27, 2019 by Bad programmer

User contributions licensed under CC BY-SA 3.0