cancel
Showing results for 
Search instead for 
Did you mean: 

Standard GitIgnore / Project Setup for Sharing STM32Cube Projects with Github

EPala.2
Associate III

Hi, my team works with STM32CubeIDE and shares projects via github. We've been running into somewhat frequent errors where projects settings don't get shared properly when pulling the files down from github. On the flipside, there are a bunch of automatically generated files that change frequently with builds, code generation, etc, that bloat the git log unnecessarily if they are shared.

Is there a standard gitignore that we should be using for STM32CubeIDE projects. Are there any rules of thumb for how to set up stuff like project folder structure, project variables, etc, such that they get properly shared?

7 REPLIES 7
InsignificantBit
ST Employee

Other than your .cproject, .project, .ioc (if used) and linker file, and obviously the actual project source code, nothing else needs to be version-managed.

Depending on the use case, you can find it convenient to version-control .launch configurations (mainly debugger settings) or project .settings (which contain things like SFR viewer favorites settings), but those are often specific for a single developer.

Thanks. Is there a standard gitignore file for STM32 projects you can share with us? There are a lot of autogenerated file types and it would be much easier to get a comprehensive list straight from the source than to try and account for each filetype manually by browsing through the project 

EPala.2
Associate III

Hey just following up on this again. 

If there is no official gitignore published by ST, does anyone have one they've used in development that has worked for them?

Add this to the .gitignore file

# STM32CubeIDE
.metadata/
.settings/
*.ld

Why are the .ld files on your list? Do you always use the default generated linker file and never add custom sections?

Snorri
Associate

Yes - I used the default linker file - so it's probably a good idea to remove the "*.ld" from .gitignore file. Sorry about that.

The linker file is definitely necessary. It gets generated only during the project creation by CubeMX (whether standalone or built into CubeIDE). If you remove it, it doesn't regenerate it upon building the project, it just throws an error about not being able to find it.