Bare-metal configuration for a Bluepill board.

Warning

It does not work with the Mbed Online Compiler.

Follow these steps to import and compile them with Mbed CLI:

mbed import https://os.mbed.com/users/hudakz/code/Baremetal_Blinky_Bluepill
mbed compile -t GCC_ARM -m bluepill

main.cpp

Committer:
hudakz
Date:
2020-06-04
Revision:
3:90a9ecd02b47
Parent:
1:57decb93282e

File content as of revision 3:90a9ecd02b47:

/* mbed Microcontroller Library
 * Copyright (c) 2019 ARM Limited
 * SPDX-License-Identifier: Apache-2.0
 */
#include "mbed.h"

// Blinking rate in milliseconds
#define BLINKING_RATE_MS    500


int main()
{
    // Initialise the digital pin LED1 as an output
    DigitalOut led(LED1);

    while (true) {
        led = !led;
        wait_ms(BLINKING_RATE_MS);
    }
}