How To Perform Installation of Board Support Package in PlatformIO

To make the support of WisBlock Core modules in PlatformIO easier we created a small script that installs or updates RAKwireless WisBlock modules in PlatformIO BSP's This script does not install the required BSP's (platform and package), it only patches already installed BSP's.

đź“ť NOTE: Download the patch package from RAK_PATCH.zip You will need it during the installation or update.

First Install

Install PlatformIO

First of all, install Visual Studio Code which is a great and open source tool, and you can download it here:

https://code.visualstudio.com/

After installing VS code, you can search PlatformIO and install it in the Extensions item:

KHM-060-01.png

After installing PlatformIO, you can see the PlatformIO icon and open it as follow:

KHM-060-02.png

Once PlatformIO installation is finished, you have to get the BSP's. Before you can use the WisBlock Core modules with PlatformIO you need to install the original platforms:

  • RAK4631 => install nRF52 platform
    KHM-060-03.png
  • RAK11200 => install ESP32 platform
    KHM-060-04.png
  • RAK11300 => install Raspberry Pi RP2040 platform
    KHM-060-05.png

After the required platforms are installed, follow the steps as shown in Update

Update

After updating or installing the nRF52, ESP32 or Raspberry Pi RP2040 package do the following steps:

  1. Open or create a project that uses the updated platform.
  2. Compile the project so that PlatformIO is installing the packages belonging to the platform
    • Ignore the Unknown board ID or variant.h: No such file or directory errors until the following patch has been applied
  3. Patch the platform and package
    • Unzip the contents of RAK_PATCH.zip into folder RAK_PATCH in your PlatformIO installation folder.
Paths on different OS:  
Windows %USER%\.platformio\
Linux ~/.platformio/
MacOS /Users/{Your_User_id}/.platformio/

Example (Windows 10):

KHM-060-06.png

Install the patch

Open a terminal in the .platformio folder and execute python ./rak_patch.py

Example (Windows 10 terminal):

KHM-060-07.png

Example (Linux terminal):

KHM-060-07.png

OK, you've install and configure PlatformIO for WisBlock successfully.

Example:

  • Now, let's try to compile an example of WisBlock using PlatformIO. We use the RAK13007_Relay_G5LE-14-DC3 example in this document:

https://github.com/RAKWireless/WisBlock/tree/master/examples/common/IO/RAK13007_Relay_G5LE-14-DC3/

Just copy the source code of the .ino file into the main.cpp of the PlatformIO project we just created:

KHM-060-09.png

Then compile it by click the compiling icon at the bottom tool bar as follows:

KHM-060-010.png

KHM-060-011.png

We've compiled this example successfully!

đź“ť NOTE: As same as Arduino IDE, there is an upload icon on the right of compiling icon which can be used to upload the compiled firmware into your device.

 

bernd-giesecke.png

Bernd Giesecke

Electronics Engineer, 23 years of experience in industrial and automotive HW and SW R&D. Supporting Arduino open-source community since 2014.

Updated