6 years, 7 months ago.

How to add RTOS library into an exist project

Hi,

I created a PC uart project in online complier, then export it in my local PC, and setup build environment by using Keil MDK5,

In local project folder, I can see there is OS folder name "mbed", the PC uart project works.

But now, I would like to add thread function in my local project, I check the example project in online complier, looks like another library name "mbed-rtos" is required.

So my question is how to add mbed-rtos to my local project? Maybe one method is to create a thread example project and then export from example project, BUT, do we have another more official way?

thanks!

1 Answer

6 years, 7 months ago.

Easiest is to install Mbed CLI. Then run in your project folder:

$ mbed add https://os.mbed.com/users/mbed_official/code/mbed-rtos/

You probably need to include the mbed-rtos folder in your build process in MDK.

However, I'd suggest you to move over to Mbed OS 5 (latest release) which comes with RTOS built-in. You can do this through mbed CLI as well, via:

$ mbed remove mbed
$ mbed add mbed-os