cancel
Showing results for 
Search instead for 
Did you mean: 

Debug problem after installing git

Ragbagger
Associate II

I am rather new to STM32CubeIDE so this may be a dumb question. I have built a project and have it all working fine and SWD debugging via STLink2 is working great. The problem arises when I share the project via git and it gets put in a git repository outside the workspace. Once it is in the git repository I can still edit and build the project but when I go to debug it is a no go. Selecting debug as>STm32 C/C++ Application now does nothing. I expect this is because the files are not actually in the workspace anymore so debug can't find them. I'm guessing there is something I need to do to the debug configuration but I'm not sure what. Either that or I implemented the git repository wrong. Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Ragbagger
Associate II

OK, I have a solution. If I create the local git repository in the project directory in the workspace then git leaves the files in the workspace and all is fine when opening a debug perspective. There is probably a solution for when the project files are outside the workspace too such as Bob S suggested but I have not tried that yet. Thanks for the suggestions everyone.

View solution in original post

9 REPLIES 9
TDK
Guru

You can add projects from outside of the workspace directory to STM32CubeIDE using File -> Import or by opening the .project file.

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

Also, by default CubeIDE stores the debug "launch" files in the workspace's .metadata directory.  So if you add the project to a different workspace it will not have the associated launch files.

I change this setting so that the launch files are stored in the project directory.  To change this, in your workspace (where you CAN debug), go to the Run menu and select "Debug Configurations".  Select the configuration in the left side.  Then in the right hand side, click on the "Common" tab.  In the "save as" section, change "local file" to "shared file".  It should fill in the file path automatically (I think).  If not, then use the "Browse" button to select the project's "root" directory (i.e. the location of the .ioc file, NOT the workspace directory).  Then add the launch file(s) to your GIT repo and everyone should be able to debug the firmware.

Thanks for the reply TDK but my question has nothing to do with importing  a project at all. The question was about debugging a project who's files are held in a git repository.

Thanks Bob, I will do some experimenting with this.

Installed Git, or Git Desktop?

The latter integrates with the Windows Shell, I'd assume, so it can see what files are changing.

Does behaviour change if you close the app?

Does it impact projects / files not in/under the Repository?

 

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

I suspect TDK suggests using Import as people sharing Cube projects run into all kinds of synchronization issues related to different directory names, paths and users.

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

Your question isn't dumb at all—we've all been there with new tools.

Regarding your STM32CubeIDE issue, try updating paths in Debug Configurations (check C/C++ Application field), ensure relative paths in Git, and consider re-importing the project into the Eclipse workspace. If problems persist, perform a clean build and double-check your Git setup. If all else fails, create a new debug configuration manually. Good luck!

Ragbagger
Associate II

OK, I have a solution. If I create the local git repository in the project directory in the workspace then git leaves the files in the workspace and all is fine when opening a debug perspective. There is probably a solution for when the project files are outside the workspace too such as Bob S suggested but I have not tried that yet. Thanks for the suggestions everyone.

You are a winner Bob! I tried your idea here and it worked first try. Thanks again