The Mbed OS bare metal profile offers the same functionality as Mbed OS 2 and allows targets to access features that we have added to more recent versions of Mbed OS. At the same time, it removes the RTOS and provides fewer features than Mbed OS 6, so it’s smaller and therefore suitable for ultraconstrained devices.
So it’s basically a compatible but better version of mbed 2. Same said here.
Anyways, the documentation states that if a project is using mbed-os 5 at a base package but doesn’t have the RTOS enabled via PIO_FRAMEWORK_MBED_RTOS_PRESENT
, it is mbed-os 5.
There is an example at https://github.com/platformio/platform-ststm32/tree/develop/examples/mbed-legacy-examples/mbed-rtos that is mbed-os 5 (via a package selection in the platformio.ini
) and enables the RTOS via the mentioned build_flags
. So, if you remove that (and remove any RTOS reliant code in main.cpp
, you should have mbed-os 2.
If you have further problems with it, we’d need to know which platformio.ini
and code you’re using.
The entire mbed-os framework is compiled and then 99% is discarded at link-time. See PIO compiles everything in MBED framework when RTOS is enabled · Issue #288 · platformio/platform-ststm32 · GitHub and Mbed for STM32 compiles toooooo long. But it shouldn’t take 40 minutes… I think some antivirus by Windows or external is interfering. (See Hang creating new projects. Hang using pio install - #2 by maxgerhardt)
The way to genereally combat this in mbed-os is with .mbedignore
files. There are also helper scripts for that to make it more comfortable.