Open robin-ds opened 9 years ago
Yes it also fails on msys2 bash which I used on Windows. It seems that manually un-escape ( with ( and ) with ) will work. I will fix it.
Any progress on this?
I've encountered the same issue running STM32CubeMX 4.12.0.
Unfortunately, CubeMX2Makefile.py will probably break for every other update of STM32CubeMX, as the project file format changes. Keeping it working will require long term commitment from the original author or the community. Of course, the real solution is for ST to add a Makefile project target for MX.
Sorry guys. I will look into that next week when I put things down. ST keep change things make this difficult to keep updates.
For this issue, just delete -D__weak="attribute((weak))" flag from the C-DEFS, then you will be good depending on the GCC version you are using.
One more thing though.
As of STM32CubeMX 4.13.0, it changed the tool chain directory name from SW4STM32/"Project Name" Configuration to just STM4STM32/"Project Name" so you have to either rename your tool chain directory after STM32CubeMX generates it or you may want to remove the ' Configuration' string from the python script, CubeMX2Makefile.py
@innomatica I've submitted a PR that fixes the C_DEFS quoting issue.
When parsing valueType="definedSymbols" on my Debian system. the .cproject file has the following:
<listOptionValue builtIn="false" value="__weak="__attribute__((weak))"" /> <listOptionValue builtIn="false" value="__packed="__attribute__((__packed__))"" />
This results in the generated Makefile containing:C_DEFS = -D__weak="__attribute__\(\(weak\)\)" -D__packed="__attribute__\(\(__packed__\)\)"
which causes the compile to fail with:
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c:204:1: error: stray '\' in program __weak void HAL_MspInit(void)
Either use the double quotes from the .cproject file or escape the round brackets but not both!!
Strangely, all works well on a *buntu system!!
Found the difference!! The debian system (which fails) is running 4.11.0 and the *buntu system is running 4.10.1