Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iancanada/STM32Cube-Cpp-programming-example
This example will show you how to program STM32 in C++ with STM32 HAL drivers and STM32CubeMX generated code frame
https://github.com/iancanada/STM32Cube-Cpp-programming-example
Last synced: 18 days ago
JSON representation
This example will show you how to program STM32 in C++ with STM32 HAL drivers and STM32CubeMX generated code frame
- Host: GitHub
- URL: https://github.com/iancanada/STM32Cube-Cpp-programming-example
- Owner: iancanada
- Created: 2015-09-21T02:31:54.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-21T03:11:46.000Z (about 9 years ago)
- Last Synced: 2024-07-31T22:58:42.650Z (3 months ago)
- Language: C
- Homepage:
- Size: 3.3 MB
- Stars: 39
- Watchers: 7
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# STM32Cube-Cpp-programming-example
* Copyright (C) Ian Jin
* [email protected]
* https://github.com/iancanada/
* Twitter: @iancanadaTTThis example will show you how to program STM32 in C++ with STM32 HAL drivers and STM32CubeMX generated code frame.
It's true that STM32Cube can not generate C++ project so far. However, STM32 HAL drivers already have C++ support. So, it's still possible to create C++ code for STM32 based on STM32 HAL drivers and STM32CubeMX generated projects.
It just needs a couple of steps:
1. Generate a STM32 MDK project normally by STM32CubeMX with most updated HAL drivers.
2. Open project in Keil ARM MDK, change project-option-C/C++ -MiscControls to --cpp
3. Create user C++ files in .hpp and .cppThis example shows exactly how to do it.
Hardware platform:
STM32 F4 Discovery board (STM32F407VGT6)
Software platform:
Keil ARM MDK V5.05
STM32CubeMX V4.9.0
Files:
/MDK-ARM/: Keil ARM MDK project
STM32CubeCppExampleF4.ioc: STM32CubeMX project
/Src/LEDcpp.cpp, /Inc/LEDcpp.hpp : C++ LED class for STM32
If four LEDs on STM32 F4 Discovery board toggle respectively every 0.5,1,2,4 seconds, then we are done.