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

Best way for save project

Hi,

I would like to save my project and add something like a version number to it. I use an example from nordic SDK. So in my case I use solution from ...\examples\ble_peripheral\ble_app_uart.

If I press "save all" in SES, only main.c is saved.

But I modify also files such as ble_nus.c, which is saved in folder ...\components\ble\ble_services\ble_nus

Is it possible, to create a folder with all "used and customized files" (.c and .h) in it?

Parents
  • I agree with  that it isn't recommended to modify the libraries or drivers already present in the SDK, at least you shouldn't change the API (the functions in the .h file used to interact with). Since it may break other examples using that library. To copy the content into your own custom library and then modify it, is probably a safer option.

    However, to your question. One approach is is to put your custom libraries inside e.g. examples\ble_peripheral\ble_app_uart, since (I think) this will make them part of the solution and when you press "save all" they will be included. In addition, you could run git init inside examples\ble_peripheral\ble_app_uart which will make it easy to track all the changes you've done.

    Best regards,

    Simon

Reply
  • I agree with  that it isn't recommended to modify the libraries or drivers already present in the SDK, at least you shouldn't change the API (the functions in the .h file used to interact with). Since it may break other examples using that library. To copy the content into your own custom library and then modify it, is probably a safer option.

    However, to your question. One approach is is to put your custom libraries inside e.g. examples\ble_peripheral\ble_app_uart, since (I think) this will make them part of the solution and when you press "save all" they will be included. In addition, you could run git init inside examples\ble_peripheral\ble_app_uart which will make it easy to track all the changes you've done.

    Best regards,

    Simon

Children
  • Hi,

    I´ve copied

    - main.c

    -flash_placement

    -EMPROJECT-file

    to another specific folder. Now, I would like to make the example "ble_app_uart" runable. Of course I got many errors after trying to compile. I have to include all libraries which are used in main.c to my new folder. Is there an easy way for doing this? Or do I have to copy every .h file to this new folder (there are a lot of it)?

  • Check out this ticket which explains how to build an example out of the SDK tree.

    This case may also be helpful.

    Best regards,

    Simon

  • Check out this ticket which explains how to build an example out of the SDK tree.

    I tried this, but it doesn´t works as espected. I did the steps as described in the instruction. But when I do the last step (build solution), I got a few errors. The libraries doesn´t exist.

    For make this working, I have to copy all the folders from SDK (components, external and so on) to my example folder. Sure, because the libraries are all in these folders. Is that the solution the older TO was looking for? In this case, the example folder contains all existing SDK libraries.

    My aim was it, to just serperate my examples and the libraries for just this example.

    So in my case I would like to have two folders:

    1. C:\\ble_app_uart  (with the example in it)

    2. C:\\ble_app_uart\libraries (with just all the needed libraries for the example in it)

    My opinion is, that I then have a very small project folder with just my needed files in it and not a big folder with every libraries from SKD in it.

    Isn´t that the normal way for developing?

  • simon1516 said:

    My opinion is, that I then have a very small project folder with just my needed files in it and not a big folder with every libraries from SKD in it.

    Isn´t that the normal way for developing?

    The normal (at least from what I've seen) and the easiest way of creating a project with the nRF5 SDK is to do it from within the SDK. E.g. inside <..>\examples\ble_peripheral. This is because all the paths in the example projects are relative from the location they are placed.

    Then you can run git init from e.g. <..>\examples\ble_peripheral\my_ble_project, upload my_ble_project to Github, and you can share it with other people. The folder/repo my_ble_project will also contain all your custom libraries. Then they can easily test it, by downloading the appropriate SDK and place it correctly within it.

    What are your main reasons for building it outside the SDK? The end result will not be any different (the compiler will only include the software that is actually being used by the project), and there are no practical differences except for the location of the project and all the paths it's using.

    Are your reason due to preference, and that it is a cleaner approach?

    If you would still like to build it outside the SDK I can help you with that.

    Best regards,

    Simon

  • The folder/repo my_ble_project will also contain all your custom libraries.

    Can you explain me that? I can´t see such folder when I create a copy of example project in  <..>\examples\ble_peripheral\my_ble_project


    However, to your question. One approach is is to put your custom libraries inside e.g. examples\ble_peripheral\ble_app_uart

    If I for example customize a few libraries (e.g.  <..>\components\ble\ble_services\ble_nus). Where should i save the copy? And where do I have to change the path to it?

    It´s okay for me, developing in the SDK environment, but maybe it´s neccessary to seperate the modified files. For example if I would like to upload the project with all modified files. How can I extract them?

    Is there a way, to delete unused .h and .c files from project? There are much included .h files in one project. I don´t know if I need them all.

Related