Ninjaskit – STM32F103C8T6 Library
Ninjaskit – A STM32F103C8T6 Library
Ninjaskit is a high level C++ API for STM32F103C8T6 micro-controllers.
The STM32F103C8T6 micro-controller has 64K of FLASH, 20K of RAM and ticks at up to 72Mhz. It’s quite small ( 7x7mm ), comes with a built in boot loader and is very easy to incorporate in home-made PCBs. Development boards for this micro-controller are cheap and readily available.

These boards are ALWAYS available on e-Bay and similar online stores for great prices – often under $10 with free postage. Try searching for ‘stm32f103c8t6 minimum system development board’.
I’ve found this controller to be suitable for all but a few projects. But, despite the pro’s, I’ve found there’s no simple open source ‘out of the box’ software support for this device. The two options I’ve tried are libopencm3 and STMicro’s Cube hardware-abstraction-layer. libopencm3 is a bit low-level and difficult to use. Their examples are a great start, but appear to be incomplete. Cube is very comprehensive and easier to use, but is much larger and bloats binaries considerably. In addition, both libopencm3 and Cube are C libraries and don’t blend well with my C++ style!
My solution has been to implement my own high level C++ system for the STM32F103C8T6 using libopencm3 and ETK. I’ve called it Ninjaskit – which is a portmanteau of Ninjask, the super-fast flying bug pokemon, and kit because it’s a software toolkit. It’s a small, fast software toolkit.
Ninjaskit is very much a work in progress. Usart, GPIO (digital read/write), ADC, FLASH read/write and I2C all seem to work acceptably. SPI has been started and unidirectional Rx only mode has been tested OK.
Example Projects
ninjaskit_lcd – an LCD screen library
ninjaskit_thermocouple – uses SPI to read temperature from a chip
I’m trying to port ARM’s mbed framework (https://github.com/mbedmicro/mbed) to this MCU/board (so-called “blue pill”). So far I got couple of tests working incl. venerable blinky.