Multiple applications in a single repo

I've created an application from the nRF maintained example application and now I would like to make a second application that shares drivers and custom board files in a semi-monorepo structure. Is it possible to make mutiple apps in the same repo and build them at will? This is related to my second question: how would you rename the app folder in the example repo and still have it build, flash, etc. particularly when using the VSCode nRF extensions?

Parents
  • Hi,

    There are several ways to organize the your application and SDK, all with some advantages and disadvantages. The approach demonstrated in the ncs-example-application makes the application the center piece, and it depends on all the other components of the SDK. As this is appilcation-centric it may be cleaner to maek a separate project for each application, and just depend on the same drivers and custom baord files in another repo that you add to your west.yml for both your applications.

    Alternatively, you can make paralell application folders. You could rename the application folder if you like, and you can make another application folder in  parallell that you call soemthing else. If there are problems with VS Code you can try to set the nrf-connect topdir path to where you have the "nrf" and "zephyr" folder, and that should work).

    Another approach could be to keep the SDK (includign your repositories with custom drivers etc) separate from the applications, what is refered to as Freestanding applications. In one way this is perhaps less elegant, but it is more flexible.

  • HI  thanks for the response! Very helpful. Do you mind elaborating a bit on the second option in your response, I.e.

    Alternatively, you can make paralell application folders. You could rename the application folder if you like, and you can make another application folder in  parallell that you call soemthing else. If there are problems with VS Code you can try to set the nrf-connect topdir path to where you have the "nrf" and "zephyr" folder, and that should work).

    when I try to change the application folder name, it breaks the build process, and I'm wondering if there's documentation somewhere shows an example of changing this?

  • Hi,

    I did a test on my end now, by just re-naming the "app" folder ot another name, and that built without any issue, both in VS code and from the command line. Could it be that you forgot to delete the old build folder of did not specify another name (if building from the command line)? If not, can you explain how you build and show the error you get?

Reply Children
Related