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 two short videos (registration required) highlighting:

System Workbench for STM32

AC6 + CubeMX include problems

Hi, I installed SW4 as plugin on Eclipse 64bit on Linux.
I can generate new projects from AC6 plugin correctly, compile and debug them.
I also installed CubeMX that is running well, e.g. generating a simple project for the STM32F401 nucleo.

Then I followed the guide http://www.openstm32.org/Importing+a+STCubeMX+generated+project?structure=DocumentationQuestion for importing the CubeMX project. The problem is that I cannot compile at all, there are tens of errors, with includes that are missing or not found. Tried to edit project settings without succes. What’s wrong? Maybe I’m missing some steps?

Thanks and regards


You try “Refresh” the project? Righ-Click -> Refresh

Yes, and I also cleaned the project.

Could you check the include paths for generated project - take a look at the attached picture (“" is for Windows).

I remember some old posts saying about dos style paths on Linux (not sure). This will explain tens of errors.

Yes, I changed all the “" to “/”, also il the linker path, all the includes appears to be correctly imported in the eclipse project. No way to compile.
Eclipse finds many “could not resolve”, e.g. “RCC_OscInitTypeDef” or “PWR_REGULATOR_VOLTAGE_SCALE1”.

The console says:

/bin/sh: 1: Syntax error: “(” unexpected
Drivers/STM32F4xx_HAL_Driver/subdir.mk:48: set di istruzioni per l’obiettivo “Drivers/STM32F4xx_HAL_Driver/stm32f4xx_hal.o” non riuscito
make: *** Drivers/STM32F4xx_HAL_Driver/stm32f4xx_hal.o Errore 2

Is there any working tutorial for using CubeMX projects under Linux?
We have to deveop under linux, and we moved to STM32 boards because of the good tool CubeMX... but now it is useless.

I don’t know if CubeMX generate correct initialization code under Linux. Maybe you can ask ST support for this.
Checking the release notes for STM32CubeMX v4.10.0 only Windows is listed as supported OS

Supported operating systems and architectures
 Windows® XP: 32-bit (x86)
 Windows® 7: 32-bit (x86), 64-bit (x64)
 Windows® 8: 32-bit (x86), 64-bit (x64)
Software requirements
The Java Run Time Environment 1.7 (version 1.7_45 or newer) must be installed. More
information on installation requirements and procedure can be found in the STM32CubeMX
User Manual (UM1718).
For Eclipse plug-in installation only, install one of the following IDE (on Windows OS):
 Eclipse IDE Juno (4.2)
 Eclipse IDE Luna (4.4)
 Eclipse IDE Kepler (4.3)
here is the link http://www.st.com/st-web-ui/static/active/en/resource/technical/document/release_note/DM00107607.pdfQuestion

If this helps, RCC_OscInitTypeDef is defined in file stm32f4xx_hal_rcc.h This file is located where CubeMX downloaded the HAL libraries, e.g:
From what I know CubeMX will copy those files in the same directory where .ioc project is located (from what I remeber).

I looked on the make files from one project but this was not generated using CubeMX. On the files I check all paths use “/” except the linker script that use “" (-T”..\STM32F401VEHx_FLASH.ld”)

In Debug directory you have one general makefile then in each subdirectory another makefile. You can take a look inside of this makefiles how the paths looks like.

the error /bin/sh: 1: Syntax error: “(” unexpected

Is caused by the command line that is not quite valid containing parentheses

the full command line is

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -D _ _ weak=attribute ( ( weak ) ) -Dpacked=attribute ( ( packed__ ) ) -DUSE_HAL_DRIVER -DSTM32F401xE “-I..\..\..\Inc” “-I..\..\..\Drivers\STM32F4xx_HAL_Driver\Inc” “-I..\..\..\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy” “-I..\..\..\Middlewares\ST\STM32_USB_Device_Library\Core\Inc” “-I..\..\..\Middlewares\ST\STM32_USB_Device_Library\Class\HID\Inc” “-I..\..\..\Drivers\CMSIS\Include” “-I..\..\..\Drivers\CMSIS\Device\ST\STM32F4xx\Include” “-I..\..\..\Inc” -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -o “Drivers\STM32F4xx_HAL_Driver\stm32f4xx_hal_gpio.o” “..\..\..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c”

that parts is causing the issue
-D”weak=attributeweak -Dpacked=attributepacked

that should be quoted in some way if started over sh
i just found the same issue with eclipse/mars on window7 with latest cubemx generated code.

This is due to how the 2 symbol are defined.
Strange are this symbosl for weak and packed required anyway it work wihout ?

if you switch the tool chain builder from “gnu make” to CDT internal one that one shall be fixed

the post build step command line is also causing issue with eclipse internal builder

arm-none-eabi-objcopy -O binary “${BuildArtifactFileBaseName}.elf” “${BuildArtifactFileBaseName}.bin” && arm-none-eabi-size “${BuildArtifactFileName}”

that is cos of the && use “;” instead of && that will do to seperate and start several post/pre build command (shall be ok even with gnu make builder)

All that are maybe more CubeMX .cproject issues than ac6 itlsef.

you may recreate your own eclipse project (using cross cgc or ac6 toolchain ) based on the cubemx ac6 project and files.
create your project aside cubnemx folder and then link all file and folder as it is done on ac6 or atollic project.

i’ve done that even before ac6 was supported by CubeMX using the attolic generated codes.
it maye look painfull first time but as all project have same stucture it easy to re-use copy paste and addapt the base project.

I’m confident that is working under linux (i have doen it for several project with a different eclispe arm plugin and same project build on win7/linux plaftrom)

Hello, thank you for you comments.

cipriansalageanu, it is true that officially CubeMX doesn’t supports Linux, but in the reality it is written fully in Java, and Java is OS-independent, and in fact it works smoothly also on Linux just launching it with “java -jar SetupSTM32CubeMX-4.10.1-RC2.exe”. But probably there are some lines not well programmed that cause the output project files of CubeMX to be not OS-independent: with a very small afford CubeMX can be corrected and distributed officially for every OS.

diabolo38, I already tried you method without success. The problem was that I didn’t “rebuild/freshen” in the “index” menu of the project. Then it works.

But I wanted a solution that allowed me to generate smoothly projects with CubeMX, add my code, and eventually update the configurations with CubeMX without copying code around.

So I can write the steps for everyone that uses the Workbench from Linux:

  • From CubeMX, in the “project settings” and code “generation tab” you can select “copy....” (case (A)), or “add...” (case (B)). Once generated the project for SW4STM32, before opening the Workbench navigate to the project folder (e.g. named “test”), then go to “test/SW4STM32/test Configuration”, and edit the hidden file .cproject.
  • Inside that file, find “..\STM32F401RETx_FLASH.ld” and change to “../STM32F401RETx_FLASH.ld”.
  • Find if the flags “weak=attributeweak” and “packed=attributepacked” are present or not, and eventually add single quotes and change them to “’weak=attributeweak’” and “’packed=attributepacked’”.
  • Then, in the “Include paths” list look for the “Inc” path and change it to “../../../Inc”. The other paths must be changed according to you choice in CubeMX discussed before: in the case of (A) just add “../../../” in front of every entry, so e.g. change “Drivers/STM32F4xx_HAL_Driver/Inc” to “../../../Drivers/STM32F4xx_HAL_Driver/Inc”; in the case of (B), just change every “" to “/” in the paths, so they e.g. change “....../../../../STM32Cube/Repository/STM32Cube_FW_F4_V1.8.0/Drivers/STM32F4xx_HAL_Driver/Inc” to “../../../../../../STM32Cube/Repository/STM32Cube_FW_F4_V1.8.0/Drivers/STM32F4xx_HAL_Driver/Inc”.

After these steps, open the Workbench, import the project, and it should compile perfectly. If you generate again the code from CubeMX, you must edit again the .cproject, close the Eclipse project, repoen it, and eventually rebuild the indexes.

You can do these steps also from the GUI Eclipse, but the edits directly on the .cproject files can be easily automatized: I will write a simple script for it.

The debug also works, but before you must add the Openocd rules for udev, e.g. with https://github.com/arduino/OpenOCD/blob/master/contrib/99-openocd.rulesQuestion

Hope this will help someone, and it can serve also as suggestions for developes.

Just one thing is not working in the Workbench: the “debug” works correctly, the “run” button instead doesn’t program and the console says:

invalid command name “program Debug/test.elf verify reset exit”

Any idea?

I have the same problem, I am still working to solve it.

Until we release a fix, you can use the “Debug” instead of “Run” to program you code with GDB.
Sorry again.


This bug has been reported. This is a command line compatibility problem between Windows and Unix format. It will be fixed in the next update release. Can you confirm me that you’re running the Linux version of System Workbench ?

Sorry for inconvenience.