cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE deleting src folder

CAlve.1
Associate II

I modified some functionalities using the MX interface in the STM32CubeIDE, saved and generated a new code and my core/src folder is gone.

I've seen people complaining about this problem on older releases.

Tested in another project (modifying settings in the MX interface and generating code) and the problem did not happen. What might be wrong with this specific project? I've been working on it for a long time and never had any problem.

Right now I have Version: 1.4.2 Build: 7643_20200813_1322 (UTC), tried to update but no updates available.

1 ACCEPTED SOLUTION

Accepted Solutions
CAlve.1
Associate II

Fixed.

The problem happened while cloning from git . I had to reorganize some files, so the project was cloned into "...\project\" instead of the original "...\Project\" (capitalization). Renaming the folder to the original name solved the problem. Curiously, the only folder to be lost was the "...\Project\Core\Src", while everything was under the same "problematic" path.

Maybe I did something obviously wrong, but certainly I wasn't expecting this behavior.

I copied the project to other locations, with the 'wrong' folder name, and the problem does not happen. Happens only on the complete original path.

If you would like more details I'l be glad to reproduce as the problem and give you whaterver you need.

Thanks.

View solution in original post

10 REPLIES 10
CAlve.1
Associate II

Just checked:

Last time the .mxproject and .cproject files were modified was on Aug. 20 and last time the .ioc file was modified was on Aug. 24, and no problems there. Can't figure out what changed since.

TDK
Guru

If you just saved the IOC, shouldn't it have a more recent modification date? Something doesn't add up here.

If you feel a post has answered your question, please click "Accept as Solution".

I meant before the bugged code generation, so up to that time the MX code generation was working fine.

Markus GIRDLAND
ST Employee

It's true that this was a thing in older versions of CubeIDE so I was hoping this would have been solved.

Do you have a way of reproducing the issue?

If you copy the project to another workspace does the same thing happen? And if it does, can you share the project with me?

CAlve.1
Associate II

Fixed.

The problem happened while cloning from git . I had to reorganize some files, so the project was cloned into "...\project\" instead of the original "...\Project\" (capitalization). Renaming the folder to the original name solved the problem. Curiously, the only folder to be lost was the "...\Project\Core\Src", while everything was under the same "problematic" path.

Maybe I did something obviously wrong, but certainly I wasn't expecting this behavior.

I copied the project to other locations, with the 'wrong' folder name, and the problem does not happen. Happens only on the complete original path.

If you would like more details I'l be glad to reproduce as the problem and give you whaterver you need.

Thanks.

DJC
Senior

I managed to recover from this (after trying loads of things, like deleting everything and recloneing, deleting the workspace, etc. )

I found that the issue only occurred on new git commits, so I used gits blame feature to find differences on project files and rolled back the .cproject and .mxproject to the last time it was changed.

There were a lot of changes in that commit, but i suspect the issue was in .mxproject a number of lines that differ like this:

SourcePath#0=/Users/me/project/Core/Src

SourcePath#0=C:/Users/me/project/Core/Src

That commit also does this with "SourceFile, HeaderFile" and various other parameters.

So, yeah. Like @Community member​ says. Its some sort of path stuff.

If you don't have a previous copy of the file,.. you might struggle, but perhaps there is a way to generate them again and someone else can answer that.

Have you move project from one host to another ?

"C:/" sounds like Windows OS

"/Users" sounds like Linux OS

ah!... while what you say should be blindingly obvious to me... it actually helped me to remember now: I pushed some code from a mac that day. thanks!

Glad to get some explanation so.

But I consider too projects should be portable from one host to another. Some room for improvement here on ST side I guess.