This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how do I duplicate a Segger Embedded Studio project

I am new to the nRF9160. I just started evaluating the board and I am able to create, compile, and download the sample projects and the asset tracker examples. I want to be able to copy a solution/project and rename it so I have a completely new solution/project but starts out as an existing working project.

for example hello_world --> new_project

I can then work with and edit new_project and be a completely new project with all of the working pieces from hello_world.

I am sure there is a straight forward way to do this. I just did not see it.

I appreciate any help you can give.

Parents
  • Simon

    I do NOT want to make a project from scratch. I have a working project "asset tracker" that has most of the components and operations I need.

    It is a very complicated program with may levels of folders and files that all interact and a complicated build system.

    I want to duplicate that file with a new name "my name" and build it. That way I know exactly what is working and where everything is but going forward it a new project with a new name. It just started out identical to asset tracker.

    If I start from scratch the odds that I can create the exact asset tracker are minimal.

    is there a process to duplicate a project? With all of the great examples that you provide I cannot believe that this has not been solved. surely customers want to start with one of your examples for their application.

  • All you need to do is to simply copy your project folder next to your initial project. E.g if you want to duplicate the project <..>\ncs\nrf\samples\nrf9160\my_project you copy my_project, paste it into <..>\ncs\nrf\samples\nrf9160 and rename it to e.g. my_project2. You may have to clean/delete the build folder in order to build it again.

    You should be aware of several things when copying your project to a new location:

    • If your project depends on changes done to any of the repositories in NCS, you can not copy it into a new NCS without those changes.
      • You should try to avoid changing any of the NCS repos at all costs. E.g. this approach let's you modify configurations for child images. This works for the device tree as well (set(<image_name>_DTC_OVERLAY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/<name>.overlay))
      • If you have to modify the NCS repos, you can make a pull request to the upstream, or use this workflow
    • If your project includes paths depending on your location of the project, it will not work if the folder depth is different. A good practice is to use absolute paths relative to ZEPYR_BASE, like it's done here.
    • If you copy it outside the NCS folder, make sure to set the ZEPHYR_BASE, as well at the toolchain env. variables

    Best regards,

    Simon

Reply
  • All you need to do is to simply copy your project folder next to your initial project. E.g if you want to duplicate the project <..>\ncs\nrf\samples\nrf9160\my_project you copy my_project, paste it into <..>\ncs\nrf\samples\nrf9160 and rename it to e.g. my_project2. You may have to clean/delete the build folder in order to build it again.

    You should be aware of several things when copying your project to a new location:

    • If your project depends on changes done to any of the repositories in NCS, you can not copy it into a new NCS without those changes.
      • You should try to avoid changing any of the NCS repos at all costs. E.g. this approach let's you modify configurations for child images. This works for the device tree as well (set(<image_name>_DTC_OVERLAY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/<name>.overlay))
      • If you have to modify the NCS repos, you can make a pull request to the upstream, or use this workflow
    • If your project includes paths depending on your location of the project, it will not work if the folder depth is different. A good practice is to use absolute paths relative to ZEPYR_BASE, like it's done here.
    • If you copy it outside the NCS folder, make sure to set the ZEPHYR_BASE, as well at the toolchain env. variables

    Best regards,

    Simon

Children
No Data
Related