Mbed-tools and cmake and using mbed-os library in own files

  • Although the
mbed-tools configure -m ... -t GCC_ARM --mbed-os-path absolute_path_to_mbed-os

command did not report any error, unfortunately, the

mbed-tools compile -m ... -t GCC_ARM --mbed-os-path absolute_path_to_mbed-os

did not work. Since I’m on Linux I cannot tell you whether it works on Windows or Mac.

  • However, the following series of commands (using a symbolic link to the shared mbed-os directory) solved the issue for me on Ubuntu 18.04:
mbed-tools new -c prog01
cd prog01
ln -s absolute_path_to_mbed-os mbed-os
mbed-tools configure -m LPC1768 -t GCC_ARM
cmake -S . -B cmake_build/LPC1768/develop/GCC_ARM -G Ninja
cmake --build cmake_build/LPC1768/develop/GCC_ARM