µC/OS-III is fairly easy to use once it is understood exactly which source files are needed to make up a µC/OS-III-based application. This chapter will discuss the modules available for µC/OS-III and how everything fits together.
The figure below shows the µC/OS-III architecture and its relationship with hardware. Of course, in addition to the timer and interrupt controller, hardware would most likely contain such other devices as Universal Asynchronous Receiver Transmitters (UARTs), Analog to Digital Converters (ADCs), Ethernet controller(s) and more.
This chapter assumes development on a Windows®-based platform and makes references to typical Windows-type directory structures (also called Folder). However, since µC/OS-III is provided in source form, it can also be used on Unix, Linux or other development platforms.
Anchor | ||||
---|---|---|---|---|
|
Panel | ||||
---|---|---|---|---|
| ||||
Panel | ||
---|---|---|
| ||
(1) The application code consists of project or product files. For convenience, these are simply called (2) Semiconductor manufacturers often provide library functions in source form for accessing the peripherals on their CPU or MCU. These libraries are quite useful and often save valuable time. Since there is no naming convention for these files, (3) The Board Support Package (BSP) code needed by µC/OS-III is typically quite simple and generally, µC/OS-III only requires that you initialize a periodic interrupt source which is used for time delays and timeouts. This functionality can should be placed in a file called os_bsp.c along with its corresponding header file, (4) This is the µC/OS-III processor-independent code. This code is written in highly portable ANSI C. (5) This is the µC/OS-III code that is adapted to a specific CPU architecture and is called a port. µC/OS-III has its roots in µC/OS-II and benefits from being able to use most of the 45 or so ports available for µC/OS-II. µC/OS-II ports, however, will require small changes to work with µC/OS-III. (6) At Micriµm, we encapsulate CPU functionality. These files define functions to disable and enable interrupts, (7) µC/LIB is a series of source files that provide common functions such as memory copy, string, and ASCII-related functions. Some are occasionally used to replace (8) Optional module: Some compilers provide extensions for Thread-local Storage, which provide a variable area where threads can store their state to make a multi-threaded environment safer. The adaptation of those functions is performed in the (9) Optional module: µC/OS-III has built-in trace points throughout the code to record all the kernel events and interrupts in real-time using some of the most popular tracing analysis tools (e.g. Percepio's TraceAlyzer and SEGGER SystemView). These trace calls are disabled by default and can only be enabled at compile-time by setting the configuration constant (10) Configuration files are used to define µC/OS-III features ( |