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

How to move an SDK example out of the SDK tree?

This question is a follow on to https://devzone.nordicsemi.com/f/nordic-q-a/38085/how-to-create-a-copy-of-examples-project---segger-embedded-studio.

It's clear that making a copy of an example by copying the example folder will work, but ONLY if the location for your project is in the same position relative in the SDK directory tree as the Examples folder.  The reason for this is that all the c_user_include_directories in the .emProject file are relative references to the location of the emProject file.

What I would like to do is copy the example files into my own directory, totally separate from the SDK, and change the references to SDK files from:

../../../../../../components/boards

to something like

$(SDK)/components/boards

Where $(SDK) references C:\nRF\nRF5_SDK_15.2.0_9412b96 (in my case)

Editing the .emProject file would be trivial by simply doing a global text change of '../../../../../..' to '$(SDK)'.

What syntax would I use in the emProject file (for $(SDK))?   And where would I define SDK?

Parents
  • Success!  Here's what I did:

    I copied the entire example folder (fastfs, in this case) tree to my own directory tree which was separate from the SDK.

    I deleted the .emSession file in the ses folder.

    I editted the .emProject file in the ses folder:

       1. I modified the macros= line from:

    macros="CMSIS_CONFIG_TOOL=.../../../../../../external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar;"

    to:

    macros="CMSIS_CONFIG_TOOL=C:/nRF/nRF5_SDK_15.2.0_9412b96/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar;SDK=C:/nRF/nRF5_SDK_15.2.0_9412b96"

    2. I changed ALL occurrences of "../../../../../.." to $(SDK)

    I saved the file, opened Segger Embedded Studio, Open existing and selected my new .emProject file.

    I then did a Build->Clean Solution

    And then Build Solution as always.  It worked without a hitch.  I haven't tried debugging yet, but all the correct files were referenced so I see no reason it shouldn't work!

  • thank you SO much, this saved me!!

    See attached for extension to the IAR project, took a little more effort -

    NRF5 SDK - IAR Copy Project.pdf

    blinky_A79B.zip

Reply Children
No Data
Related