2023-11-28 11:50 AM
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.
Solved! Go to Solution.
2023-11-30 12:10 PM
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.
2023-11-28 01:05 PM
You can add projects from outside of the workspace directory to STM32CubeIDE using File -> Import or by opening the .project file.
2023-11-28 01:41 PM
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.
2023-11-29 08:46 AM
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.
2023-11-29 08:47 AM
Thanks Bob, I will do some experimenting with this.
2023-11-29 10:02 AM
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?
2023-11-29 10:04 AM
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.
2023-11-30 01:05 AM
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!
2023-11-30 12:10 PM
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.
2023-12-04 04:36 PM
You are a winner Bob! I tried your idea here and it worked first try. Thanks again