Skip to main content
CAlve.1
Associate
October 1, 2020
Solved

STM32CubeIDE deleting src folder

  • October 1, 2020
  • 10 replies
  • 2679 views

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.

This topic has been closed for replies.
Best answer by CAlve.1

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.

10 replies

CAlve.1
CAlve.1Author
Associate
October 1, 2020

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
October 1, 2020

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""."
CAlve.1
CAlve.1Author
Associate
October 1, 2020

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

Markus GIRDLAND
ST Employee
October 2, 2020

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
CAlve.1AuthorBest answer
Associate
October 2, 2020

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
December 11, 2020

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.

Cartu38 OpenDev
Graduate II
December 11, 2020

Have you move project from one host to another ?

"C:/" sounds like Windows OS

"/Users" sounds like Linux OS

DJC
Senior
December 11, 2020

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!