STM32F103C8T6 serial loader program

September 23, 2016

I am supplying this program configured to do only one thing, namely send the command to "disable readout protection". Once you do this, the board can be connected via STLINK to flash new programs or do whatever.

This is a program I wrote to communicate with the STM32F103C8T6 board using the serial bootloader protocol that chip has in system memory. I use an FTDI basic chip from Sparkfun, but virtually any USB to serial chip should work, but take care that it is setup to use 3.3 volt logic levels. I also supply 3.3 volt power to the STM32 from the FTDI chip. This sounds a bit edgy, but it is actually fine. The FTDI has a 3.3 volt output rated for 50 mA and the STM32 pulls about 50 mA as a maximum. I have had no problems and the FTDI chip runs cool.

On my board, I connect 4 wires:

The program is simple enough to fit in one C file and you can compile it (on linux) in the usual trivial way as:

cc -o loader loader_unpro.c
Then just run ./loader or whatever you name it. A trivial makefile is supplied that generates "loader_unpro".

If you are on Windows, this won't be much use to you.

If you look at the program, you will see code for many other features of the serial_protocol, calls to most of them are commented out in main().


Feedback? Questions? Drop me a line!

Tom's Computer Info / [email protected]