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
Committer:
hudakz
Date:
Thu Jun 04 21:46:13 2020 +0000
Revision:
3:90a9ecd02b47
Parent:
1:57decb93282e
Bare-metal blinky on Bluepill.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 0:a04710facbb6 1 /* mbed Microcontroller Library
hudakz 0:a04710facbb6 2 * Copyright (c) 2019 ARM Limited
hudakz 0:a04710facbb6 3 * SPDX-License-Identifier: Apache-2.0
hudakz 0:a04710facbb6 4 */
hudakz 0:a04710facbb6 5 #include "mbed.h"
hudakz 0:a04710facbb6 6
hudakz 0:a04710facbb6 7 // Blinking rate in milliseconds
hudakz 0:a04710facbb6 8 #define BLINKING_RATE_MS 500
hudakz 0:a04710facbb6 9
hudakz 0:a04710facbb6 10
hudakz 0:a04710facbb6 11 int main()
hudakz 0:a04710facbb6 12 {
hudakz 0:a04710facbb6 13 // Initialise the digital pin LED1 as an output
hudakz 0:a04710facbb6 14 DigitalOut led(LED1);
hudakz 0:a04710facbb6 15
hudakz 0:a04710facbb6 16 while (true) {
hudakz 0:a04710facbb6 17 led = !led;
hudakz 1:57decb93282e 18 wait_ms(BLINKING_RATE_MS);
hudakz 0:a04710facbb6 19 }
hudakz 0:a04710facbb6 20 }