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

Create a new project in Segger Embedded Stuido

Hello.

Actually I have two qustions, but they are related with the same challenge.

So, I want to develop application using SDK (libararies and config), but starting from empty project. To create empty buildable project for nRF52DK I need to include a lot of necessery files, such as sdk_config.h, boards.c ... etc. So, can you give list of all files, which I need to include in project, to be able to correctly build it, and also which configuration I need to do? For example what I need to do to create project the same as examples/peripheral/template_project?

I also want to know, how to change folder of existing project? For example if I change directory of template_project from examples, how can I repair links to necessery files?

Parents
  • One technique that works for me is described here:

       https://devzone.nordicsemi.com/f/nordic-q-a/28196/graduating-from-example-to-production-project-file-structure

    It's a little bit cheating, but here's the summary.  (Below, I'm using $SDK as a shorthand for the directory containing the SDK of your choice):

    1. Create a "myprojects/" directory under the example directory of your SDK:

    $ mkdir $SDK/examples/myprojects

    2. Copy an example project of your choice into the myprojects directory, renaming it if you wish:

    $ cp -rp $SDK/examples/peripheral/timer $SDK/examples/myprojects/test_a

    3. Open the .emProject inside that directory, e.g.:

    $ open $SDK/examples/myprojects/test_a/pca10040/blank/ses/timer_pca10040.emProject

    Now you can modify, compile and run the app according to your needs.

    I only call this "cheating" because you're still building inside the SDK directory rather than a sandboxed directory of your choosing, but it works.  The biggest advantage of this approach is that you don't need to update all the links to the include files and libraries and whatnot (which is really tedious).  A few points:

    • Theoretically, you could create a symbolic link from $SDK/examples/myprojects into a sandboxed directory of your choosing.  (I haven't tried this).  
    • One advantage of this approach is that myprojects and all code under it is tied to the SDK that its built on.  If you update the SDK, it will be obvious that you need to re-build your code.
    • You might wish to rename your .emProject file (and some of the references inside that file) to your actual project name, e.g. `test_a` in the above example.

    The above approach works for me.  Its quick and easy.  Your mileage may vary.

Reply
  • One technique that works for me is described here:

       https://devzone.nordicsemi.com/f/nordic-q-a/28196/graduating-from-example-to-production-project-file-structure

    It's a little bit cheating, but here's the summary.  (Below, I'm using $SDK as a shorthand for the directory containing the SDK of your choice):

    1. Create a "myprojects/" directory under the example directory of your SDK:

    $ mkdir $SDK/examples/myprojects

    2. Copy an example project of your choice into the myprojects directory, renaming it if you wish:

    $ cp -rp $SDK/examples/peripheral/timer $SDK/examples/myprojects/test_a

    3. Open the .emProject inside that directory, e.g.:

    $ open $SDK/examples/myprojects/test_a/pca10040/blank/ses/timer_pca10040.emProject

    Now you can modify, compile and run the app according to your needs.

    I only call this "cheating" because you're still building inside the SDK directory rather than a sandboxed directory of your choosing, but it works.  The biggest advantage of this approach is that you don't need to update all the links to the include files and libraries and whatnot (which is really tedious).  A few points:

    • Theoretically, you could create a symbolic link from $SDK/examples/myprojects into a sandboxed directory of your choosing.  (I haven't tried this).  
    • One advantage of this approach is that myprojects and all code under it is tied to the SDK that its built on.  If you update the SDK, it will be obvious that you need to re-build your code.
    • You might wish to rename your .emProject file (and some of the references inside that file) to your actual project name, e.g. `test_a` in the above example.

    The above approach works for me.  Its quick and easy.  Your mileage may vary.

Children
Related