Git Product home page Git Product logo

stm32cube-cpp-programming-example's Introduction

STM32Cube-Cpp-programming-example

This 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 .cpp

This 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.

stm32cube-cpp-programming-example's People

Contributors

iancanada avatar

Watchers

James Cloos avatar Con L Popescu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.