.. | |||
cores | 3 years ago | ||
profiles | 1 year ago | ||
tests | 1 year ago | ||
toolchains | 1 year ago | ||
upload_methods | 1 year ago | ||
CheckPythonPackage.cmake | 3 years ago | ||
README.md | 2 years ago | ||
UploadMethodManager.cmake | 1 year ago | ||
app.cmake | 1 year ago | ||
mbed-run-greentea-test.in.cmake | 1 year ago | ||
mbed_create_distro.cmake | 1 year ago | ||
mbed_generate_config_header.cmake | 2 years ago | ||
mbed_generate_configuration.cmake | 1 year ago | ||
mbed_greentea.cmake | 1 year ago | ||
mbed_ide_debug_cfg_generator.cmake | 1 year ago | ||
mbed_profile.cmake | 3 years ago | ||
mbed_set_linker_script.cmake | 1 year ago | ||
mbed_target_functions.cmake | 1 year ago | ||
mbed_toolchain.cmake | 1 year ago |
In order to replace the traditional Mbed tools, we are adding CMake support to allow the generation of build systems instructions to build Mbed OS as a library.
This is still at the experimental stage and still in development. It does not yet completely replace our current build tools. If you find a bug, please report it or raise a pull request as contributions are welcome!
Mbed OS is built as collection of all core libraries. Application project executables can be linked with the mbed-os
library (which includes the core libraries of Mbed OS) and optional mbed-os-
prefixed libraries depending on the additional features required by the projects and supported by the Mbed target.
The list of optional libraries for each component can be seen in the CMake input source file at the root of each component directory.
The following features are not yet supported and will be progressively added:
bare metal
)The full profile with the selected printf and C libraries.
Only a limited set of targets is supported at the moment.
The following targets are supported:
The post build operations are supported for the following Mbed boards: LPC1114, LPC1768, ARCH_PRO, LPC54114, LPC546XX, FF_LPC546XX, CY8CKIT064B0S2_4343W, CYTFM_064B0S2_4343W, CYSBSYSKIT_01, ARM_MUSCA_B1, ARM_MUSCA_S1.
Arm Compiler 6 and GNU Arm Embedded toolchains are supported.
Supported examples can be identified by the presence of a top level CMakeLists.txt
input source file.
Prerequisities:
tools/cmake/requirements.txt
From the application root or wherever mbed-os.lib
is found, run the following command to:
Ninja
build system
mbedtools compile -m <mbed-target> -t <toolchain>
CMAKE_BUILD_TYPE
can overridden with Mbed specific values: Develop
(default value), Release
and Debug
.
mbed-tools
will pass -DCMAKE_BUILD_TYPE=<supported-build-type>
for you when using the --build-type
optional argument of the build
subcommand as follows:
mbedtools compile -m <mbed-target> -t <toolchain> -b <supported-build-type>
If you're running CMake directly, you may need to pass it in yourself as follows:
cmake -S <source-dir> -B <build-dir> -DCMAKE_BUILD_TYPE=debug
Install prerequisites suggested in the previous section and follow the below steps to build:
Set your current directory to the test suite directory
Run the following command for the configuration CMake module to be generated
mbedtools configure -t <TOOLCHAIN> -m <MBED_TARGET> --mbed-os-path /path/to/mbed-os
cd cmake_build/<MBED_TARGET>/<PROFILE>/<TOOLCHAIN>/ && cmake ../../../.. -G Ninja && cmake --build .Or build the test binary with the baremetal profile
cd cmake_build/<MBED_TARGET>/<PROFILE>/<TOOLCHAIN>/ && cmake ../../../.. -G Ninja -DMBED_GREENTEA_TEST_BAREMETAL=ON && cmake --build .
Notes:
mbedtools
implements a sub-command to invoke Greentea testsconnectivity/mbedtls/tests/TESTS/mbedtls/sanity
test requires the configuration file found at TESTs/configs/experimental.json
.mbed
namespace: Mbed CMake targets must have mbed-
prefixFor example: mbed-ble-cordio