STM32CubeMX improvement suggestion
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-12-03 1:33 AM
Posted on December 03, 2015 at 10:33
Hi CubeMX team,
Thanks for making this wonderful user friendly tool !!I would like to see an option to have main.c generated as main.cpp file.Thanks, Rob #cpp-c++-main.c-main.cpp-cubemx
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-12-10 6:00 AM
Posted on December 10, 2015 at 15:00 Dear Rob, As you probably noticed already HAL drivers are ready to be used in a C++ project. You can generate a project with CubeMX. Opening the generated project in your preferred toolchain (still using STM32CubeMX generated main.c file), you can add user files with .cpp/.hpp extensions. Changing project options ( --cpp in uvision for example), you can choose to compile it as a C++ project . By requesting a main.cpp file, do you expect to have object oriented encoding for this file (C++ classes, namespaces, etc...) which would defer from current main.c architecture? Thanks in advance for your feedback
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-12-14 2:44 PM
Posted on December 14, 2015 at 23:44
Dear STM32Cube-T,
Thanks for your reply. I did not realize that i could compile main.c as .CPP file. This solved my ''problem'' I was wondering how to get a function called from main.c that resides in a .CPP file. I solved it to look at the generated linker map file what the decorated name of the function became. But your suggestion is far better !!I don't intend to place classes etc in main but all in external files. Thanks, Rob