Skip to content

Commit 4f0dc1b

Browse files
committed
Add instructions on how to use Arduino as mbed library
1 parent bf6e647 commit 4f0dc1b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

mbed-os-to-arduino

+9-3
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@ xargs -n 1 < ./BUILD/$BOARDNAME/GCC_ARM/.include* | sed -e 's#./mbed-os#{build.c
2424
arm-none-eabi-ar rcs BUILD/mbed-core-$BOARDNAME.a `xargs -n 1 < ./BUILD/$BOARDNAME/GCC_ARM/.link_options.txt | grep "\.o" | grep -v "main.o"`
2525
cp BUILD/mbed-core-$BOARDNAME.a $ARDUINOCORE/libs/libmbed.a
2626
cd mbed-os && find . | grep "\.h" | xargs -I % cp --parents % $ARDUINOCORE/../../cores/arduino/mbed
27-
#cd BUILD && find . | grep "\.h" | xargs -I % cp % $ARDUINOCORE/../../cores/arduino/mbed
2827
cp ./BUILD/$BOARDNAME/GCC_ARM/.link_script.ld $ARDUINOCORE/linker_script.ld
2928
cp ./BUILD/$BOARDNAME/GCC_ARM/mbed_config.h $ARDUINOCORE/
3029

3130
# add #include "mbed_config.h" in "mbed.h"
3231

33-
# TODO: mbed_config? should be part of the variant?
32+
openocd -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg -c "init" -c "reset init" -c "halt" -c "flash write_image erase ./BUILD/$BOARDNAME/GCC_ARM/mbed-os-program.elf" -c "verify_image ./BUILD/$BOARDNAME/GCC_ARM/mbed-os-program.elf" -c "reset run" -c shutdown
3433

35-
openocd -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg -c "init" -c "reset init" -c "halt" -c "flash write_image erase ./BUILD/$BOARDNAME/GCC_ARM/mbed-os-program.elf" -c "verify_image ./BUILD/$BOARDNAME/GCC_ARM/mbed-os-program.elf" -c "reset run" -c shutdown
34+
35+
##################
36+
37+
Using Arduino as an mbed library
38+
39+
echo -e "arduino/cores/arduino/main.cpp\n arduino/cores/arduino/mbed/\narduino/libraries/" > .mbedignore
40+
#add ARDUINO_AS_MBED_LIBRARY=1 to macros section in mbed_app.json
41+
echo "https://github.com/arduino/ArduinoCore-mbed#bf6e64771ebe20285b0364756dff856ebbc679dc" > arduino.lib

0 commit comments

Comments
 (0)