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

Best Practices for Starting a New Project in SES Based on Example Application

I am about to start a new project for the nRF52840DK using SES in Ubuntu 18.04. I would like to start with an existing application but I don't want to change the original example application that comes with SES in case I get things wrong and need to start a second time. I have been reading the chapter in the SES manual on projects, but it is not clear to me what best practices are:

1) I am guessing I need to start a new "Workspace", and copy an existing example into this workspace. Is there a recommended location relative to $(StudioDir) that this new workspace should be located (aside: where is $(StudioDir) defined? I can't find it in Tools->Options or Project->ContxtMnu->Options). The PrjName.emProject files all use relative addressing for everything needed to build the project. Such as:

      c_user_include_directories="../../../config;../../../../../../components;../../../../../../components/ble/ble_advertising;../../../../../../components/ble/ble_dtm;../../../../../../components/ble/ble_racp;../../../../../../components/ble/ble_services/ble_ancs_c;../../../../../../components/ble/ble_services/ble_ans_c;../../../../../../components/ble/ble_services/ble_bas;../../../../../../components/ble/ble_services/ble_bas_c;../../../../../../components/ble/ble_services/

... for many many lines

Do we need to modify all of these by hand using an editor, or is there some automated way we can copy an example project to a new Workspace, and have the PrjName.emProject file updated automatically? Should we place the new workspace somewhere in $(StudioDir) to make this process easier?

My previous experience had under the File menu, a choice "New->Project->From Existing Project" choice that looked after almost all of the necessary changes of the configuration files. Does SES have something like this? Or is there a recommended best practices way to simplify this task? Sort of related, is there an automated way of making the PrjName.emProject file based on a template, and say a value for $(StudioDir) that will look after most of the boiler plate, compilation flags, etc.?

Finally, is there a link to a tutorial that starts a new project based on an existing project, or should I write one (I need it for future projects for student groups).

Parents
  • Hello,

    It seems like the most commonly used approach is to make a copy of the example project and simply keep it in the same SDK directory as the original one. But as I've tried to illustrate by the screenshots below,  it's possible with relatively few steps to move an example outside of the SDK tree if you can edit the xml formatted project file with a text editor that supports "search&replace".

    Moving SDK example to a different location.

    1. Pick an example project that best fits the requirements and copy it to your workspace.

    2. Open project files you just copied in SES and add a new project macro that points to your SDK copy. To make sure the setting is applied globally for all configurations, open the project settings at the top level ('Solution') and add the macro under the 'Common' configuration. 

    3. Now we can replace the relative source paths with the macro we added in step 2.

    4. That's it. Now you only need to update the SDK_ROOT macro if you want to move the project.

    Example:

    workspace.zip

    Should we place the new workspace somewhere in $(StudioDir) to make this process easier?

    StudiDir can be used if you want to add source files that have been installed through the package Manager in SES.

  • Vidar, thank you; I will give this a try. It is very difficult for me to see the details of the embedded pictures on my machine (my eyesight is not great). I'm guessing, I download the attached zip file, unzip, and add it as a global macro in step 2; I can't make out exactly where to add it from the picture, but I think I might be able to figure it out from the text. Regarding step 3, again I can't make out the details, but I'm guessing the window that is opened is a search and replace window. I'm not used to using a "macro" in a search and replace window; I'm guessing this might be an option specific to SES? Anyways, I will give it a try. Your e-mail has been useful in telling me: 1) there is no automated way, but by: 2) carefully choosing where to copy a project to, and 3) using some of the existing tools with the down-loaded macron, it shouldn't be too difficult.

  • Maybe you did it already, but you should be able to zoom in on the pictures if you click on them?

    again I can't make out the details, but I'm guessing the window that is opened is a search and replace window

    Correct. It's taken from the Notepad++ editor which I don't think is available on Linux. But most code editor should support this.

    Let me know if you are not able to zoom in on the pictures. Then I can make new ones an upload them in a zip file instead.

Reply
  • Maybe you did it already, but you should be able to zoom in on the pictures if you click on them?

    again I can't make out the details, but I'm guessing the window that is opened is a search and replace window

    Correct. It's taken from the Notepad++ editor which I don't think is available on Linux. But most code editor should support this.

    Let me know if you are not able to zoom in on the pictures. Then I can make new ones an upload them in a zip file instead.

Children
No Data
Related