Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


How to C++ project for dummies

Hi,

I’m pretty much a beginner when it comes to programming and IDEs.
I’m trying to make a hardware version of a VST synthesizer I’ve made years ago using WDL-OL.
For this I want to use a nucleo board.
The VST code is all C++ and I don’t really know how to implement most of it in C so I’d like to be able to
programm my STM32 using C++.
However I have no idea how to do this.
I have successfully created a working C project with CubeMX. However just converting this working C project to C++ and doing nothing else but building gives me a list of warnings about 4 include paths not being found. And my main is still a main.c and I have no idea how to implement classes.

I have at least managed to read MIDI via USART2, interface a HD44780 LCD and output sound via the DACs using plain C so I guess I’m not a complete failure but I’m hitting a wall here.

Is there a step by step guide/tutorial on how to create a C++ project and implementing classes or generally how to programm nucleo boards in C++ for beginners?
I’ve been searching for hours without success

Many thanks
Best regards


There’s a few tutorials kicking around here; I followed them and am working with C++ and CubeMX generated projects just fine.

Here’s a couple of points you’re not going to get until you do some reading.

(1) C and C++ link differently. C++ uses a thing called name mangling. You need to be careful in keeping your C and C++ code in separate sources files if you can manage it. Google for the exact phrase ‘extern “C” and calling C from C++’ and you will get hours of relevant reading material.

(2) if you’re using CubeMX, don’t fight the code generator; note the “user code goes here” sections, put your C++ code in a different folder and add that folder to your includes in the compiler settings. You’ll have much more success if you do that because then you can regenerate your code with CubeMX without mangling all the work you did to get the C++ linkage working.

I will see if I can do a simple “hello world” c++ example at some point because I have a project template that’s working well for me now.


 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs