Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


Syntax error about "__weak","__attribute__((weak))"

a sw4stm32 project generated by stm32cubemx, and I use Ubuntu linux 14.04 OS,
There is a problem,when I build the project ,an error occurred:

Description	Resource	Path	Location	Type
make: *** [Drivers/STM32F4xx_HAL_Driver/stm32f4xx_hal.o] Error 1

in file stm32f4xx_hal.c:

__weak void HAL_MspDeInit(void)
{
  /* NOTE : This function Should not be modified, when the callback is needed,
            the HAL_MspDeInit could be implemented in the user file
   */ 
}

Syntax erro at “__weak”, but I have add settings in

Properties->C/C++ General->Path and Symbols->Symbols

Symbol		Value
__weak		"__attribute__((weak))"+-


How to fix this problem?

France

Hi,

Are you sure you set this symbol for the whole project? You must select the project before opening the properties dialog, otherwise you set these properties only on the currently selected element.

Could you cut&paste the offending compilation log (in the console window)?

Bernard (Ac6)

Thank you again,
I have resolved this problem,
the reason is , I add -std=c99 in a wrong format,now I choose it in Properties->C/C++ Build->Dialect-> Language standard
It’s working


I wonder why you do that. It is defined in stm32f4xx_hal_def.h

In fact it is included in all stm32f4xx_hal_xxxxxx.h

not me, stm32cubemx do that by default,,

I just want to make my IDE support C99

France

There is two possibilities here:

  1. Either you just want to be able to use C99 features; in this case you don’t have to do anything, as the default selection for GCC is -std=gnu11, that is C11 plus GNU extensions, so it supports C99.
  2. Either you want to be sure you are fully C99 conformant to standard iso9899:1999, with no GNU extensions, then you should effectively select -std=c99, but you should also add -Wpedantic, as otherwise it will still accept some GNU extensions, as well as some c11 features...

BTW, the default for C is -std=gnu11 and for C++ it’s -std=gnu98.

Hope this helps,

Bernard (Ac6)

Thank you, your answers are helpful ,
and I resolved this problem .



The problem here is that the value of the symbol should NOT contain any quotes!

Every f***ing time I regenerate the sources of my project with CubeMX, I have to remove those quotes. They don’t belong there and certainly result in invalid syntax (from the CDT Indexer point of view).

The quotes seem to be stripped when the compiler command is generated. So nobody seems to notice the error.

Thanks skoehler, for that ranty suggestion. That solved it for me! :-)
I don’t understand what you mean about the CDT Indexer POV but getting rid of the quotes made the warnings go away and those functions became available in the project.

http://www.openstm32.org/forumthread2733#threadId6864|Question
Every f***ing time I regenerate the sources of my project with CubeMX, I have to remove those quotes. They don’t belong there and certainly result in invalid syntax (from the CDT Indexer point of view).

Thanks skoehler! Although I have previously used STM32 with MDK-ARM on Windows 7 several years ago, I have only just started setting up CubeMX and SW4STM32 on my Mac. I had been nearly pulling my hair out as to why I couldn’t get a project created in CubeMX to build in SW and all it took was removing those annoying quotes.

I reported this almost a year back. CDT’s code indexer is still confused about the quotes in the symbols.

Eclipse shows a syntax error every time the __weak or __packed macros are used in ST’s code. The indexer will not properly index the code due to the syntax errors. Searching for references and declarations and whatnot are not properly found, since CDT cannot parse the code due to the the syntax errors.

Open a project, take a look at the symbols, and observe that it says:

__weak="__attribute__((weak))"


So any declaration like

__weak void myFunction();

becomes

"__attribute__((weak))" void myFunction();


That’s a syntax error. Those quotes don’t belong there and should NOT be part of the symbol definition. This needs to be fixed. CDT cannot work properly with those quotes present.

Please fix it, or point me at the code that is involved in generating those quotes. I will fix it and send you a patch.