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

How to build project outside of the SDK folder?

The way the example projects, including the app_template are structured, they will only build if inside the SDK folder.

The main problem I find is that the Board Support Package directory seems to be referenced a lot.

So my current workaround is to create a folder called projects at the same level as "examples" and retain the same structure e.g with the bsp folder and then the sub folder for ble_peripheral

But ideally I'd like to move all the source code outside the SDK folder entirely, as its not idea from a source control point of view

Also, I don't really use the BSP setup or functions on custom boards, so I'd prefer if I didnt need to have it at all, but at the moment to get the code to compile without the BSP seems to require a lot of time and effort.

Does anyone else have any good strategies to separate the project source code from the SDK?

Parents
  • Hi Roger, Which compiler are you using ?

    If you are using KEIL, you may need to use absolute path for the SDK files. You can replace all path with ".." for example "............\components" to the absolute path. They are in .uvprojx file.

    If you are using gcc, you can simply modify the SDK_ROOT in the makefile file.

  • Sorry.I should have said, I'm using GCC with SDK 12.1

    After reading your answer,and looking at SDK 12.2, I see in 12.2 that the bsp has effectively been moved to components/boards; which is better than in SDK 12.1

    But the templates and examples seem to use boards.c and which includes boards.h, which includes the board as defined in the Makefile -DBOARD_XXX

    As I'm using a custom board I've defined BOARD_CUSTOM and have custom_board.h but I'd rather not put this in the SDK tree, as its hard to keep under source control (git)

    I tried putting custom_board.h in the root of my project, but that path is not included by the Makefile. (I could add it, but I don't think think thats the best option)

    So the next logical place for custom_board.h appears to be in the config folder; and placing board_custom.h there, seems to compile.

    Where would you recommend putting board_custom.h ?

Reply
  • Sorry.I should have said, I'm using GCC with SDK 12.1

    After reading your answer,and looking at SDK 12.2, I see in 12.2 that the bsp has effectively been moved to components/boards; which is better than in SDK 12.1

    But the templates and examples seem to use boards.c and which includes boards.h, which includes the board as defined in the Makefile -DBOARD_XXX

    As I'm using a custom board I've defined BOARD_CUSTOM and have custom_board.h but I'd rather not put this in the SDK tree, as its hard to keep under source control (git)

    I tried putting custom_board.h in the root of my project, but that path is not included by the Makefile. (I could add it, but I don't think think thats the best option)

    So the next logical place for custom_board.h appears to be in the config folder; and placing board_custom.h there, seems to compile.

    Where would you recommend putting board_custom.h ?

Children
No Data
Related