Skip to main content
jeremyh
Associate II
Dec 31, 2016 7:52 AM UTC
Question

STM32CubeMX generates broken SW4STM32 code

Posted on December 31, 2016 at 08:52

Hi,

I've created a very simple project in STM32CubeMX for the F3DISCOVERY board. The only things I changed from the default are enabling MCO, and setting the PLL multiplier to When I import the code into SW4STM32 and press build, I get the following error:

17:41:40 **** Build of configuration Debug for project test_64mhz ****
make all 
Building file: ../Src/main.c
Invoking: MCU GCC Compiler
/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Debug
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F303xC -I'/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Inc' -I'/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Drivers/STM32F3xx_HAL_Driver/Inc' -I'/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Drivers/STM32F3xx_HAL_Driver/Inc/Legacy' -I'/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Drivers/CMSIS/Device/ST/STM32F3xx/Include' -I'/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Drivers/CMSIS/Include' -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF'Src/main.d' -MT'Src/main.o' -o 'Src/main.o' '../Src/main.c'
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F303xC -I'/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Inc' -I'/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Drivers/STM32F3xx_HAL_Driver/Inc' -I'/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Drivers/STM32F3xx_HAL_Driver/Inc/Legacy' -I'/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Drivers/CMSIS/Device/ST/STM32F3xx/Include' -I'/Users/jeremy/stm32_test/rcc_64mhz/test_64mhz/Drivers/CMSIS/Include' -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF'Src/main.d' -MT'Src/main.o' -o 'Src/main.o' '../Src/main.c''
make: *** [Src/main.o] Error 2
17:41:40 Build Finished (took 94ms)�?�?�?�?�?�?�?�?�?�?�?

My operating system is OSX Yosemite, and both SW4STM32 and STM32CubeMX are updated to the latest versions.

Thanks,

Jeremy

#stm32cubemx #sw4stm32
This topic has been closed for replies.

10 replies

Andrei Chichak
Lead
Dec 31, 2016 8:00 AM UTC

Posted on December 31, 2016 at 09:00

This has been reported to ST and the people at AC6 that take care of SW4STM

<LINK NO LONGER ACTIVE>

https://community.st.com/0D50X00009Xke6gSAB

Andrei

Nesrine M_O
Associate
Jan 2, 2017 10:06 AM UTC

Posted on January 02, 2017 at 11:06

Hi

Herbert.Jeremy

‌,

The issue has been reported to our MXteam for checking.

Sorry for the inconvenience may bring.

-Nesrine-

We are looking for your wishes about our STM32 products,ecosystem and community:

<LINK NO LONGER ACTIVE>

asergeev
Associate
Jan 10, 2017 3:21 PM UTC
Posted on January 10, 2017 at 16:21

https://community.st.com/0D70X000006SK0JSAW

 
stm32cube-t
ST Employee
Jan 16, 2017 12:53 PM UTC
Posted on January 16, 2017 at 13:53

Dear Users,

This issue (encountered on MAC and Linux OS only) will be fixed with STM32CubeMX 4.19 next release.

Best regards

Alain VIEILLARD
Visitor II
Jan 18, 2017 4:20 PM UTC
Posted on January 18, 2017 at 17:20

Dear User,

Indeed, this is a regression introduced by Ac6 into the v1.13.

A fix is already under implementation. As temporary solutions, the 2 following workarounds are proposed :

1 – Workaround #1:

In the following post, the user reverted the installation (back to V1.12) and it solved the issue.

http://www.openstm32.org/tiki-view_forum_thread.php?forumId=7&comments_parentId=4390#threadId7

How to revert : Help menu >> Installation Details >> Installation History tab >> Select the V1.12 configuration >> Revert

2 – Workaround #2:

  1. Navigate to <SW4STM32_INSTALL>/plugins/fr.ac6.mcu.externaltools.arm-none.win32/tools/make;

  2. Make a backup of the folder;

  3. Remove the files:

echo.exe

msys-1.0.dll

msys-iconv-2.dll

make/msys-intl-8.dll

msys-regex-1.dll

msys-termcap-0.dll

sh.exe

Sorry for inconveniences.

Best regards,

Alain

Joachim SUSS_O
Associate
Jan 18, 2017 10:23 PM UTC
Posted on January 18, 2017 at 23:23

Good evening ,

I've a similar issue on my IDE (eclipse), I use STM32CubeMX (the lastet, updrade done 18 January 2017).

During compilation I've this message on eclipse

23:17:50 **** Incremental Build of configuration Debug for project Horloge_CC ****

make all

Building file: ../Src/crc.c

Invoking: MCU GCC Compiler

/home/joachim/workspace/Horloge_CC/Debug

arm-none-eabi-gcc -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32F746xx -I'/home/joachim/workspace/Horloge_CC/Inc' -I../Drivers -I../Middlewares -I../Drivers/STM32F7xx_HAL_Driver -I../Middlewares/USB_Device_Library  -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF'Src/crc.d' -MT'Src/crc.o' -o 'Src/crc.o' '../Src/crc.c'

/bin/sh: 1: Syntax error: '(' unexpected

Src/subdir.mk:66: recipe for target 'Src/crc.o' failed

make: *** [Src/crc.o] Error 2

23:17:50 Build Finished (took 63ms)

I've done a similar project without cube with no problem. I use linux Debian (3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux)

Who can help  me ?

Regards

Joachim

john doe
Senior III
Jan 18, 2017 11:51 PM UTC
Posted on January 18, 2017 at 23:51

select your eclipse project in Project Explorer, then right click

choose 'Properties'

choose C/C++ Build

choose Symbols

change __weak=__attribute__((weak)) to __weak='__attribute__((weak))'

change __packed=__attribute__((__packed__)) to __packed='__attribute__((__packed__))'

Sirma Siang
ST Employee
Jan 27, 2017 11:25 AM UTC
Posted on January 27, 2017 at 12:25

Hello All,

Eclipse plugins has been patched.

You can check for updates, and upgrade to version 1.13.1.201701200843

Kind regards

Sirma

Rastislav Galia
Visitor II
Feb 20, 2017 10:56 AM UTC
Posted on February 20, 2017 at 10:56

Hello,

the problem is present again in 'OpenSTM32 IDE 1.13.1.201701261206', running on Windows 10 64bit

Sirma Siang
ST Employee
Mar 1, 2017 2:33 PM UTC
Posted on March 01, 2017 at 15:33

Hello,

This point is more belong Eclipse plugins.

Could you please go to

http://www.openstm32.org/forums

and open a discussion thread related to this topic ?

Thanks in avance.

Kind regards

Sirma