CDE RTOS Hacking: Show it as an RTOS component

Technically, a normal user component can implement any RTOS. This is what I did with the Micrium MicroC/OS-II component. That way the component shows up in the ‘Embedded Components’ group. But how to make it showing up as RTOS component inside the ‘Operating System’ group as the FreeRTOS component? What I want is this: to show the RTOS component under the ‘Operating System’ group of my project:

FreeRTOS in the Operating System Group

FreeRTOS in the Operating System Group

First I was thinking this is accomplished with marking the component category as ‘Operating System’ in the Component Wizard:

Component Category

Component Category

But: this has not the desired effect. All what this does is to list the component under the ‘Operating Systems’ group in the Components Library View:

Components Library with Operating Systems

Components Library with Operating Systems

I have found two ways to show the component under the ‘Operating Systems’ group:

1. CDE Component Wizard (Eclipse based)

With MCU10.2, there is a CDE (Component Development Environment) Component Wizard. Here you can create a new component using the menu File > New > Other. This gives the following dialog:

New Component with Wizard

New Component with Wizard

Pressing Next, and I can select to create an RTOS:

New RTOS Component

New RTOS Component

This will then everything set up in order to show the component in the ‘Operating Systems’ group.

This approach has two disadvantages:

  1. You need a special professional license from Freescale to create such an RTOS component. Otherwise the option as shown in the above dialog is disabled.
  2. This approach only works for new components. So as for myself who already had created a component and want to move it to a ‘real’ RTOS component, this approach will not work.

2. Hacking the Bean File

The approach I used was to hack the *.bean file of the component (see this post about all the different files of a component). All what I have to do is to add


to the <Options> XML element. Of course replace NameOrIDofMyRTOS with your own ID. I’m using ‘FreeRTOS’ for my FreeRTOS component.

Below is the beginning of my FreeRTOS.bean file which has the <OperatingSystemId> on line 14:

<?xml version="1.0" encoding="UTF-8"?>
<Author>Erich Styger</Author>
<Category>Operating Systems</Category>
<BW_HelpFiles>,Properties,Methods,Events,"Typical Usage","Application Notes"</BW_HelpFiles>

As a side note: on line 13 () is what I have set as Component Category in the Component Wizard.

Usage of OperatingSystemId

With having the <OperatingSystemId> defined, I can use it in my components. For example if I want to do different things depending on the RTOS I’m using, I can write:

%if defined(OperatingSystemId) & OperatingSystemId = 'FreeRTOS'
/* include RTOS header files */
#include "FreeRTOS.h" /* for vTaskDelay() */
#include "task.h"
%ifdef WaitOSms
%if defined(RTOS) %-RTOS defined in properties, e.g. uCOS-II
#define %'ModuleName'%.%WaitOSms(ms) \
#define %'ModuleName'%.%WaitOSms(ms) \
%if defined(OperatingSystemId) & OperatingSystemId = 'FreeRTOS'
%'ModuleName'%.%Waitms(ms) /* no RTOS used, so use normal wait */

I used the above code in my Wait component.

Note: Checking for the <OperatingSystemId> has one disadvantage: I need to know all the different IDs. How to deal with ‘unknown’ operating systems? There is a solution for this with the ‘RTOS Adapter’ concept of Processor Expert which is not covered in this post.

One Instance Only, please!

The other thing to set for an RTOS component: that there can be only one instance of it:

One Instance of component

One Instance of component

That way there can be only one RTOS component in the project.

Note: Only having one RTOS usually makes sense, and this is what I have right now anyway. But I’m thinking about special applications where I might want to have multiple operating systems, say a real time one and a non-realtime one. Not sure how Processor Expert will support this, but I guess I’ll have to find it out :-).


In order to show a component in the RTOS Processor Expert project group, I need to set the <OperatingSystemId> in the component .bean file. I can use that ID to perform custom things in my other components depending on which RTOS is used (if I know their ID). Additionally I should set the ‘one instance only’ flag for the component.

Happy RTOS Hacking 🙂

1 thought on “CDE RTOS Hacking: Show it as an RTOS component

  1. Pingback: CDE Hacking: Where is my stuff? A dissection… | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.