Building a Minimal Nordic Connect SDK "Without" West (This is not a question)

Hello Everybody,

If you're reading this, you're likely in the same boat as me and need to scale Nordic's build process in an environment that doesn't have access to west. Or perhaps you are trying to pair down the SDK to just the minimum components that you'll need for your application. After doing some local testing, you'll probably think that using CMake directly shouldn't be a problem... until you check out the individual submodules and attempt to rebuild the source tree. Then you might find yourself trying to decipher error messages and correlate them to what you've done, asking questions here or possibly on the Zephyr Slack channel, and unsure where to go next.

Hopefully I can help shorten that path of frustration; I currently have a minimal build pulled together to support "Blinky" and will likely have to scale it up as I require additional features. I'm using CMake to generate the build files and Ninja to actually do the compilation, and I've checked the packages out directly from Github rather than using west to manage the installation.

My key takeaways:

  • Rebuilding the source tree is as easy as renaming the submodule level folders and moving them to the correct locations. I was nervous that west might be doing some additional manipulation within subfolders, but thankfully that's not the case (at least for now). This is what my resulting source tree looks like after manipulation

.
├── Application
│   └── src
├── modules
│   ├── crypto
│   │   └── tinycrypt
│   ├── debug
│   │   └── segger
│   ├── hal
│   │   ├── cmsis
│   │   └── nordic
│   └── lib
│       └── memfault-firmware-sdk
├── nrf
├── nrfxlib
└── zephyr

  • There is a dependency on the .git folder within the zephyr SDK. I suspect that the build process is grabbing the release information from here, though that's just speculation at this point
  • You can't fully remove the dependency on west; somewhere in the CMake chain, there's a call to west (perhaps to check that it's a valid version for the build?). So although I'm not using west to manage my build, it still must exist on the path in order to successfully build.
    • If someone finds how we can remove this dependency completely please comment below

Your specific needs might not match this exactly, but hopefully it gets you pointed in the right direction. I'd also throw out the caveat that this isn't a supported process, and these steps may no longer work on a future release of the SDK, so buyer beware.

Good luck everyone.

Related