Getting Compilation error mbed 6 regarding bare-metal, even though my application doesn't require bare-metal

Compilation error even if you are building a project that is not intended for bare-metal. I am not using the mbed rtos in my project and so I have added it to my .mbedignore file and I keep getting this error in mbed 6 and I don’t get this error in mbed os 5.15.5 which was the version I was using earlier. How do I ensure the below error doesn’t occur in mbed os 6.

[ERROR] library ‘bare-metal’ requires ‘rtos-api’ which is not present
[mbed] ERROR: “c:\program files (x86)\python36-32\python.exe” returned error.
Code: 1
Path: “C:\Projects\mTestBleStartup”
Command: “c:\program files (x86)\python36-32\python.exe -u C:\Projects\mTestBleStartup\mbed-os\tools\make.py -t GCC_ARM -m NRF52840_DK --profile mbed-os\tools\profiles\release.json --source . --build .\BUILD\NRF52840_DK\GCC_ARM-RELEASE”

Thanks,
Ajay

Hello Ajay,

I am not using the mbed rtos in my project and so I have added it to my .mbedignore file.

That isn’t the right way how to do it in Mbed OS 6. To get rid off the RTOS use the bare metal profile rather than adding RTOS to .mbedignore. To accomplish that, add a mbed_app.json configuration file with the following content to the project:

{
    "requires": ["bare-metal"]
}

Best regards, Zoltan

Thanks Zoltan for taking the time to respond. However what is the impact of adding requires “bare-metal”, If I am still going to need other features such as Cordio BLE, mbed event queue etc?

Also requiring bare-metal, doesn’t it mean usually you are operating with limited resources such as static ram and rom? I am using a Nordic BLE module NRF52840 and I am just building a custom bootloader which just needs the ability to flash firmware over UART and over the air. So I am wondering if by requiring bare-metal, are the stack size, heap size and other mbed-os settings adjusted to deal with a limited resources and would I have to update them? If so is there any documentation as to what needs to be adjusted?

Thanks,
Ajay

Hello Ajay,

What is the impact of adding requires “bare-metal”, If I am still going to need other features such as Cordio BLE, mbed event queue etc?

Unfortunaly, I don’t have any experience with the Cordio BLE. The best way to figure out is to make a test. The EventQueue works fine. Have a look for example here (check the mbed_app.json too). What concerns the availability of the other APIs in Bare-metal profile, check the third column in these tables.

Even the bare-metal profile was developed to support low-density devices with less SRAM and Flash it was also intended as a replacement of the Mbed OS 2. So I think even more stack and heap size is available for an application program on the same device in bare-metal than in the full-profile. For additional info regarding the libraries and optimization have a look at Using small C libraries in Mbed OS bare metal.

With best regards, Zoltan

Thanks again for taking the time to respond and I think I have some reading to do based on the links you have mentioned in your response.

Thanks,
Ajay