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


How to properly convert c ++ project?

Any new solution for converting project to C++ ?

I successfully use some c++ code inside a .c file like

std::vector v = {1.2,2.3,4.5,5.6,6.7};
std::stack hp;
hp.push(“1221”);
hp.push(“test”);
hp.push(“stack”)
hp.push(” item”);
const char *data;
while( hp.size() > 0)
{
data = hp.top().c_str();
hp.pop();
USARTSendString(data);
}
USARTSendString(“\n”);

Just by changing ‘gcc’ to ‘g++’ in the project settings AND adding the flag ‘-fpermissive’

I know it is very far to be a good solution but I really need to use some C++ STL features, that’s the quick and dirty solution I found till now with the constraint that I want to keep my code in sync with CubeMX (which does not yet? generate C++ code if I’m right)


It compiles and runs on a F7...

It just makes the Eclipse indexer mad, I had hundreds of ‘unresolved symbols’ while the code compiles and links fine, I tried to find a workaround by googling a long time but nothing works, if you rename the *.c files in *.cpp files, than the indexer is happy but the code does not compile anymore for many other problems, so I just disabled the Eclipse indexer to avoid all the error messages polution but it is frustrating not to have this nice feature...

J.


France

Hi,

The simplest solution is to right-click on your project >> Convert to C++

You just have to check that your install of System Workbench for STM32 is up to date (Help >> Check for Updates....

Of course you must still name your C++ source files with a .cpp extension instead of .c; Standard C source files are still compiled by teh C compiler, only C++ source files are compiled by the C++ compiler.

Bernard (Ac6)