Bare metal example
To enable Mbed OS bare metal, create an mbed_app.json
with the following contents:
{
"requires": ["bare-metal"]
}
To learn about using the bare metal profile on Mbed OS 5, please see the Blinky bare metal example:
/* mbed Microcontroller Library
* Copyright (c) 2019 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*/
#include "mbed.h"
#define WAIT_TIME_MS 500
DigitalOut led1(LED1);
int main()
{
printf("This is the bare metal blinky example running on Mbed OS %d.%d.%d.\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION);
while (true)
{
led1 = !led1;
thread_sleep_for(WAIT_TIME_MS);
}
}