Você não pode selecionar mais de 25 tópicos
Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
Ondřej Hruška
2093a48bed
|
8 anos atrás | |
---|---|---|
.idea | 8 anos atrás | |
Drivers | 8 anos atrás | |
Inc | 8 anos atrás | |
Src | 8 anos atrás | |
User | 8 anos atrás | |
build | 8 anos atrás | |
.cproject | 8 anos atrás | |
.gitignore | 8 anos atrás | |
.mxproject | 8 anos atrás | |
.project | 8 anos atrás | |
CMakeLists.txt | 8 anos atrás | |
README.md | 8 anos atrás | |
STM32F103C8Tx_FLASH.ld | 8 anos atrás | |
f103-bluepill.ioc | 8 anos atrás | |
f103-bluepill.xml | 8 anos atrás | |
f103.cmake | 8 anos atrás | |
flash.sh | 8 anos atrás |
README.md
STM32F103 CLion CubeMX boilerplate
Basics
- This is a CMake / CLion project, using
arm-none-eabi-gcc
andarm-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
intoUser/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 inUser/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 likeprintf()
. Regularprintf()
works as well. - Use
malloc_s()
andcalloc_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.