STM 32 Blue Pill Arduino Guide
STM 32 Blue Pill Arduino Guide
STM 32 Blue Pill Arduino Guide
For beginners it might be difficult to use the popular and cheap blue pill board based on
STM32F103C8T6. It’s because using an embedded development tools like KEIL isn’t easy for
beginners. This 32 bit microcontroller based on ARM Cortex-M3 architecture is far better than
your traditional arduino board.
You can compare it to Arduino DUE but it has got a very small size like the arduino Nano. There’s
lack of proper documentation on it and everything available in the internet is quite scattered. So,
here’s something to get you started easily.
STEPS:
1. First download all the resources from this mediafire link. The password for extracting data
from the zip file is: techshopbd.
2. Open resource STM32 bluepill folder. Copy the Arduino_STM32 folder to your
sketchbook folder/hardware. Go to arduino IDEs file>preferences and you’ll find the
location of your sketchbook folder. If there’s no hardware folder, create one named as
“hardware” (all lowercase letter).Your arduino IDE is now ready for Blue pill.
3. Have a look on the pinout diagram on the next page. There are 2 yellow colored jumpers
beside the usb port. They are boot options. Connect boot0 pin to 3V3 and boot1 pin to
GND to start the board in SPI mode when it’s powered up or the reset button is pressed.
4. Now connect a FTDI board (FT232RL) to blue pill. You can use any of this or this or this.
Connect FTDI TX to blue pill RX1 (PA10) and FTDI RX to blue pill TX1(PA9).
5. Connect GND. If your FTDI power pin is 5V, connect it to the 5v pin of Blue pill board.
If it’s 3.3 volt, connect to the pin marked as 3.3. Connecting 5v to any 3.3v pin of Blue
pill board will permanently damage it.
6. Connect the FTDI board to your PC using USB port. You must install the FTDI driver to
your PC to use the FTDI board. You’ll find enough resources on the internet on this. FYI,
it’s the driver for arduino Nano.
7. Close arduino IDE if it’s open. Then open it. Go to Tools>board> Generic STM32F103C
Series. Then go to Tools>Variant>STM32F103C8T6(20k ram, 64k flash). These new
options for STM32 will be automatically added to arduino if you’ve performed everything
described it step 2 successfully.
8. Go to tools> upload method>serial. Then tools>port and select the port of the FTDI.
9. Go to tools>board> Boards manager and check if “Arduino SAM Boards (32 bit ARM
Cortex M3)” is installed or not. If not, select more info and an install button will appear.
Install the board definitions. It’s necessary because codes for the Blue pill board uses some
files written for Arduino Duo for successful compilation.
10. Now open the blink code from File>Examples>Basic>blink. Press the reset button on the
Blue pill board and hit upload button on the Arduino IDE. (board built-in LED is on PC13)
11. Note that you have to reset the Blue pill board every time you are about to upload code.
12. You will find all other Examples for the Blue pill board under Up button beneath tools
option>hardware>Arduino_STM32.
Note that, your code will stop working as soon as you restart or reset the blue pill board. You have
to connect boot0 pin to GND using the jumper after uploading code to watch your code working.
But you cannot upload code using USAR1 when boot0 is connected to GND. So,
1. Every time before uploading code, connect boot0 to 3V3 and press the reset button
2. When done with code uploading, connect boot0 to GND.
18. You are now ready to use Blue pill board as normal arduino board by using the on board
microUSB. Keep Boot0 and Boot1 pin always connected to GND. You don’t have to
press RESET button while uploading code anymore.
Video Resources:
www.youtube.com/watch?v=Ze6q6NidS5w
www.youtube.com/watch?v=0jdJp3TQuJY