Open taunomagnusson opened 3 years ago
"requires": ["bare-metal"],
the problem is cli1 uses requires. mbed-tools do not read this at all. You need to link to baremetal CMake target rather.
The error is quite cryptic to understand what is going on. Anyway, requires is for only cli1, you are better with CMake with mbed-tools and select there what your application needs.
Ok, but how do you compile for bare-metal with CMake/mbed-tools if you can't use the "requires" request?
https://github.com/ARMmbed/mbed-os-example-blinky/blob/master/CMakeLists.txt#L25 - instead of mbed-os, use mbed-baremetal CMake target
mbed-tools will actually read "requires" when it generates the baremetal mbed_config.cmake. "requires" (along with the mbedignore files) limit the mbed_lib.json files from mbed-os that are parsed by the tool. You will also need to link to the mbed-baremetal target in your CMake, however. mbed-tools is only responsible for generating the mbed_config.cmake file to generate configuration macros, and for calling a cmake command to build the project. The libraries to actually build need to be specified in the CMakeList files. Hope this helps.
Describe the bug mbed-tools are unable to compile for bare-metal profile.
To Reproduce
Expected behavior Should produce a bare-metal .bin/.elf, but fails with an error in compilation (See screenshot)
Note that compilation with the old CLI1 mbed tools work just fine. I.e. If you do (in the same directory):
=> This will compile succesfully
Compiling for "full" profile also works fine:
=> This will compile succesfully
Screenshots
Desktop (please complete the following information):
Mbed (please complete the following information):
Additional context Add any other context about the problem here.