PlatformIO Community

Mbed example fails to compile

  • Cloned the atmelsam example repo: https://github.com/platformio/platform-atmelsam/tree/master
  • Opened the mbed-events folder in VSCode/platformio
  • Hit compile
  • Received the following error:
    .platformio/packages/framework-mbed/rtos/rtx5/mbed_rtx_handlers.c:20:10: fatal error: mbed_rtx.h: No such file or directory

As an added bonus, when I clicked on the automated search tool for the libraries, it found no such file.

What gives?

If you use bleeding edge examples from the github, do you also have the bleeding edge platform, packages and PlatformIO core installed? Set the upstream version in the project as seen in the docs, pio platform update for a general platform update and pio upgrade --dev for the latest PlatformIO version.

Finally, you should rule out that you have a corrupted mbed-os package installation. Remove the .platformio/packages/framework-mbed and recompile, PlatformIO will automatically redownload it; Make sure enough space is available (was a caveat for me once)

After updating the platform, two of the four environments compiled and two did not. But then I deleted the mbed-os package (twice) and now none of the environments compile.

These are the environments (I’ve tried both the stable and upstream platforms):

[env:samd21_xpro]
platform = atmelsam
framework = mbed
board = samd21_xpro

[env:saml21_xpro_b]
platform = atmelsam
framework = mbed
board = saml21_xpro_b

[env:samr21_xpro]
platform = atmelsam
framework = mbed
board = samr21_xpro
build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT

[env:samd21g18a]
;platform = https://github.com/platformio/platform-atmelsam.git
platform = atmelsam
framework = mbed
board = samd21g18a
build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT

Hey,

“mbed-events” project won’t build on my side, it raise the same error message (Windows or Linux). Seems that the example is outdated. Wrong Mbed version maybe ? or missing mbed configuration ? Does the example compile on your side @maxgerhardt ?

It took me a minute to figure out what max meant by “bleeding edge” – shouldn’t examples be established programs, almost by definition?

But a little more research reveals that the mbed implementations for the SAMD chips aren’t ready for prime time. The platformio site clearly indicates mbed as a framework option – seems to be misleading. That should either be removed or clarified. I mean, if an example doesn’t compile, it’s not really viable.

I would tend to agree, I tried to build using old version of PIO Mbed package, but nothing so far. Either a specific version of Mbed is needed, or a PIO/framework update break it all (or this specific example never work haha, I didn’t try other Mbed example).

It seems that Mbed would work on this platform, but not RTOS related stuff (mbed_rtx header doesn’t exist for any atmel targets in the framework-mbed@4.151.0 folder).

The best course of action would be to open an issue here to warn the developers.