Skip to content

This repository is intended to serve as a base to build project for cheap chinese _Bluepill_ boards based on STM32F103C8T6 Cortex M3 processor. We use [libopencm3](https://github.com/libopencm3/libopencm3) as our main library and flash the boards with a simple USB to serial converter using [stm32loader.py](https://github.com/jsnyder/stm32loader).

License

Notifications You must be signed in to change notification settings

hmightypirate/AllMyCircuits

Repository files navigation

Brief info

Line follower code for Mighty Bug-A boards

Current version: Electronic Experience (v1.4.0)

All My Circuits

Build Status

This repository is intended to serve as a base project to build firmwares for cheap chinese Bluepill boards based on STM32F103C8T6 Cortex M3 processor. We use libopencm3 as our main library and flash the boards with a simple USB to serial converter using stm32loader.py.

Initial setup

Initialise submodules

git submodule init
git submodule update

Toolchain Installation

There are different options to get the toolchain up and running:

  • On some Linux distributions (Debian and Ubuntu) you can install them from the repositories looking for gcc-arm-eabi or gcc-arm-none-eabi
  • You can also download it from the ARM web page using the following link and choosing the right one for your OS: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads In order to install this verion unpack it and add TOLCHAIN_PATH/bin' and TOLCHAIN_PATH/sbin to your PATH system variable.

Build

Once the toolchain is installed properly you can build by using the provided Makefile. The first time you must use make all to download libopencm3 and build it. After that you can use make bin to speed up compilation avoiding to rebuild libopencm3 every time.

Flashing the firmware

The resulting binary firmware bluepill_test.bin can be flashed to the actual board using a simple USB to serial converter (FTDI or similar). The wiring should be as follows:

Bluepill FTDI
GND GND
3.3V 3.3V
A9 RXD
A10 TXD

Note that in order to flash a binary firmware it is necessary to configure the BOOT0 jumper in position 1 as shown in the following picture:

To talk to the board you can use a python script called stm32loader.py:

wget https://raw.githubusercontent.com/jsnyder/stm32loader/master/stm32loader.py

To use this software you have to install pyserial.

sudo pip install pyserial

Finally you can flash the new firmware with the command shown below. Remember to change SERIAL_PORT with the path assigned to your USB to serial converter (e.g. dev/ttyUSB0):

python stm32loader.py -p SERIAL_PORT -e -w -V -g 0x08000000 -v bluepill_test.bin

Alternative building using Docker

It is possible to build and flash the firmware and the tests as well. Use "make help" to read the propper make targets.

Blackpill

The Makefiles are ready for using with the black pill (the newest blue pill version). Use the following commands to compile for the black pill:

PILL=BLACK make

or define PILL=BLACK as an environment variable

Related Projects

About

This repository is intended to serve as a base to build project for cheap chinese _Bluepill_ boards based on STM32F103C8T6 Cortex M3 processor. We use [libopencm3](https://github.com/libopencm3/libopencm3) as our main library and flash the boards with a simple USB to serial converter using [stm32loader.py](https://github.com/jsnyder/stm32loader).

Resources

License

Stars

Watchers

Forks

Packages