NCS project setup

Hi experts,

I am in the process of upgrading the projects based on nRF52SDK to nRF connect SDK. Previously, we used to store the entire nRF52 SDK along with our custom code into our version control system to make sure we do not accidentally change the SDK. Because, if any changes are made, that would show-up during committing our changes.

What is the ideal way of setting this up for NCS ? I followed the nordic tutorial and I can compile and run the programs but a bit confused on how this should be arranged for the source control tools.

For Example:

The NCS is installed at:
C:\ncs\v2.7.0-rc3\zephyr\modules

But our company specific code resides at a different location and this can be stored in the version control system or source control management.

  1. Is this how this should be arranged and how do you know if you accidentally change anything in the NCS folder ?
  2. How do you update when the new version of NCS is released and is it better to update this when the new version is released ?

    Please provide the best practices when working with the NCS
  • As I understand it 'west init' will 'check out' or 'pull down' the version of Zephyr and NCS that you have requested for your project from the Zephyr/NCS version control.  

    As far as limiting accidental changes, what we do is have multiple people build the release hex file and verify they are binary the same.  Some people use CI/CD system which does a clean pull of the code and build for releases.   For example you could pull down source code in a new directory and do clean builds for release and compare to your working directory at a minimal. 

    We generally do not update NCS or Zephyr unless we have a good reason to do so.  To update you change the version used in the west manifest file and then do a 'west update'. 

    Note the bigger problem is when you need to patch bugs in Zephyr or NCS.  Here we have had to implement a patch system where store patches in our private repo and then have CMake apply the patches as needed.  

    Also be careful with version numbers numbers ending in *.99 will pull the latest version. For example if you are using 2.7.99 then you would pull latest version of 2.7.xx. As such we do not use *.99 version in the west manifest but lock to a specific version. 

Related