forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 18
Project Setup: Command Line
Jamie Smith edited this page Aug 28, 2022
·
9 revisions
This page will show you how to take an existing Mbed CE project and build it using command line tools.
- Open a terminal in the project directory.
- Make sure you have the needed Python requirements:
python3 -m pip install -r mbed-os/tools/requirements.txt
(use python instead of python3 on Windows) - Create and enter a build directory:
mkdir build && cd build
- Run CMake:
cmake -GNinja -DCMAKE_BUILD_TYPE=Develop .. -DMBED_TARGET=<your mbed target>
- Valid options for the MBED_TARGET option are any supported Mbed OS board target, such as
LPC1768
orNUCLEO_F429ZI
- The Develop build type is recommended for normal development work, but there is also the Debug build type which disables optimizations, and the Release build type which disables debug information.
- Valid options for the MBED_TARGET option are any supported Mbed OS board target, such as
- Build the project by running
ninja
- If the project has an executable which can be flashed, run
ninja flash-<executable>
to upload it to a connected device.