Wanted to post an update because we have just merged 2 PRs with semi-breaking changes to mbed-ce master branch.
The first PR (#410) makes the choice of mbed-os vs mbed-baremetal global to the project instead of per-target. While this was one of the new features provided by the Mbed CLI 2 build system, it had proven to be very difficult to maintain, and caused a lot of subtle issues (#304, #407) as it basically required libraries outside of the core mbed-os to choose whether they would build against baremetal or RTOS, and if they chose baremetal, they had to build in a binary compatible way whether or not the RTOS was enabled.
I do not believe there were too many big use cases for this feature, as generally a project will either want to use mbed-os everywhere or mbed-baremetal everywhere depending on the size of the MCU. And if given a choice between weirdness that affects users unexpectedly, and slightly less features, I will always choose slightly less features. I think that a lot of the ways ARM went wrong when maintaining Mbed OS came down to that…
Anyway, in terms of breaking changes, if your project uses mbed-baremetal, you will need to add a new JSON option, like:
{
"target_overrides": {
"*": {
"target.application-profile": "bare-metal"
},
}
Otherwise your app will start building with Mbed RTOS. Note that we did add an error in mbed_set_post_build()
if you try to link mbed-baremetal in this case, so it should be pretty obvious when you need to make this change. Thanks a ton to @ccli8 from Nuvoton for driving this fix!
The second breaking(ish) change was driven by a new warning in CMake 3.33. You may have seen it if you tried to build Mbed with the latest CMake version, where it complains about calling enable_language() before project(). To fix this, I had to split up app.cmake into two different files, where the second one has to be included after the project()
call in your application. Basically, you will have to change
include(mbed-os/tools/cmake/app.cmake)
into
include(mbed-os/tools/cmake/mbed_toolchain_setup.cmake)
project(MyMbedApp
LANGUAGES C CXX ASM)
include(mbed_project_setup)
As you can see, since we had to make breaking changes anyway, I also took the chance to give app.cmake a less generic name . For more info about the change, see the PR. I say this one is breaking-ish because old code will still work, it will just print several warnings saying that you need to update it.
Besides these changes, we’ve still been hard at work on Mbed CE in the last few months, and have made changes including:
- Spinning up our own echo server (https://mbed-ce.dev) to replace the ARM one which shut down, rendering the network tests nonfunctional
- Adding support for the mcuboot bootloader (thanks to @zhiyong and Sam Lefebvre for help!)
- Merging fixes for the BLE HCI driver security issues (see here for details)
- Merging the Renesas ESP32 AT command driver into Mbed (thanks to @chris-snow!)
Note that as this forums inches closer to shutting down, I will also be posting these updates on the Mbed CE Discussions forum.