Project structure with multiple boards and models

I am setting up a project with nRF Connect SDK and want to be sure I am doing things in the best way.

The project will build different firmwares for multiple models of our device. The firmware will run on several different PCBs with different hardware configurations. Each board may have multiple models, but each model will build for one specific board. The boards will probably have a lot of overlap, so it would be beneficial to be able to define a common configuration which is modified for each board.

We will use a script to build all the firmware, so ideally want to pass an argument to cmake defining the model, which is used to determine the correct board in CMakeLists.txt. I am not sure how this would work when creating a new build configuration in VS code though.

Please could you advise on the best way to structure the boards in an nRF connect SDK project, and allow specifying a model which is used to determine the board to use (and provides preprocessor definitions for use in C)

Thanks

Related