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


You are viewing a reply to cubeMX generation problem  

cubeMX generation problem

cubeMx about box:

version 4.14.0
STM32Cube V1.0

The flaw described here applies to both the libraries as well as CubeMx generation under C++.

1. CubeMX and the libraries are currently aligned with “C” compilation and linking (eg no name mangling).
2. For the existing libraries and generated code to WORK in both “C” and “C++” ALL of the libraries and the generated code’s include files requires that the function prototypes in the header files MUST be bracketed by the following construction to insure that the linkers will blend “C” and “C++” properly.

  1. ifdef __cplusplus

extern “C” {

  1. endif


// “C” compliant function prototypes

  1. ifdef __cplusplus

}

  1. endif // __cplusplus


This is an imperative and requires updating of cubeMX AND all libraries. With this construct added, all of the libraries and generated code will work as they do now when the remainder of the application is compiled under C++ in order to use class, inheritance and template functionality.

This will help significantly when making C++ classes portable across many embedded systems.

Ah, they already do include this (I use C++ in CubeMX projects right now - as in today).

You will however find life much easier if you confine yourself to naming C++ _exclusive_ headers to *.hpp (or similar)
There are several posts here about converting a project to C++


 

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