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?

  • One of the biggest issue of nRF SDK is the "include searching path". They are really messy. I think Nordic need to re-organize the directory structure and the syntax used while including a header file. I have few suggestions for Nordic:

    (1) Use sub-directory name in the #include syntax. Sometimes it is better to use "#include <dirA/module.h>" instead of "#include <module.h>" and add full path of dirA to the include-searching path.

    (2) For each component in the components directory, there is no need to create so many sub-directories. Take "components/ble" for example, there are totally 12 subdirectories there. So, we probably need to add 12 paths in the searching path. A better way is to simplify the structure such as putting most of the .c and .h files directly under components/ble/ instead of components/ble/xxxx/. For the ble_services folder, sure, we can keep it.

    The above two rules can be applied to the whole nRF5 SDK. If Nordic can do this for the next SDK release then your issue will be gone.

    Btw, do you notice that sdk_config.h is getting bigger and bigger (12,954 lines so far). This is definitely not a good thing for software engineering.

    Robert.

  • Hey Robert,

    I fully agree with point (1), but I have to disagree with point (2), by putting all the modules in a single folder we loose the architectural oversight inherent in the current SDK folder structure and the accompanying SDK API documentation. 

    sdk_config.h is huge and growing, that's why the CMSIS Configuration Wizard is necessary. 

    Cheers,

    Håkon.

  • This is the way I do it too. Alternatively you can init git on the whole SDK and add the files and folders that you do not use to gitignore. 

  • Hi Haakonsh,

    Thanks for your comment. My intention is to reduce the number of folders by merging some sub-directories, not to put "all" modules in a single folder. That would make every one crazy if all files are in a single folder.

  • FWIW, the search path chaos isn't limited to the Nordic SDK -- the NXP Kinetis Development Studio and corresponding SDK suffers a similar problem. 

    In addition to (or in lieu of) your suggestions, Nordic could offer a "New Project Wizard" that sets up all the search paths for you.  I'd be fine with that.

Related