BreezySTM32 aims to provide a simple ("breezy") Application Programming Interface (API) for writing firmware on the ARM STM32F controller boards popular on toady's flight controllers (Naze32, Flip32, CC3D). There is extensive support for the F1 generation of controllers, and we are adding F3 support as time permits. For F3, edit examples/Makefile to use makefile.f3 instead of makefile.f1.
As with the Arduino, you write a setup() function and a loop() function, and BreezySTM32 takes care of the rest, providing you with a debug() function with the API of the printf() from C, a SerialPort1 that you can read/write, and libraries for standard signals like analog voltage, PWM, UART, and I^2C. (If you want to use the Arduino IDE with your STM32 board, there are other tools to do this; my goal with BreezySTM32 was to provide a bare-bones C API for my favorite flight controllers.)
To use BreezySTM32, you'll at minimum need to install the GNU ARM toolchain. After that you can use whatever development tools you like to build your firmware. I have found it easiest to avoid IDE / debugging tools like Eclipse, sticking with simple makefiles for building / flashing, vim for editing, and printout for debugging.
For flashing new firmware, BreezySTM32 uses the same trick as the Baseflight firmware and descendants (Cleanflight, Betaflight, Raceflight) that I adapted to write BeezySTM32: it listens for for a special reboot character ('R'), which you send from your computer right before flashing. So if your board came with one of those firmwares pre-flashed, you can just do make flash to put your new firmware on it. If that doesn't work, you'l have to go through the “un-brick” procedure: disconnect the board from your computer, short the BOOT pins together, reconnect to your computer, and do make unbrick. The Flip32 features through-hole soldering pads for the BOOT pins, so that is the board I've been using for development. By pushing a two-pin jumper onto the pins, I avoid having to place a paper clip or tweezers across the pins while unbricking. The BreezySTM32 examples directory includes the following use cases:
- a simple LED blinker
- a program that searches the board for I2C devices, reporting the addresses of any such devices found
- a program that reads from the MaxBotix MB1242 I2C ultrasonic rangefinder and reports distances in centimeters
- a program that reads from the onboard MPU6050 Inertial Measurement Unit and reports acceleration in mm/s2, angular velocity in mrad/s and the time delay between measurements and the time to print to the screen in us.
- a program that tests the SPI-based flash memory
- a C++ program for blinking one of the LEDs
A makefile is included with each example, to show you how to start your own projects. Type make flash to flash the example to your board.
Projects known to be using BreezySTM32 include:
If you find BreezySTM32 helpful, please consider donating to the Baseflight or Cleanflight projects from which it is derived.