Migrating project from online compiler to

We had been using online compiler to compile and generate binary code for our project. The project started back in 2016/2015. I checked library, it was version 2.0. However, the version now is version 6.8 I am trying to migrate project from online compiler to desktop IDE mbed studio and upgrade the library from version 2.0 to current version. However, when I finished the upgrade, it has been giving me format errors in the library. I wonder if the current library compatible with our project developed based on library 2.0.

thanks in advance for the answer!


you probably mean old Mbed2 and new MbedOS6 (6.16 is the latest one).
It depends about what APIs your project use, but in general… Nope, it does not.

  • Serial API was removed and replaced
    BufferedSerial for blocking applications.
    UnbufferedSerial for bypassing locks in IRQ or short of RAM.
    printf,puts and similar functions are noc available in default.
  • wait(1) function was replaced with thread_sleep_for(1000);
  • FunctionPointer was replaced by Callback

and so on…

You can follow compiler errors and repair it one by one. You can found some content about that here on forum.

Full API list - API references and tutorials | Mbed OS 6 Documentation

BR, Jan

Could you post the error message you’re getting? If you mean you’re trying to use binary libraries compiled for Mbed 2, those definitely won’t work with Mbed 6.

Hi Jamie, these are the error i got so far and it only compiled 0.2% currently.

Hi Johnny,

Thanks for the reply. You are right, we are moving from Mbed2 to MbedOS6. The link is very helpful, however it only shows the deprecated API from OS5 to OS6. I wonder if there’s information out there would show the deprecated API moving from mbed2 to mbedOS6?

Thanks in advance!


I remember only this one - Porting a target from Mbed OS 2 to Mbed OS 6 bare metal - Mbed OS bare metal profile | Mbed OS 6 Documentation
But that does not help you a lot, I think.

The errors above are strange, this does not seem to be related to your project but some bad setting of whole project. Try create New empty one or popular Blinky, then copy content (also libraries) of the main from your old project based on the Mbed2. Run compilation and try fix errors. If you will stuck somewhere place the error here I will try to help ASAP.

Good night

BR, Jan

it might be caused by my attempt to migrate the project. The project folder used to contain mbed.bld and MODSERIAL.lib , I deleted mbed.bld and replaced it with Mbed-os, which i downloaded from mbed website. the content in the MOBSERIAL.lib only has one line, it says MODSERIAL#1df6aeea544d. Please let me know if these info would help you figure out the problem I have.


Maybe just create a new blank Mbed 6 project in Mbed Studio and copy over your code?

Note that you will not need MODSERIAL anymore as this feature is now built into Mbed.