PlatformIO 3.0: Improved integration with ARM mbed ecosystem

Dear @mbed-dev,

We have great news for ARM mbed developers! :clap: We have refactored Build System for ARM mbed OS/Framework that doesn’t require initial pre-compilation for the ARM mbed source code (we need it in PlatformIO 2.0).

The first results are impressive! :open_mouth: PlatformIO 3.0 Build System requires a few seconds to build WHOLE ARM mbed hal/lib.

Library/Module Managment

PlatformIO 3.0 supports ARM mbed yotta module.json manifest and its features (dependencies, extra includes, etc). Also, you can publish existing yotta module to PlatformIO Library Registry without creating PlatformIO’s library.json manifest. For example

platformio lib register https://raw.githubusercontent.com/ARMmbed/ble/master/module.json

See ble library in the registry.

BBC micro:bit

We also introduced support for BBC micro:bit. See build output of microbit-hello-world example with the new PlatformIO 3.0 Library Build System in action

New Build System

PlatformIO 3.0 will allow you to work directly with GitHub - ARMmbed/mbed-os: Arm Mbed OS is a platform operating system designed for the internet of things and don’t depend on The PlatformIO Team when new release of ARM mbed OS is out. The only one requirement is to generate “build flags” map for targets that later will be used by PlatformIO Build System. Each new framework-mbed package contains this list. However, if you switch to another version of ARM mbed OS, you need to update them using special simple Python script (we will put it directly to the package).

PlatformIO 3.0 has not been released yet. We plan to release it in a few next weeks when will receive feedback from the beta-testers that they don’t have any problems with the previous PlatformIO 2.0 based projects.

We invite you to help us with testing new build system for ARM mbed. How to try it?

  1. Install PlatformIO 3.0 using the latest development branch.
  2. If you already use PlatformIO 3.0 and development platform with ARM mbed framework is installed, then need to delete it using platformio platform uninstall command.
  3. Install development platform
    # for Atmel SAM
    pio platform install https://github.com/platformio/platform-atmelsam.git
    # for ST STM32
    pio platform install https://github.com/platformio/platform-ststm32.git
   # etc...

The full list with PlatformIO 3.0 Development platforms.
4. Check that the version of “Package framework-mbed” is 2.123.0 or above.

pio platform show ststm32
pio platform show atmelsam
# etc...

Examples


Regards,
The PlatformIO Team

1 Like

I love this!! Thank you Ivan —

FYI ARM mbed just had a 5.1 release…

You can use mbedOS/RTOS with this feature branch. See example https://github.com/platformio/platform-ststm32/tree/develop/examples/mbed-rtos

Is it possible to maintain project compatibility between v2 and v3? I have one with customized build flags and they don’t get honored for v3.

In file included from src/main.cpp:2:0:
lib/WIZnetInterface/WIZnetInterface.h:20:20: fatal error: wiznet.h: No such file or directory
#include "wiznet.h"
^
compilation terminated.
scons: *** [.pioenvs/disco_f051r8/src/main.o] Error 1

Works for v2:

build_flags = -I$BUILD_DIR/WIZnetInterface/WIZnet -I$BUILD_DIR/WIZnetInterface/Socket -I$BUILD_DIR/WIZnetInterface/DNSClient -I$BUILD_DIR/WIZnetInterface/DHCPClient -I$BUILD_DIR/HTTPClient/data

Where did you get this WIZnetInterface library?

I recommend to create library.json manifest for this library and submit it to PlatformIO Registry. See examples, platformio-libmirror/configs/mbed at master · platformio/platformio-libmirror · GitHub

If you need to specify extra includes, please use Redirecting...

The problematic part is that the library supports 3 different chips and one is selected by appropriate #DEFINE. With online mbed it’s usually forked to particular project and modified locally.

You can resolve it with PlatformIO. Please specify

"build": {
    "flags": "-D ..."
}

And create 3 different manfiests. You can make PR to our libmirror repository.

Thanks.

Works well with my Mbed LPC1768.
And pretty easy to use… :slight_smile:

1 Like

Used new build system to get mbed v123. Please note this board will be GA with PIO 3.0, it is not supported by currently available mbed v121 we have in general use.