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

You are viewing a reply to CubeMx corrupting the project  

CubeMx corrupting the project

I guess CubeMX simply regen the .project and .cproject each time
this is the 2 eclipse file you are modifying when you add a file folder or do change any c/c++ setting etc ...
so your can see why you are in trouble to add any file or customize any file and you regenerates code.

normaly you should only add code in between
nothing else ! What is definitvely not apropriate to build more complex project starting or keepign playing with cube to do part of the work for you.

It is actualy a shame how the ac6 project is managed if project was directly linking the cube “src” and “inc” instead of having a real folder with linked file
then you would just need to put your extra file in here and voila new file would be added automaticaly (not new folder)

here are some recipe to customize CubeMX project

One simple way i have found to add a couple of file for quick/dirty test is to put file in the cubemx root “inc” folder and incldue fiile in the main


  1. include “myfile.c”


file does not appear in src and depedencies may not work well but for simple and quick project test that’s conveniant .
Sure it’s not the nicest but i do not see simpler alternative.

A more complex way is to mirror “duplicate” the full intilial sw4stm32 folder into some new folder at exact same level
open the mirorred .project and .cproejct search and replace project name by new one (name of the new folder )
that is mandatory if you want to open both project in ecplise as it will not let you open 2 project with same name in same workspace!
Do all your custom file adition setting, etc from no own in the mirror poject , the initial project simply remain for cube gen and will never build due to missing file.

When you need to add an ip etc and regen.if you add file folder include option etc you will need to reflect changes
Grab changes (include new folder files etc.. ...) from original .projects and .cproject by using external diff tools (winmerge/meld)
comparing side by side the file/fodler make it easy an fast.
take care eclipse may not quite like you edit .project and .cproject file when project is iopen (close project or eclispe)

If you like to do many loo with CubeMX , I strongly recomend to use git localy or whatever scc you like or always backup ioc and full project prior to regen code!
CubeMX can easily trash a lot of work when regenerating ,
it will already trash all what not in between user code
It may even trash what in between user define zone (when changing cubemx version or when starting to add rtos etc ... changing some ip or config option)

if you need to customisze a file that is not meant to be by user (hal drivers etc ) then copy it where you like under your project folder (it maybe directly into src)
remove the orignal linked file or exclude it from build (ilinked file removal can corrupt the full project) so it is wise to backup/commit prior to try  !
add /link the new file now if needed.

You can also miror the full thing and use directory + file compare to keep the customized project in track, that may be more work to diff each time but it’s even safer.


Newest Forum Posts

  1. Firmware Installation Process Issue by valkundesuyash@gmail.com, 16:14
  2. STM32F746-Discovery by stanandrzej, 13:55
  3. Can't debug by deksnys4life, 08:16
  4. Can't download StdPeriph library during project creation by klopi90, 2019-12-09 08:46
  5. Building project - subdir.mk error by nupurkohadkar1997, 2019-12-06 18:10
  6. openOCD Wrong device detected by maxim221, 2019-12-06 12:32
  7. STM32429I_Discovery board with printf float support problem by johannes.visser@msc-technologies.eu, 2019-12-05 16:08
  8. malloc heap issue with CubeMX Project by johannes.visser@msc-technologies.eu, 2019-12-05 16:04
  9. Debugger not working by Daniel Jack Morley, 2019-11-27 21:46
  10. Compiler change problem by Lucian Pop, 2019-11-20 17:41

Last-Modified Blogs