Boilerplate project with CLion for stm32f103 bluepill
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
Ondřej Hruška 2093a48bed cleanup 8 anni fa
.idea renamed project etc 8 anni fa
Drivers Initial import 8 anni fa
Inc cleanup 8 anni fa
Src cleanup 8 anni fa
User cleanup 8 anni fa
build Initial import 8 anni fa
.cproject cleanup 8 anni fa
.gitignore Initial import 8 anni fa
.mxproject cleanup 8 anni fa
.project cleanup 8 anni fa
CMakeLists.txt renamed project etc 8 anni fa
README.md readme 8 anni fa
STM32F103C8Tx_FLASH.ld Initial import 8 anni fa
f103-bluepill.ioc cleanup 8 anni fa
f103-bluepill.xml cleanup 8 anni fa
f103.cmake renamed project etc 8 anni fa
flash.sh Initial import 8 anni fa

README.md

STM32F103 CLion CubeMX boilerplate

Basics

  • This is a CMake / CLion project, using arm-none-eabi-gcc and arm-none-eabi-newlib.
  • It's built on Linux. Whether it works on Windows or MacOS is left as an exercise to the reader 😛
  • Update the init files using STM32CubeMX to fit your project needs. Open bluepill.ioc in CubeMX, then export to the same folder.
  • Since we're using CubeMX, this project is based on HAL. It's not so bad, if you don't look at the source too much.

Getting Started - Usage

  • The default setup is USART1, 115200 baud, at PA9 (Tx), PA10 (Rx); PC13 as output (built-in LED).
  • The program branches from main.c into User/user_main.c where the actual application code starts.
  • Initialization of the application code (libs) is done in User/init.c. Exception handlers and such are handled in User/handlers.c.
  • Use the included Debounce module for button inputs, Timebase for periodic and future tasks.
  • Functions from User/utils/debug.h print messages to USART1, and work like printf(). Regular printf() works as well.
  • Use malloc_s() and calloc_s() if you want error message on malloc fail instead of a hard fault / memory corruption.
  • Flash using ./flash.sh. Hold the reset button on the board, and release it right after issuing the flash command.