====== Flash STM32 Primer over UART1 ====== Get [[http://www.stm32circle.com/resources/stm32primer.php|STM32 primer]]. {{ :tutorial:small_description.png |STM32 Primer}} FIXME Need write about device. ===== Rework ===== {{ :tutorial:primer-full.jpg?600 |Primer}} ==== Step 1 ==== You need TTL3.3v serial port. Example USB to UART Prolific PL-2303 chip. * Connect ''TX'' line of serial port to ''RxD'' (sic!) point on primer's board. * Connect ''RX'' line of serial port to ''TxD'' (sic!) point on primer's board. * Connect port and primer grounds ''GND''. {{ :tutorial:stage3.jpg?400 |Step 1}} ==== Step 2 ==== Resolder ''R48'' that would pull-down ''Boot1'' processor pin. {{ :tutorial:stage1.jpg?400 |Step 2}} ==== Step 3 ==== ''R42'' change with 10К resistor. Connect ''Boot0'' point to ''nRTS'' line of serial port or use jumper instead ''R49'' to enter program mode after reset {{ :tutorial:stage2.jpg?400 |Step 3}} ==== Step 4 ==== Connect ''nDTR'' of serial port to ''Reset'' point via semi-key and/or connect button to ''Reset'' and ''GND'' points on primer board. {{ :tutorial:semi-key.png|Semi-key}} {{:tutorial:stage4.jpg?400 |Step 4}} ==== Final ==== {{ :tutorial:stm32primer-mod.jpg?400 |Final}} ===== STM32 Loader ===== Install python and pyserial library. On Debian type command apt-get install python python-serial Download flash loader {{:tutorial:stm32loader.py.gz}} Get help: ./stm32loader.py --help Erase, write and verify compiled binary: ./stm32loader.py -e -w -v example/main.bin :!: Loader have bug: you must disconnect serial port after flashing and reset MCU. {{tag>arm cortex stm32 howto uart devboard}}