cancel
Showing results for 
Search instead for 
Did you mean: 

Convert CubeMX project in Atollic to C++: Pane to input symbols for C++ missing

Axel Jäger
Associate II

Hello,

I am trying to convert a project generated by CubeMX to a C++ project in Atollic True Studio.

From various sources, I got hints how to do. I fail when trying to copy the symbols e.g. processor type to C++ because the input pane is missing. Here is in detail what I tried so far:

  1. Created the project in CubeMX and converted to C++ by using New... / Convert to a C/C++Project (Adds C/C++ Nature)
  2. Copied the include paths in Project > Properties > C/C++ General / Includes from GNU C to GNU C++

0690X0000060RF7QAM.png

  1. Now I want to do the same thing for the symbols Project > Properties > C/C++ General / Symbols. However, there is no entry for GNU C++, only GNU C and S,s,ams.

0690X0000060RFHQA2.png

When I create a C++-Project directly using Atollic, there are entries for GNU C++ on both the includes and the symbols tab.

I tried to figure out what was the difference between both .project and .cproject files.

In both .project-files, the org.eclipse.cdt.core.ccnature is present

In the .cproject of the native Atollic-project, I see the entry for my symbol:

<tool id="com.atollic.truestudio.exe.debug.toolchain.gpp.165402641" name="C++ Compiler" superClass="com.atollic.truestudio.exe.debug.toolchain.gpp">
<option id="com.atollic.truestudio.gpp.symbols.defined.287854650" name="Defined symbols" superClass="com.atollic.truestudio.gpp.symbols.defined" valueType="definedSymbols">
<listOptionValue builtIn="false" value="STM32H743xx"/>
</option>

In the project migrated from CubeMX, I see the same options, however they are populated with nonsense values and they seem to be ignored:

<tool id="com.atollic.truestudio.exe.debug.toolchain.gpp.981298185" name="C++ Compiler" superClass="com.atollic.truestudio.exe.debug.toolchain.gpp">
<option id="com.atollic.truestudio.gpp.symbols.defined.1619552487" name="Defined symbols" superClass="com.atollic.truestudio.gpp.symbols.defined" valueType="stringList">
<listOptionValue builtIn="false" value="STM32F10X_MD"/>
<listOptionValue builtIn="false" value="USE_STDPERIPH_DRIVER"/>
</option>

Does anyone has any clue why Atollic does neither display those values nor use the during compilation?

Best regards

Axel Jäger

3 REPLIES 3

They should make their way to command line defines for the compiler ie -DSTM32H743xx

Not familiar with Atollic, and whether this is the appropriate place for these, or under the next tab down for the "Preprocessor"

@ST Community​ Perhaps some ST-Atollic staff could respond to this

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Axel Jäger
Associate II

Hi,

at least for the projects generated by CubeMX, Symbols is the way to go as this is how they do it for plain C projects.

In the meantime, I went one step further: You already see in my post that for example the block for C++ looks different, i.e. valueType is "stringList" for the C++-block, whereas valueType is "definedSymbols" for the C-block. I tried to change this without success, however, just copying the C-block and change all gcc to gpp got me a working project. I further digged into this and found out that CubeMX generates this block already although this is not a C++ project and it looks like this block present confuses Atollic during the convert to C++ and later on.

So far I have not found out whether simply ommiting this block in the CubeMX-template would be sufficient to prevent this issue. If this was the case, this would be a fix that ST should definitely consider for the next release.

ACuay
Associate

Hi,

To edit the symbols for the C++ language go to:

  • C/C++ Build > Settings > C++ Compiler > Symbols

then copy the exact symbols from C Compiler.

After I did this my project compiled correctly.

I hope it helps.

Regards,

Andrés Cuaycal