cancel
Showing results for 
Search instead for 
Did you mean: 

How to reasonably use git source control

jagauthier
Associate III

I'm trying to create process for development with CubeMX/CubeIDE projects.

I'm seeing pathing issues that show up when my project is moved. Which also means when it's cloned to another computer.

Simple steps I've done to reproduce this:

Created a new project with CubeMX. It generated the code and then imported to CubeIDE.

Project works and builds.

Now, I move the project to a different directory. (Which also happens when I clone it)

The project can no longer find files in the "Drivers" subfolder.

If I look at one of the files on the original (working) project I can see how it resolves:

 0693W00000Dmq5uQAB.pngOnce I've moved the folder it resolves different and completely changes the pathing:

 0693W00000Dmq6JQAR.pngIn practice will want to push and then clone these projects. However, each attempt ends the same way. The pathing resolves differently than where it was generated.

How can I make this work?

1 ACCEPTED SOLUTION

Accepted Solutions

CubeMX -> Project Manager -> Code Generator -> Copy only the neccessary library files should do that.

View solution in original post

8 REPLIES 8
KnarfB
Principal III

The location vs. Resolved Location looks strange to me. I use git regularily without issues. In my case, each project folder gets its own git repo. The Ressource tab looks like0693W00000DmqiIQAR.png

jagauthier
Associate III

That's generally what the resource tab looks like for me too.

The image above is a specific file in the "Drivers" subfolder, which is not part of the project. It's linked back to the STM32Cube folder where the firmware and driver code it. The issue I am having is with that type of file, not one that's physically present in the folder.

I see. I'm always using deep copies of the lib code (Drivers...). You seem to use Eclipse linked files. Don't know how that could be integrated. Git submodules? Are there advantages of your approach? I like to keep the projects as self-contained as possible.

hth

KnarfB

This is how CubeMX generated the project. I checked to see if CubeMX had a "copy firmware/drivers to project" option but it doesn't seem to.

CubeMX -> Project Manager -> Code Generator -> Copy only the neccessary library files should do that.

Yup, that's the ticket! Thank you so much!

Kmax18
Senior

I find this simple procedure helpful: How to duplicate projects in STM32CubeIDE. Hopefully it solves your issue.

@Kmax18​ this page is not relevant, sorry. The OPs question is about checking projects in version control so that they can be cloned on another computer.