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

Starting a new project from scratch

I have been playing around with example projects in SES (I'm using SDK 15.2.0, SES version 3.52a).

Now  wish to start a project from scratch, and import libraries from the SDK.  I'd like to do this because I prefer to import the files/libraries I need instead of copying example projects - then I'd end up with a ton of libraries/files that I don't need.

I haven't been able to find a proper guide for starting a project from scratch. My questions are

1. Is there a guide somewhere describing how to start from scratch, and what fundamtental files (like sdk_config.h for example) need to imported.

2. Is there an easy way of importing packages? Say I wanted to import nRF_BLE or nRF_Libraries, how do I do this? (The obvious way is to make a folder and copy all the files, but is there an  easier way)?

3. What is the recommended practice regarding the SDK being part of version control?

Thanks :)

  • I will provide you with an answer tomorrow (10/09/2018)

  • I prefer to import the files/libraries I need instead of copying example projects - then I'd end up with a ton of libraries/files that I don't need.

    But each example only include those libraries that it actually requires.

    Say I wanted to import nRF_BLE or nRF_Libraries

    but "nRF_Libraries" is the "ton of libraries/files" that you said you wanted to avoid!

  • Perhaps I wasn't clear . I meant how do I import specific liibraries, when I'm starting a project from scratch?

    If i had a new project I had just created, how do I import nRF_BLE. for example?

    I suppose one could just take a copy of the examples and reuse them, but then, those examples import several libraries - some of which I may not necessarily need. This is why I'd rather start a project from scratch and import only the libraries I need.

  • 1. Not that I know of. But I would recommend you to start with the template project, which only has three fundamental include statements. However it has a lot of files added, .c files in the Project Explorer window and the paths to header files in Project 'template_pca10040'->Edit Options->Common->Preprocessor->User Include Directories. I wouldn't worry too much about all these files, since the compiler only adds the included files to the final executable.

    2. The way I would approach this is to focus on the code itself, and based on that, add the drivers and libraries needed. The way to do this is to add the .c files in the Project Explorer window and the path to the header files as explained above, and eventually add include the header files into the main file. However, in the template project this is already done for a lot of drivers and libraries (without being included into main). Remember to enable the appropriate settings and peripherals in the sdk_config.h file when adding functionality to your code.

    3. The common way is to initialize the repository in the folder of the project, for example if using the template project, initialize it in examples/peripheral/template_project. That is where the changes are made. Then you can share your project, and others can download the appropriate SDK and put the project into it.

    Best regards, Simon

Related