master
Ondřej Hruška 8 years ago
parent f8a55104a6
commit 4b4b626283
  1. 2
      .idea/f103-simon.iml
  2. 15
      README.md
  3. 0
      bluepill.cmake
  4. 0
      bluepill.ioc
  5. 0
      bluepill.xml

@ -2,6 +2,7 @@
<module type="CPP_MODULE" version="4"> <module type="CPP_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/bluepill.cmake" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/CMakeLists.txt" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/CMakeLists.txt" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/User/utils/debug.h" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/User/utils/debug.h" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/User/utils/timebase.h" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/User/utils/timebase.h" isTestSource="false" />
@ -23,7 +24,6 @@
<sourceFolder url="file://$MODULE_DIR$/Src/stm32f1xx_it.c" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/Src/stm32f1xx_it.c" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Src/main.c" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/Src/main.c" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Src/usart.c" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/Src/usart.c" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/STM32F103x6.cmake" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/STM32F103C8Tx_FLASH.ld" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/STM32F103C8Tx_FLASH.ld" isTestSource="false" />
</content> </content>
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />

@ -1,14 +1,19 @@
# STM32F103 CLion / CubeMX boilerplate # STM32F103 CLion CubeMX boilerplate
Update the init files using STM32CubeMX to fit your project needs. ## Basics
This is a Cmake / CLion project. - 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 :stuck_out_tongue:
- 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.
## Basics ## Getting Started - Usage
- The default setup is USART1, 115200 baud, at PA9 (Tx), PA10 (Rx); PC13 as output (built-in LED). - 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. - 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`. - 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. - 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. - 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. - Use `malloc_s()` and `calloc_s()` if you want error message on malloc fail instead of a hard fault / memory corruption.

Loading…
Cancel
Save