title: STM32 flashing disabled after flashing a code without R/W protection
body: <p>I have some experience of StdPeriph libraries usage for programming stm32. But now I tried STM32Cube HAL with STM32CubeMX code generator. I generated a project with this options:</p>
  
  <ul>
  <li>Middleware: FreeRTOS and FatFS via SDIO</li>
  <li>Compiler is GCC</li>
  <li>stm32f103ret6 MCU</li>
  </ul>
  
  <p>I imported generated code to Eclipse environment. I made a binary and flashed it with "st-flash write ..." as usual. My test program successfuly wrote to USART1 "Hello" in cycle - this is no problem. But then, when I tried to flash another code, it failed with "unknown chip id". If I manually connect NRST to GND, st-flash gives:</p>
  
  <pre><code>...Flash: 0 bytes (0 KiB) in pages of 2048 bytes
  </code></pre>
  
  <p>Full output:</p>
  
  <pre><code>2015-06-14T16:07:29 INFO src/stlink-common.c: Loading device parameters....
  2015-06-14T16:07:29 INFO src/stlink-common.c: Device connected is: F1 High-density device, id 0x10036414
  2015-06-14T16:07:29 INFO src/stlink-common.c: SRAM size: 0x10000 bytes (64 KiB), Flash: 0 bytes (0 KiB) in pages of 2048 bytes
  </code></pre>
  
  <p>I tried to use ST-Link Utility from Windows, but it cannot connect to this MCU to change option bytes (connection to another devices with stm32 works well). 
  I tried to flash through USART1, but it failed.</p>
  
  <p>Source code I flashed, of course, does not contain any read/write protection enabling. I tried 2 another MCU, but this error was reproduced.</p>
  
  <p>How can I unbrick by MCUs and flash anything?</p>