Unable to program STM32 using ST Link utility: programming error @: 0x00000001
<p>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.</p>

<p>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.</p>

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

<p>When I try <code>Target &gt; Program</code> it however, after selecting my .hex file and hitting Start, the console tells me:</p>

<pre><code>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.
</code></pre>

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

<p>When I select <code>Target &gt; Program &amp; Verify</code>, I get a error message 'programming error @: 0x00000001' and the following console output:</p>

<pre><code>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
</code></pre>

<p>My memory linker script (mem.ld) is as follows:</p>

<pre><code>MEMORY
{
  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
}
</code></pre>

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