How to add a modified SDK file to my project?

I'm using VS Code and the nRF Connect extensions to build a project that is derived from a sample app. It was created as a freestanding project, so the SDK is shared with other projects.

I need to modify a couple of files in the SDK and maintain my changed file in our own git repo along with the rest of the project.

For comparison, in previous projects we used a variant of Eclipse and it handles a private copy like this and excludes the original copy in the SDK from the build.  Is there a similar way in the nRF build?

How can I create a copy of an SDK file in my project that will "shadow" the original file?  Is there a way to exclude the original file and have the build use my private copy?

Thanks.

Ron

Parents
  • Hi,

    I need to modify a couple of files in the SDK and maintain my changed file in our own git repo along with the rest of the project.

    Are the files that you want to modify your project files or some other SDK files? Which specific files do you want to modify?

    For comparison, in previous projects we used a variant of Eclipse and it handles a private copy like this and excludes the original copy in the SDK from the build.  Is there a similar way in the nRF build?

    Were these previous projects also NCS projects?

    How can I create a copy of an SDK file in my project that will "shadow" the original file?  Is there a way to exclude the original file and have the build use my private copy?

    Where is your private copy expected to be located? Are there any specific requirements for the files that need to be changed in terms of location? 

    Best regards,
    Dejan

  • The SDK is installed on my PC at:  C:\Nordic\v2.0.0\

    An example of a file I want to modify is:  C:\Nordic\v2.0.0\modules\lib\loramac-node\src\radio\sx126x\radio.c

    The changes would be to change some hard-coded configuration parameters.

    The previous Eclipse project were not Nordic projects.  I only mentioned that as an example that other IDEs support making shadow copies of SDK files in the project folder.

    My project is in a folder on my C drive and it is tracked in its own git repo.  The modified copy of radio.c should be kept in the same project folder, so it can be tracked in git along with the project folder.  It is okay if the modified radio.c is kept in a separate submodule, if that helps.

    Thanks.

    Ron

  • I've been re-reading the nRF Connect documentation section about the Development Model and "Adding your own code".  Maybe the idea shown in Workflow 3 for an application fork of the SDK might solve my question.  If I understand correctly, my own fork can be private and located in one of my company's github repos.

    I would appreciate all comments about this possible solution, or other possible solutions.

    Thanks.

    Ron

  • Hi Ron,

    In managing the code base, you can find information how to fork a repository which you could then use for your own needs. 
    You could also read about private repositories and topologies, such as T2 Star topology.

    Best regards,
    Dejan

Reply Children
No Data
Related