2022-01-23 10:37 PM
Why is not std::vector or std::unique_ptr using at stm32 projects with cpp? When I examine stm32 projects that use cpp , I do not see modern cpp features.
2022-01-24 01:00 AM
If you generate a project with STM32CubeMX/STM32CubeIDE, all the library code (CMSIS, HAL) is the same plain C, even if you choose C++. Your own C++ code can do whatever it want (and what is supported in the runtime library).
There are C++ 3rd party abstractions for peripherals like STM32duio or home grown, but not vendor supported. And, concerning all the "HAL is bloatware" discussions in this forum, C++ would have a hard time becoming a first class citicen here.
hth
KnarfB
2022-01-24 02:07 AM
Thank you for answer.
2022-01-24 12:20 PM
Dynamic memory allocation, which is used by both objects you referenced, is often frowned upon in embedded projects with limited flash and RAM memory.
I use C++ almost exclusively for my own code in projects. It has many useful features that contribute no additional memory/complexity resources.
2022-01-24 01:33 PM
BTW: There is ETL for embedded: https://www.etlcpp.com/
2022-01-24 10:54 PM
Thank you, etl is very usefull.
2022-01-24 11:30 PM
Understood thanks.