Status

Date

Doc Version

Applicable

Confidentiality

RELEASED

16 Jan 2025

1.0

1.5.2, ….

PUBLIC

Wirepas provides the complete environment to compile and flash your device with your application based on the Wirepas Stacks. To start the development of your custom application, you may refer to this tutorial [1].

By default, you may develop your application inside the SDK tree, by placing your code in the source/example_app/ folder.

In recent SDK repository, Wirepas provides a mechanism to better handle your codes using your own Code Versioning Tool (like GIT) using the Out-Of-Tree compilation capability.

 

Out-Of-Tree

The principle is to separate the SDK folder from your own application, in order to help keep your project organized and make updates easier. Only a few steps are required.

Your custom working directory 

  • Create your custom app folder structure according to your needs.
  • Adapt your custom makefiles according to the new location of your files.
  • Clone the SDK in your custom folder

All your requirements (libraries, headers, etc.) can be placed in a custom location of your choice.

Create a custom makefile

In your custom root folder, create a new makefile with the following content:


# ROOT directory (the build paths will be relative to the SDK directory)
ABSOLUTE_ROOT_PATH := $(shell pwd)

# Where is the sdk checkout
SDK_PATH := ./wm-sdk-2_4

# Default board and app targets
target_board?=my_custom_board
app_name?=my_custom_app
 
# Optionally specify a custom board directory, relative to this Makefile. 
# Uncomment to enable
# custom_board_directory?=board/

# Specify custom build directory, relative to this Makefile. 
build_directory=build/

ifdef custom_board_directory
       board_directory=$(ABSOLUTE_ROOT_PATH)/$(custom_board_directory)
else
       board_directory=board/
endif

.DEFAULT_GOAL := all

.DEFAULT:
    +make -C $(SDK_PATH) -f makefile $@ \
           target_board=$(target_board) \
           build_directory=$(ABSOLUTE_ROOT_PATH)/$(build_directory) \
           app_name=$(app_name) \
           board_directory=$(board_directory) \
           app_extra_folder=$(ABSOLUTE_ROOT_PATH)

it is important to notice the parameters in the make command:

  • SDK_PATH: where to look for the SDK files
  • app_name: name of the app you want to compile
  • app_extra_folder: where the customs app folder is located. Note that in that folder, there must be at least one subfolder (corresponding to one custom app) or multiple apps (with multiple subfolders)
  • build_directory: where the output of the compilation will be stored
  • target_board: is the board on which the code will executed

 

In order to keep the SDK versioned inside you project tree, you can clone the SDK as submodule. To learn about git submodules, you can refer to [2]

For instance, while being in your custom working directory, in your terminal, you can proceed as follow:

git submodule add https://github.com/wirepas/wm-sdk-2_4.git
cd wm-sdk-2_4
git checkout rel_1.5.3_2_4
cd ..

Then, you need to commit the addition of the submodule to your GIT repository:

git commit -am 'Add Wirepas SDK module'
git push origin <your branch>

Later on, when cloning your Git repository, use git clone <GIT_ADDRESS> --recursive so the SDK will be also pulled using the exact same version as set above.

 

Please note that while the examples are provided for our 2.4GHz Mesh profile, same is applicable to our 5G Mesh profile. Git repository to be used is https://github.com/wirepas/wm-sdk-5g.git.

References

[1] How To Install SDK and Build an Application

[2] Git - Submodules

Revision History

Date

Version

Notes

16 Jan 2025

v 1.0

The first version.

Legal Notice

Use of this document is strictly subject to Wirepas’ Terms of Use and Legal Notice.

Copyright © 2025 Wirepas Oy