Bare metal with online compiler

I can’t find any guidance on whether or not I can choose bare-metal from the online compiler. When I picked a Nucleo project the mbed lib notice says it’s Mbed2.
So is there a way to choose? Or is it CLI only?

Hello Bill,

I usually try to select a Mbed OS 5 template for the given target (something like mbed-os blinky).
Then I add a new mbed-app.json file to the program with the following content:

    "requires" : ["bare-metal"]

After that the online compiler compiles the Mbed OS 5 project without including RTOS (as bare-metal).

But I surely agree that it would be nice to have bare-metal templates also in the Online Compiler as they are already available in Mbed Studio.

I have tried this on several projects and see no difference with the online compiler.
Can you post a project with this working?
What I am doing is looking at the build results and see that the memory size and RAM requirements are still identical between both scenarios.



I have published an example built for the NUCLEO-F103RB. The results are below:

| Built as bare-metal ||||||| Built with RTOS included |
mbed-os_bare-metal_stm32f103rb blinky-os_stm32F103rb

1 Like

Thank you! I seemed to have been doing it exactly as your example but what I was doing yesterday, it is now working under your example and in my projects.

Your help is very appreciated on here!