Skip to main content
Till Rachow
Associate III
August 10, 2018
Solved

STM32CubeMX deletes Src folder..

  • August 10, 2018
  • 24 replies
  • 5884 views

Hi,

When I am generating Code with CubeMX, it will delete my complete Src folder. I always have to recover it. For that reason it will also not generate any new c files once i add a new peripheral.

Tried this on Mac and Windows with latest CubeMx version (4.26.1) and i get the same behaviour in both.

Can anybody help?

Thanks

This topic has been closed for replies.
Best answer by Mohamed Mansouri

Hi,

Thanks for your feedback,

I confirm its a bug, and it will be fixed in next CubeMX version 4.27.0,

Please feel free to contact me for further information,

Best regards,

Mohamed

24 replies

Tesla DeLorean
Guru
September 6, 2018

You understand that's like telling your boss the dog ate your homework, right?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
nico 2010
Associate
September 6, 2018

0690X000006Bze5QAC.pngHi, I notice that in "Settings" one can select in Application structure "Basic" or "Advanced". The first one erase src, the last one not erase src located in Core folder. Hope help someone. I use CubeMX v4.26.

Takemasa
Associate III
September 11, 2018

It seems like my problem has been gone with v4.26. The new v4.27 doesn't have this problem at this moment.

KG?�l
Associate II
September 28, 2018

Just ten minutes ago, CubeMX deleted my entire project without any reason. The version of the CubeMX is 4.26.1. I don't have backup for last couple of days. I made many many changes even today. The project is not even in the Recycle Bin. What kind of team is writing the CubeMX? How this kind of thing can happen? I think it is time to move another brand microcontrollers.

DSarl
Visitor II
October 17, 2018

Same problem, I have 4.26.1,version 4.27 does not appear in "check for updates".

SMisi
Associate II
May 16, 2019

I am still experiencing this issue in CubeMX 5.2.0, this does not seem to be an issue with the .ioc file, since the same file used to work fine before.

IHawk
Visitor II
October 7, 2019

I have had all the contents of my source folder deleted, and not sent to the windows deleted files bin, on a couple of occasions: the first time I thought it was because I didnt have the 'backup previously generated files ' box ticked; but never the less I would have thought that, at the least, prompting before complete deletion would be courteous. Where is this 'backup directory', where it should have gone on the second occasion?, it is mentioned in the manual, but I cant find it, is it imaginary?. I find this behaviour from an official release ST tool astonishing. Are the developers doing it for LULZ?!. I now make a copy of the source folder before touching cube mx. I see there is a new STM cube release, but I don't want to spend time changing horses mid stream in a project, learning the new tool, and then finding that something else is broken. Code Composer studio or Dave would not do this. Thank goodness eclipse keeps a history where stm cube cant silently erase it. Silently erasing the entire source file directory contents is one of the grossest transgressions I can remember of a development tool . Perhaps I should be grateful it didnt reformat something whilst it was at it.

TomJ
Visitor II
June 10, 2020

I can't believe that nearly 2 years after this thread was started this problem still exists! I and running STM32CuebeIDE that has STM32CubeMX 5.6.1.202004052303. I am using a Mac for development.

How I found the issue

  • Create a new project for STM32F103
  • Configure UART using MX Tool
  • Configure FreeRTOS middleware using MX Tool
  • Generate code using MX
  • Write some code
  • Decide to change UART timer source, make the change in MX tool then regenerate code
  • Find that the entire src folder has been deleted!

Am I using this tool as intended? i.e. using the MX tool to make running changes as a project develops. Has anyone dared use this tool for production purposes?

IHawk
Visitor II
August 8, 2020

I am now using the cube mx ide, I loaded an old reference project to see how I dealt with sdram, decided to rename the opened project and somehow ended up with all my source files deleted!. And - naturally, deleted files do not go to the recycle bin -that would be too easy!. It beggars belief that professional programmers would write code that does this - not just delete and send to recycle bin, or rename as .old - but erase from the file system. Do these guys not use the tools that they create?.

IHawk
Visitor II
August 8, 2020

Correction to my previous post, renaming the project did not delete the sources, it just mangled the project. .. all sources appear to be there. Phew. Must remember to always back up everything before using mx.