--------------------- ledcontrol / firmware --------------------- This folder contains the firmware for the ledcontrol project. It assumes a STM32F103C8T6 microcontroller. Usage ----- Install the necessary software. For Arch Linux this works like this: sudo pacman -S \ base-devel \ arm-none-eabi-binutils \ arm-none-eabi-gcc \ arm-none-eabi-gdb \ arm-none-eabi-newlib Clone this repository with all Git submodules: git clone --recurse-submodules https://cgit.xengineering.eu/ledcontrol Enter the repository and build the software: cd ledcontrol/firmware make Connect your STM32F103C8T6 with an STLINK V2 debugger and flash the firmware: ./ocd.sh # switch to a second terminal in the same folder ./gdb.sh build/ledcontrol.elf load run # CTRL + C will stop the execution # leave GDB with CTRL + D Mention that you do not have to quit GDB to upload new compiled firmware. Just call `load` and `run` again. External References ------------------- - tutorial about C programs on bare-metal ARM chips: https://jacobmossberg.se/posts/2018/08/11/run-c-program-bare-metal-on-arm-cortex-m3.html - tutorial about STM32 programming with libopencm3: https://www.rhye.org/post/stm32-with-opencm3-0-compiling-and-uploading/ - PWM example from the libopencm3 project: https://github.com/libopencm3/libopencm3-examples/blob/master/examples/stm32/f1/obldc/pwmleds/pwmleds.c