Skip to content

Instantly share code, notes, and snippets.

@pmcalabrese
Last active September 22, 2018 18:30
Show Gist options
  • Save pmcalabrese/638b1a443dac3547ba19d6e720a4449a to your computer and use it in GitHub Desktop.
Save pmcalabrese/638b1a443dac3547ba19d6e720a4449a to your computer and use it in GitHub Desktop.
Makefile for Mbed OS 2
# Makefile for Mbed OS 2 \
After following the instruction here https://github.com/ARMmbed/mbed-cli#creating-a-new-program-for-mbed-os-2 \
Set GCC_ARM_PATH = "/Users/marco/opt/gcc-arm-none-eabi-7-2018-q2-update/bin" in the mbed_setting.py \
create a file called main.cpp in a folder called src \
edit TARGET and SERIAL_DEVICE_PATH accordingly and you are good to go \
you can dowload it with \
curl -Lo Makefile https://gist.github.com/pmcalabrese/638b1a443dac3547ba19d6e720a4449a/raw/Makefile
TARGET = NUCLEO_F042K6
SERIAL_DEVICE_PATH = /Volumes/MICROBIT
SERIAL_BOUD_RATE = 1152000
compile:
mbed compile -t GCC_ARM -m $(TARGET) --source src --source mbed
clean:
rm -r BUILD
flash:
cp ./BUILD/NUCLEO_F042K6/GCC_ARM/src.bin $(SERIAL_DEVICE_PATH)
serial:
screen $(SERIAL_DEVICE_PATH) $(SERIAL_BOUD_RATE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment