Can stm32f103 use C++?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-08-25 5: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.
- Labels:
-
STM32CubeMX
-
STM32F1 Series
-
TrueSTUDIO
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-08-25 6: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-08-25 6: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-08-26 12:40 AM
Thank you for your reply.
Is there any configuration for using c++?
or just use c++?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-08-26 1: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.
