2020-08-25 05:24 PM
Hi All,
Can stm32f103 use C++? for programing not c.
I'm using stm32f103 / truestudio / cubemx.
I want to use some c++ grammer for programing.
If there's way to use c++
How i can use c++ in stm32f103?
regard.
Solved! Go to Solution.
2020-08-25 06:04 PM
Of course. The chip doesn't know what language you're using, it only sees the compiled code.
Most compilers are smart enough to realize *.cpp files are C++ while *.c files are C.
2020-08-25 06:04 PM
Of course. The chip doesn't know what language you're using, it only sees the compiled code.
Most compilers are smart enough to realize *.cpp files are C++ while *.c files are C.
2020-08-26 12:40 AM
Thank you for your reply.
Is there any configuration for using c++?
or just use c++?
2020-08-26 12:53 AM
In Keil it is pretty straight forward, in GNU/GCC you need to make sure the linker script and startup code manage constructors properly.
The HAL code isnt in C++ so you'll need to interface with that.
The CPU doesn't care how you generate code, but in embedded you need to be significantly more aware of how the MCU and tools function and interact.
2020-08-26 01:00 AM
IAR will compile C++ for that chip. They include good start up and linker files so it's simple to get running. The STM Cube examples usually have project files for IAR.