You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ondřej Hruška
f8a55104a6
|
8 years ago | |
---|---|---|
.idea | 8 years ago | |
Drivers | 8 years ago | |
Inc | 8 years ago | |
Src | 8 years ago | |
User | 8 years ago | |
build | 8 years ago | |
.cproject | 8 years ago | |
.gitignore | 8 years ago | |
.mxproject | 8 years ago | |
.project | 8 years ago | |
CMakeLists.txt | 8 years ago | |
README.md | 8 years ago | |
STM32F103C8Tx_FLASH.ld | 8 years ago | |
STM32F103x6.cmake | 8 years ago | |
f103-simon.ioc | 8 years ago | |
f103-simon.xml | 8 years ago | |
flash.sh | 8 years ago |
README.md
STM32F103 CLion / CubeMX boilerplate
Update the init files using STM32CubeMX to fit your project needs.
This is a Cmake / CLion project.
Basics
- 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.