Lesson 10: Real-Time OS μC/OS-III

 

About μC/OS Real-Time Operating System

Micriμm's μC/OS (pronounced "Micro C O S") is a preemptive, highly portable, and scalable real-time kernels. μC/OS has three versions:

μC/OS
  • Portable
  • ROMable
  • Very Scalable
  • Preemptive Real-Time
  • Multitasking Kernel
  • Ported over 45 different CPU architecture
  • 6 KB ~ 24 KB RTOS Kernel
μC/OS-II
  • Can manage up to 250 application tasks
  • Provides the following services:
    • Semaphores
    • Event Flags
    • Mutual-exclusion semaphores
    • Message mailboxes and queues
    • Task management
    • Time management
    • Timer management
    • Fixed sized memory block management
μC/OS-III
  • Included all features in μC/OS-II
  • Additional features:
    • Allows multiple tasks to run at the same priority level
    • Round Robin Scheduling of tasks at equal priority
    • Unlimited number of application tasks
    • Unlimited number of kernel objects
    • Unlimited number of priorities (32~256)
    • Low interrupt disable time (near 0)
    • Real-time configurable

 

Licensing

μC/OS-II is provided in source form and μC/OS-III as linkable library for FREE evaluation, for educational use or for peaceful research. If you plan on using μC/OS-II or μC/OS-III in a commercial product, you need to contact Micriμm to properly license its use in your product.

 


Create μC/OS-III Project

  1. Create a new Project in PSoC Creator.
  2. Download RTOS_uCOS-III_V3.03.01.zip, and unzip it into the project folder.
  3. Add RTOS path into the Project
    • From the Project menu, select Build Setting...
    • Expand the tree under ARM GCC XXXX, and click Compiler
    • Add following directories into Additional Include Directories item:
      .\RTOS; .\RTOS\uC-CPU; .\RTOS\uC-CPU\ARM-Cortex-M3\GNU; .\RTOS\uC-LIB; .\RTOS\uCOS-III\Source; .\RTOS\uCOS-III\Ports\ARM-Cortex-M3\Generic\GNU; .\RTOS\PSoC5\BSP; .\RTOS\PSoC5\BSP\OS\uCOS-III

    addRTOSpath s
  4. Add RTOS Library into the Project
    • Expand the tree under ARM GCC XXXX, and click Linker
    • Add following libraries into Additional Libraries item:
      m; :uCOS-III-ARM-Cortex-M3.a
    • Add following directory into Additional Libraries Directories item:
      .\RTOS\PSoC5\LIB
    addRTOSlib s
  5. Create Folders and add RTOS files into your project
    • Right click on the Project in the Workspace Explorer window, then type RTOS as the folder name.
      addNewFolder
    • Select Add ➤ New Folder. Add following folders under RTOS folder
      folders
    • Right click on the RTOS folder that just created, and select Add ➤ Existing Item. Add following files into the folders as shown as blows:
      addRTOSfiles
  6. Copy and paste the content from RTOS_main.c into your main.c
  7. Modify or create the AppTask_xxx based on the project design
  8. Modify the App_TaskCreate() to create all tasks

 

Application Code