cancel
Showing results for 
Search instead for 
Did you mean: 

Source file dissapeared after re opened a project

CSand
Associate III

Hello,

I'm using STM32CubeIDE to write code for STM32F103C board. Comming back to work on a project that was closed, first main.c file dissapeared. I tried different operations files dissapering one by one, but eventually when I generate code all my files are gone and CubeIDE generate complete new main.c and other files in the SRC folder (see picture - .H files are still there but the .C files not).

Strange thing is, when I open CubeIDE it is like is in the debug mode (see second picture ).

I hope they are just moved somewhere. My backup project is old and there was a lot of code.

Am I doing something wrong? Do we know conditions for this behavior of the CubeIDE interface?

Thanks,

6 REPLIES 6
EJOHA
Senior

Please try and see if there is a local history of the <main.c> file in STM32CubeIDE.

To view history of the file. Select the <main.c> file in the Project explorer view, and right click on it. Then select "Team"->"Show local history"

CSand
Associate III

I was lucky I found I actually had a resonable good backup of the project.

Still I would really like to understand what triggered this behavior of the interface?

EJOHA
Senior

That's good you had a manual backup! Could you please also check if there the history in STM32CubeIDE keeps some old versions of files.

Regarding the reason why the files seemed to be removed I do not know but there has been some issues with CubeMX in STM32CubeIDE which overwrites old files when new files are generated. This is under investigation.

In your case the files seemed to be already removed when you opened the project without generating new files with MX. Is this correct analyze on my side?

You mentioned that the it looked as the IDE was in debug mode when opening the project. Do you know if the C/C++ perspective was opened or was it the Debug perspective?

mattias norlander
ST Employee

Can you please let us know which version of CubeIDE you are using? 1.2.x? 1.3.x? 1.4.0? 1.4.1?

Windows might also get copied use Right Click -> Restore previous versions

CubeMX/IDE tools have a systemic issue related to .IOC parsing and errors (bugs removed, but old syntax now unacceptable) related to changing tool versions, and file/folder destruction. We've seen numerous reports of this, so it's not something I attribute to user error, but rather the constant push to newer versions, and poor handling of legacy project files, transition, and failure/error recovery.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
CSand
Associate III

To answer some questions..

  • I checked and CubeIDE was not opening in debug mode. It was my wrong impression.
  • I am running CubeIDE V 1.4.1 build 7610_20200730_1509
  • Some C files in SRC were removed while operating on the interface. I observed that something isn't working normal and I re-generate from CubeMX and that was when also main.c was replaced with an default source code.