Specifications
Figure 10-1: Architecture of MicroC/OS-II Programs in Relation to the HAL API
User Program
C Standard
Library
HAL API
Device
Driver
Device
Driver
...
Device
Driver
Nios II Processor System Hardware
MicroC/OS-II
API
The multi-threaded environment affects certain HAL functions.
Related Information
HAL API Reference
For more information about the consequences of calling a particular HAL function in a multi-threaded
environment.
MicroC/OS-II Thread-Aware Debugging
When you debug a MicroC/OS-II application, you cannot use the debugger to change the current thread,
so you can only single step in one thread at a time.
Note:
Thread-aware debugging does not change the behavior of the target application in any way.
MicroC/OS-II Device Drivers
Each peripheral (that is, each hardware component) can provide include files and source files in the inc
and src subdirectories of the component's HAL directory.
In addition to the HAL directory, a component can optionally provide a UCOSII directory that contains code
specific to the MicroC/OS-II environment. Similar to the HAL directory, the UCOSII directory contains inc
and src subdirectories.
When you create a MicroC/OS-II project, these directories are added to the search paths for source and
include files.
The Nios II Software Build Tools (SBT) copies the files to your BSP obj subdirectory.
You can use the UCOSII directory to provide code that is used only in a multi-threaded environment. Other
than these additional search directories, the mechanism for providing MicroC/OS-II device drivers is
identical to the process for any other device driver.
The HAL system initialization process calls the MicroC/OS-II function OSInit() before
alt_sys_init(), which instantiates and initializes each device in the system. Therefore, the complete
MicroC/OS-II API is available to device drivers, although the system is still running in single-threaded
mode until the program calls OSStart() from within main().
NII5V2
2015.05.14
MicroC/OS-II Thread-Aware Debugging
10-3
MicroC/OS-II Real-Time Operating System
Altera Corporation
Send Feedback