This is a docker image source for compiling mbed code. https://hub.docker.com/r/ukitomato/mbed
- Compiler: GNU Arm Embedded Toolchain
- cli: mbed-cli
$ docker pull ukitomato/mbed
$ echo 'alias mbed='docker run --rm -ti -v $(pwd):/working -w /working ukitomato/mbed mbed' >> ~/.zshrc
- if you want to create new project
$ mbed new mbed-os-program
$ cd mbed-os-program
$ vi main.cpp
#include "mbed.h"
int main()
{
// Initialise the digital pin LED1 as an output
DigitalOut led(LED1);
while (true) {
led = !led;
thread_sleep_for(BLINKING_RATE_MS);
}
}
$ mbed compile -m LPC1768 -t GCC_ARM
$ cp BUILD/BUILD/LPC1768/GCC_ARM/mbed-os-example-blinky.bin /Volumes/MBED/
- if you want to add exist project
$ mbed add .
$ cd project-floder
$ mbed compile -m LPC1768 -t GCC_ARM
$ cp BUILD/BUILD/LPC1768/GCC_ARM/mbed-os-example-blinky.bin /Volumes/MBED/
- if you want to import exist project
$ mbed import https://github.com/ARMmbed/mbed-os-example-blinky
$ cd mbed-os-example-blinky
$ mbed compile -m LPC1768 -t GCC_ARM
$ cp BUILD/BUILD/LPC1768/GCC_ARM/mbed-os-example-blinky.bin /Volumes/MBED/
Version | Description |
---|---|
1.0.0 | create docker mbed image |
Yuki Yamato [ukitomato]