title: STM32 flashing through boot loader fails (UART1)
body: <p>I have an STM32F103 that I'm <strong>re-flashing remotely</strong> using a different MCU through its <strong>UART port</strong> (using the boot loader). It works perfectly fine, I have multiple devices that have been successfully flashed with the right code. But occasionally there comes along a device that has stopped working because the STM32 code flashed is not the right one. The whole bin file is flashed using the other MCU, but the STM gets "bricked" (not exactly bricked, it's just has a wrong code). When I re-flash the device using my PC everything is working again. Why would the hex wrote into to the STM fail?</p>
  
  <p>Brief:</p>
  
  <p>*Using UART bootloader to flash STM32F103</p>
  
  <p>*Occasionally this method fails, and so the STM stops working.</p>
  
  <p>*Is there a method to check if the data written into the code space is valid?</p>
  
  <p>*The STM is not bricked, it's <strong><em>just a wrong code</em></strong> inside the flash. When I read back the flash from the code space, this is smaller than the file that should have been flashed. </p>
  
  <p>*I'm using the STM in system boot mode.<a href="http://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf" rel="nofollow noreferrer"> [AN2606]</a></p>