Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Custom Board definition

I am starting an experimentation effort with Nordic Mesh SDK. I am using Segger Embedded Studio.

I can open/compile/download the Mesh SDK examples.

I wish to start to modify the supplied examples, and I have a few question related on how to and "best practice" to achieve the following.

  1. Create a copy of an existing example, so I can mess it up without affecting the whole MeshSDK and the linked nRF5_SDK. Can you tell me if it is enough to copy the example folder and rename it? (may be because all the files are linked with relative paths with no exceptions?). Or there is a way to export a project and re-import it along with some sort of refactoring to change its root name?
  2. I need to work using different board definitions (NOT only with a single new one named/referenced as BOARD_CUSTOM). Of course I can create all the correct "boardnames.h" files (deriving them from the closest one from your SDK: pca10056.h for instance) in the nRF5_SDK_15.2.0_9412b96\components\boards folder, but then what? Do I need to modify the board.h and board.c files to add the elif switches and potentially add some specific code to the board.c to support custom functionalities? I really feel not at ease when messing with the SDK files, I rather wish to keep my own custom code completely separated from the SDK... Can you comment/suggest something?
  3. Once I will have the custom board definitions ready and available by means of some #define like BOARD_PROJECT_A, BOARD_PROJECT_B, which is the correct way to select the board? I read that one can have the #define inherited by MANUALLY messing inside the project definition XML file (light_switch_dimming_server_nrf52840_xxAA_s140_6_1_0.emProject for instance)?? Is that the preferred way to work? Can you comment/suggest something?
  4. Same question as #3: how to switch a project from nRF52840 chip to nRF52832 and vice versa? Again need I to manually modify the XML project file?

I tried to find how to proceed browsing the developer network and the internet, but I found partial answers and usually not recently posted.

Can you give me the right hints and/or point me to the right documentation for these "basic" topics?

Many thanks in advnace and

 Best Regards

Davide De Nardis

Parents
  • Hi,

    1. Copy and rename an existing example folder would be enough.
    2. I suggest that you make a custom_board.h and in that file you have a new switchboard for including the correct board file. You can have custom_board.h and all custom board files in an include directory within your project instead of in an SDK folder, and that way you can implement the switchboard and all board files without altering the SDK.
    3. It sounds a bit strange that you would have to do this manually. What change is this, I might be able to find a way to do that from within SES. If it is only what preprocessor define to use for the board then you could just change it in the "Common" options for the project. You should find "Preprocessor Definitions" there under "Code" -> "Preprocessor".
    4. The way we do that for our SDK examples is that we have one project file for each device, but they share the same source files. That means you must update all the project files with new include paths or source files, however. Alternatively automate the process of propagating changes from one project to the others.

    Regards,
    Terje

Reply
  • Hi,

    1. Copy and rename an existing example folder would be enough.
    2. I suggest that you make a custom_board.h and in that file you have a new switchboard for including the correct board file. You can have custom_board.h and all custom board files in an include directory within your project instead of in an SDK folder, and that way you can implement the switchboard and all board files without altering the SDK.
    3. It sounds a bit strange that you would have to do this manually. What change is this, I might be able to find a way to do that from within SES. If it is only what preprocessor define to use for the board then you could just change it in the "Common" options for the project. You should find "Preprocessor Definitions" there under "Code" -> "Preprocessor".
    4. The way we do that for our SDK examples is that we have one project file for each device, but they share the same source files. That means you must update all the project files with new include paths or source files, however. Alternatively automate the process of propagating changes from one project to the others.

    Regards,
    Terje

Children
No Data
Related