Baremetal with cli2

I’m trying to compile a project with the baremetal profile with cli2 (mbed-tools). That doesn’t seem to work, but it can be compiled with cli1 (mbed).

I’ve tried a number of older 6.x versions of Mbed OS, it never compiles with success, though the error messages appear to vary.

I’m running that on Windows 11, python 3.9 is being used.

Should it be possible to compile a baremetal program with cli2? If not, it would be good to have that documented.

Hi,

yes you can. What projects are you trying?

Mbed tools use CMake targets. mbed-baremetal - the application needs to link to this target, not to use any profile or anything like CLI1 does.

Thank you, that helps.

Just to make it clear, in the top level CMakeLists.txt, instead of:

target_link_libraries(${APP_TARGET} mbed-os)

we need to have this:

target_link_libraries(${APP_TARGET} mbed-baremetal)

Regards