Nios® V Processor Software Developer Handbook

ID 743810
Date 10/31/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

3.3.2.3. Micrium MicroC/OS-II Configuration tips

If you use the MicroC/OS-II environment, be aware of the following properties:

  • MicroC/OS-II BSP settings: The MicroC/OS-II supports many configuration options. All these options can be enabled and disabled with BSP settings.
  • MicroC/OS-II setting modification: Modifying the MicroC/OS-II options modify the system.h file, which is used to compile the BSP library file.
  • MicroC/OS-II initialization: The core MicroC/OS-II is initialized during the execution of the C run-time initialization (crt0) code block. After the crt0 code block runs, the MicroC/OS-II RTOS resources are available for your application to use.
You can configure MicroC/OS-II with the BSP Editor. Figure Enabling MicroC/OS-II Timers and Queues in BSP Editor shows how you enable the MicroC/OS-II timer and queue code. Figure Configuring MicroC/OS-II for Four Timers in BSP Editor shows how you specify a maximum of four timers for use with MicroC/OS-II. The MicroC/OS-II Tcl script below performs the same MicroC/OS-II in these two figures.
Figure 2. Enabling MicroC/OS-II Timers and Queues in BSP Editor
Figure 3. Configuring MicroC/OS-II for Four Timers in BSP Editor

Configuring MicroC/OS-II timer Device using Tcl Script

#enable code for UCOSII timers
set_setting ucosii.os_tmr_en 1

#enable code for UCOSII queues
set_setting ucosii.os_q_en 1

#enable a maximum of 4 UCOSII timers
set_setting ucosii.timer.os_tmr_cfg_max 4