Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to include dependency files (.h) in nRF5 SDK projects using Segger Studio and GIT

Hoping this is a simple fix.  I'm new to using GIT and I'd like to setup my nRF 5 SDK projects to work with GIT so I can backup and collaborate with others.  I have a few nRF projects that I made keeping the same folder structure in the SDK folder.  I'm using Segger Embedded Studio and managed to get GIT integrated and was able to publish my to projects to GitHub.

I have my .git repository setup at the root of the SDK and it seemed to work as I wanted for pushing the main branch out.  I just had to commit my top level project file (for each project) and it brought in all the .c reference files that were part of my project.  It also brought in the sdk_config.h file as expected, but that one is always setup as a project file.

What I want to do is also include all of the required #include.h files that accompany all the .c files (dependent files, referenced in include directories).  I don't even have an option to manually commit them in SES.  I'm assuming that is because those dependencies are pulled in during compile time.

Is there a way to get all the required files needed to compile your project, without including the entire SDK with it, or manually going through all the folders and picking it apart?

  • Hi,

    I'm not aware of any settings in SES that would allow you to import all dependencies automatically. But is it necessary to have version control on SDK files? My suggestion would be only to track project-specific files. If there are any SDK source files you need to change, you can put those into your project directory before you start tracking them with Git. This approach should also make it easier to migrate your project to future SDK releases if that becomes relevant. 

    Also, if you wish to move the project outside the SDK folder structure, you can do that quite easily by opening the emProject file in a text editor and replace the relative paths with a custom variable as shown below. 

    The SDK_ROOT variable can be added and changed under 'Solution' settings in SES (make sure it's applied to the common configuration)

Related