Skip to main content
Elwood Downey
Associate III
Dec 5, 2016 8:23 PM UTC
Solved

STM32CubeMX 4.18.0 bug in .cproject

Posted on December 05, 2016 at 21:23

I use CubeMX on maxOS to generate projects for SW4STM32 then run a 

https://github.com/baoshi/CubeMX2Makefile

 to generate a Makefile for the gnu gcc toolchain. This worked fine on MX 4.16 and 4.17 but it broke today when I installed to 4.18. I tracked it down to four missing " entities in .cprofile where it defines the C preprocessor values.

The incorrect line generated by MX is:

<option id='gnu.c.compiler.option.preprocessor.def.symbols.1056679357' name='Defined symbols (-D)' superClass='gnu.c.compiler.option.preprocessor.def.symbols' useByScannerDiscovery='false' valueType='definedSymbols'><listOptionValue builtIn='false' value='__weak=__attribute__((weak))' /><listOptionValue builtIn='false' value='__packed=__attribute__((__packed__))' /><listOptionValue builtIn='false' value='USE_HAL_DRIVER' /><listOptionValue builtIn='false' value='STM32F446xx' /></option>

But it should be:

<option id='gnu.c.compiler.option.preprocessor.def.symbols.1056679357' name='Defined symbols (-D)' superClass='gnu.c.compiler.option.preprocessor.def.symbols' useByScannerDiscovery='false' valueType='definedSymbols'><listOptionValue builtIn='false' value='&quot;__weak=__attribute__((weak))&quot;' /><listOptionValue builtIn='false' value='&quot;__packed=__attribute__((__packed__))&quot;' /><listOptionValue builtIn='false' value='USE_HAL_DRIVER' /><listOptionValue builtIn='false' value='STM32F446xx' /></option>

    This topic has been closed for replies.
    Sirma Siang
    Sirma SiangBest answer
    ST Employee
    Jan 20, 2017 4:23 PM UTC
    Posted on January 20, 2017 at 17:23

    Hello Elwood and all,

    Great thanks for your feedbak.

    I just tested, and I can confirm you that this issue is fixed in CubeMX4.19.

    This version will be shortly available.

    Kind regards

    Sirma

    13 replies

    Lukasz Przenioslo
    Associate III
    Dec 5, 2016 8:38 PM UTC
    Posted on December 05, 2016 at 21:38

    I was just about to post the same thing. I Updated to 4.18 and ended up without working project, and I could not post because the forums were down. It took me some time to figure out those quotes. CubeMx generates:

    __weak=__attribute__((weak))

    __packed=__attribute__((__packed__))

    And it should be:

    __weak='__attribute__((weak))'

    __packed='__attribute__((__packed__))'

    Andrei Chichak
    Lead
    Dec 5, 2016 10:54 PM UTC
    Posted on December 05, 2016 at 22:54

    Strangely, I was working on this same problem this morning. After I figured out the quotes thing, Eclipse couldn't find arm-none-eabi-gcc. Sigh, how did it know that I was starting into the code portion of my article???

    Nesrine M_O
    Associate
    Dec 6, 2016 4:51 PM UTC
    Posted on December 06, 2016 at 17:51

    Hi,

    I'll report this issue to our MX team for checking.

    Sorry for the inconvenience may bring.

    -Nesrine-

    If my suggest answers your question, please mark it as correct.

    Thank you

     

    Sirma Siang
    Sirma SiangBest answer
    ST Employee
    Jan 20, 2017 4:23 PM UTC
    Posted on January 20, 2017 at 17:23

    Hello Elwood and all,

    Great thanks for your feedbak.

    I just tested, and I can confirm you that this issue is fixed in CubeMX4.19.

    This version will be shortly available.

    Kind regards

    Sirma

    Andrei Chichak
    Lead
    Jan 20, 2017 8:07 PM UTC
    Posted on January 20, 2017 at 20:07

    Shortly? 4.19.0 has been available for a couple of days already. Did this change make the cut?

    Vitor Barbosa
    Associate
    Feb 28, 2017 10:48 PM UTC
    Posted on February 28, 2017 at 23:48

    Hello,

    I was desperate with this bug. I have STM32CubeMX 4.19.0 and this bug still occurs in this version.

    The suggested fix works adding the element &quot; in .cproject file, near packed and weak, in the generated file.

    Thank you!

    Sirma Siang
    ST Employee
    Mar 1, 2017 10:45 AM UTC
    Posted on March 01, 2017 at 10:45

    Hello Vitor,

    Great thanks for your feedback.

    As we are improving continuously our SW offer, I am interrested in your working environment.

    Could you please share the following info:

       your OS ?

       which java version ?

       How have you installer CubeMX (fresh install or update)?

       Could you upload your ioc ?

       Could you upload Cube log file ?

    Great thanks in advance for your feedback.

    Kind regards

    Sirma

    Vitor Barbosa
    Associate
    Mar 1, 2017 11:13 PM UTC
    Posted on March 01, 2017 at 23:13

    Hello Siang,

    My replies to your questions.

    your OS ? XP + SP3

    which java version ? Java 8 update 25

    How have you installer CubeMX (fresh install or update)? I think it was a fresh install

    Could you upload your ioc ? in attach DemoL152V2.ioc

    Could you upload Cube log file ? (what kind of file is this?)

    Systems Workbench for STM32 SW4STM32 release 1.1

    Best regards,

    Vitor Barbosa

    ________________

    Attachments :

    DemoL152V2.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyqD&d=%2Fa%2F0X0000000bDD%2FubSRlKHtui5TJofrDGinoGAY5tbJgR272U2lhsPLPNg&asPdf=false