Wirepas provides the complete compilation environment to compile your apps. We rely on Docker and provide the Docker containers with all the necessary tools to compile an application.

Once Docker and SDK folders are installed and ready to use (please refer to this link and this link), follow the below steps to build an application.

1 - Open a WSL2 Terminal, and navigate to your Wirepas SDK folder.

2 - Type below command to build the application in the terminal. Please note that relative path are not supported.

docker run --rm -v $(pwd):/home/wirepas/wm-sdk-PROFILE -w /home/wirepas/wm-sdk-PROFILE -ti wirepas/sdk-builder:v1.5 make app_name=your_app target_board=your_board

NOTES:

  • the “--rm“ command line option is used to automatically clean-up the container’s file system after each build. 
  • The above command uses the application code in the SDK on the local machine to generate the application binary using the docker's build environment. Here are the details of the command format:
    • "<absolute path to your SDK" shall be adapted to point to the location of the Wirepas SDK folder on your local machine.
    • -PROFILE” may be replaced with the profile suffix if any (5G, 2_4Ghz or SubGhz).
    • "app_name=your_app" is the pointing to the application code. In the example, your_app is being compiled.
    • "target_board=your_board" is the selecting the relevant board to compile & build the application code. Modify the config.mk in the application source folder to define the set of compatible boards the application can be built for.  
    • “wirepas/sdk-builder:v1.5”: This tag is used to select the proper Docker image and depends on the SDK version in used. Tag is v1.5 for existing versions.
    • "/home/wirepas/wm-sdk-PROFILE" is the mounting point of the location folder in Docker and should not be changed
    • "make" is the command to compile the application in Docker and should not be changed
    • More details on the build command can be found in SDK documentation here.

 

  • At first execution:
    • docker will automatically download the proper container from dockerhub.
    • You will be prompted to review the license
    • You will be prompted to input or generate Bootloader keys. Please note that for Wirepas 5G Mesh profile, the asymmetric keys are required.

Note: This How To only focuses on having a functional build environment.

Clean the build

Use the following command to clean the build:

docker run --rm -v $(pwd):/home/wirepas/wm-sdk-PROFILE -w /home/wirepas/wm-sdk-PROFILE -ti wirepas/sdk-builder:v1.5 make app_name=your_app target_board=your_board clean

Other parameters are the same as for the build command.

The command is executed as previously done, but with additional tag "clean", to clean the earlier build.

NOTE: You need to clean the build if you modify config.mk  file, in example to change network parameters.

 

Create you own application

You can now start to develop your custom application code and follow the above steps to compile and build the application. You can find more details on how to create you own custom application from the following chapter in SDK documentation.