Book Cover
Table of Contents
Part I
Foreword to µC/OS-III — by Jack Ganssle
Preface
Introduction
1-1 Foreground/Background Systems
1-2 Real-Time Kernels
1-3 RTOS (Real-Time Operating System)
1-4 µC/OS-III
1-5 µC/OS, µC/OS-II and µC/OS-III Features Comparison
1-6 How the Book is Organized
1-7 µC/Probe
1-8 Conventions
1-9 Chapter Contents
1-10 Licensing
1-11 Contacting Micrium
Directories and Files
2-1 Application Code
2-2 CPU
2-3 Board Support Package (BSP)
2-4 µC/OS-III, CPU Independent Source Code
2-5 µC/OS-III, CPU Specific Source Code
2-6 µC/CPU, CPU Specific Source Code
2-7 µC/LIB, Portable Library Functions
2-8 Summary
Getting Started with µC/OS-III
3-1 Single Task Application
3-2 Multiple Tasks Application with Kernel Objects
Critical Sections
4-1 Disabling Interrupts
4-1-1 Measuring Interrupt Disable Time
4-2 Locking the Scheduler
4-2-1 Measuring Scheduler Lock Time
4-3 µC/OS-III Features with Longer Critical Sections
4-4 Summary
Task Management
5-1 Assigning Task Priorities
5-2 Determining the Size of a Stack
5-3 Detecting Task Stack Overflows
5-4 Task Management Services
5-5 Task Management Internals
5-5-1 Task States
5-5-2 Task Control Blocks (TCBs)
5-6 Internal Tasks
5-6-1 The Idle Task (OS_IdleTask())
5-6-2 The Tick Task (OS_TickTask())
5-6-3 The Statistic Task (OS_StatTask())
5-6-4 The Timer Task (OS_TmrTask())
5-6-5 The ISR Handler Task (OS_IntQTask())
5-7 Summary
The Ready List
6-1 Priority Levels
6-2 The Ready List
6-3 Adding Tasks to the Ready List
6-4 Summary
Scheduling
7-1 Preemptive Scheduling
7-2 Scheduling Points
7-3 Round-Robin Scheduling
7-4 Scheduling Internals
7-4-1 OSSched()
7-4-2 OSIntExit()
7-4-3 OS_SchedRoundRobin()
7-5 Summary
Context Switching
8-1 OSCtxSw()
8-2 OSIntCtxSw()
8-3 Summary
Interrupt Management
9-1 Handling CPU Interrupts
9-2 Typical µC/OS-III Interrupt Service Routine (ISR)
9-3 Short Interrupt Service Routine (ISR)
9-4 All Interrupts Vector to a Common Location
9-5 Every Interrupt Vectors to a Unique Location
9-6 Direct and Deferred Post Methods
9-6-1 Direct Post Method
9-6-2 Deferred Post Method
9-7 Direct vs. Deferred Post Method
9-8 The Clock Tick (or System Tick)
9-9 Summary
Pend Lists (or Wait Lists)
10-1 Summary
Time Management
11-1 OSTimeDly()
11-2 OSTimeDlyHMSM()
11-3 OSTimeDlyResume()
11-4 OSTimeSet() and OSTimeGet()
11-5 OSTimeTick()
11-6 Summary
Timer Management
12-1 One-Shot Timers
12-2 Periodic (no initial delay)
12-3 Periodic (with initial delay)
12-4 Timer Management Internals
12-4-1 Timer Management Internals - Timers States
12-4-2 Timer Management Internals - OS_TMR
12-4-3 Timer Management Internals - Timer Task
12-4-4 Timer Management Internals - Timer List
12-5 Summary
Resource Management
13-1 Disable/Enable Interrupts
13-2 Lock/Unlock
13-3 Semaphores
13-3-1 Binary Semaphores
13-3-2 Counting Semaphores
13-3-3 Notes on Semaphores
13-3-4 Semaphore Internals (for resource sharing)
13-3-5 Priority Inversions
13-4 Mutual Exclusion Semaphores (Mutex)
13-4-1 Mutual Exclusion Semaphore Internals
13-5 Should You Use a Semaphore Instead of a Mutex?
13-6 Deadlocks (or Deadly Embrace)
13-7 Summary
Synchronization
14-1 Semaphores
14-1-1 Unilateral Rendezvous
14-1-2 Credit Tracking
14-1-3 Multiple Tasks Waiting on a Semaphore
14-1-4 Semaphore Internals (for synchronization)
14-2 Task Semaphore
14-2-1 Pending (i.e., Waiting) on a Task Semaphore
14-2-2 Posting (i.e., Signaling) a Task Semaphore
14-2-3 Bilateral Rendezvous
14-3 Event Flags
14-3-1 Using Event Flags
14-3-2 Event Flags Internals
14-4 Synchronizing Multiple Tasks
14-5 Summary
Message Passing
15-1 Messages
15-2 Message Queues
15-3 Task Message Queue
15-4 Bilateral Rendezvous
15-5 Flow Control
15-6 Keeping the Data in Scope
15-7 Using Message Queues
15-8 Clients and Servers
15-9 Message Queues Internals
15-10 Summary
Pending On Multiple Objects
16-1 Summary
Memory Management
17-1 Creating a Memory Partition
17-2 Getting a Memory Block from a Partition
17-3 Returning a Memory Block to a Partition
17-4 Using Memory Partitions
17-5 Summary
Porting µC/OS-III
18-1 µC/CPU
18-2 µC/OS-III Port
18-3 Board Support Package (BSP)
18-4 Summary
Run-Time Statistics
19-1 General Statistics – Run-Time
19-2 Per-Task Statistics – Run-Time
19-3 Kernel Object – Run-Time
19-4 OS_DBG.C – Static
19-5 OS_CFG_APP.C – Static
19-6 Summary
µC/OS-III API Reference Manual
A-1 Task Management
A-2 Time Management
A-3 Mutual Exclusion Semaphores – Resource Management
A-4 Event Flags – Synchronization
A-5 Semaphores – Synchronization
A-6 Task Semaphores – Synchronization
A-7 Message Queues – Message Passing
A-8 Task Message Queues – Message Passing
A-9 Pending on Multiple Objects
A-10 Timers
A-11 Fixed-Size Memory Partitions – Memory Management
OSCtxSw()
OSFlagCreate()
OSFlagDel()
OSFlagPend()
OSFlagPendAbort()
OSFlagPendGetFlagsRdy()
OSFlagPost()
OSIdleTaskHook()
OSInit()
OSInitHook()
OSIntCtxSw()
OSIntEnter()
OSIntExit()
OSMemCreate()
OSMemGet()
OSMemPut()
OSMutexCreate()
OSMutexDel()
OSMutexPend()
OSMutexPendAbort()
OSMutexPost()
OSPendMulti()
OSQCreate()
OSQDel()
OSQFlush()
OSQPend()
OSQPendAbort()
OSQPost()
OSSafetyCriticalStart()
OSSched()
OSSchedLock()
OSSchedRoundRobinCfg()
OSSchedRoundRobinYield()
OSSchedUnlock()
OSSemCreate()
OSSemDel()
OSSemPend()
OSSemPendAbort()
OSSemPost()
OSSemSet()
OSStart()
OSStartHighRdy()
OSStatReset()
OSStatTaskCPUUsageInit()
OSStatTaskHook()
OSTaskChangePrio()
OSTaskCreate()
OSTaskCreateHook()
OSTaskDel()
OSTaskDelHook()
OSTaskQPend()
OSTaskQPendAbort()
OSTaskQPost()
OSTaskRegGet()
OSTaskRegSet()
OSTaskReturnHook()
OSTaskResume()
OSTaskSemPend()
OSTaskSemPendAbort()
OSTaskSemPost()
OSTaskSemSet()
OSTaskStatHook()
OSTaskStkChk()
OSTaskStkInit()
OSTaskSuspend()
OSTaskSwHook()
OSTaskTimeQuantaSet()
OSTickISR()
OSTimeDly()
OSTimeDlyHMSM()
OSTimeDlyResume()
OSTimeGet()
OSTimeSet()
OSTimeTick()
OSTimeTickHook()
OSTmrCreate()
OSTmrDel()
OSTmrRemainGet()
OSTmrStart()
OSTmrStateGet()
OSTmrStop()
OSVersion()
µC/OS-III Configuration Manual
B-1 µC/OS-III Features (OS_CFG.H)
B-2 Data Types (OS_TYPE.H)
B-3 µC/OS-III Stacks, Pools and other (OS_CFG_APP.H)
Migrating from µC/OS-II to µC/OS-III
C-1 Differences in Source File Names and Contents
C-2 Convention Changes
C-3 Variable Name Changes
C-4 API Changes
C-4-1 Event Flags
C-4-2 Message Mailboxes
C-4-3 Memory Management
C-4-4 Mutual Exclusion Semaphores
C-4-5 Message Queues
C-4-6 Semaphores
C-4-7 Task Management
C-4-8 Time Management
C-4-9 Timer Management
C-4-10 Miscellaneous
C-4-11 Hooks and Port
MISRA-C:2004 and µC/OS-III
D-1 MISRA-C:2004, Rule 8.5 (Required)
D-2 MISRA-C:2004, Rule 8.12 (Required)
D-3 MISRA-C:2004, Rule 14.7 (Required)
D-4 MISRA-C:2004, Rule 15.2 (Required)
D-5 MISRA-C:2004, Rule 17.4 (Required)
Bibliography
Licensing Policy
Part II
Introduction
1-1 The MicriUm µC/Eval-STM32F107
1-2 Part II Chapter Contents
1-3 Acknowledgements
The ARM Cortex-M3 and the STM32
2-1 The Cortex CPU
2-1-1 The Program Status Register
2-1-2 Stacking and Interrupts
2-2 Nested Vector Interrupt Controller (NVIC)
2-3 Exception Vector Table
2-4 SYSTICK (System Tick)
2-5 Memory Map
2-6 Instruction Set
2-7 Debugging Features
2-8 The STmicroelectronics STM32
Setup
3-1 Downloading µC/OS-III projects for this book
3-1-1 \EvalBoards
3-1-2 \uC-CPU
3-1-3 \uC-LIB
3-1-4 \uCOS-III
3-2 Downloading µC/Probe
3-3 Downloading the IAR Embedded Workbench for ARM
3-4 Downloading the STM32F107 documentation
µC/OS-III Example #1
4-1 Running the Project
4-2 How the example project works
4-3 Monitoring variables using µC/Probe
4-4 Summary
µC/OS-III Example #2
5-1 Running the Project
5-2 Monitoring the temperature sensor using µC/Probe
µC/OS-III Example #3
6-1 Running the Project
6-2 Examining Performance Test Results with µC/Probe
6-3 How the test code works
6-4 Other performance measurements
6-5 Summary
µC/OS-III Example #4
7-1 Running the Project
7-2 Displaying Rotating Wheel Data
7-3 RPM Measurement simulation implementation
7-3-1 Measuring RPM using an Input Capture
7-4 How the code works
7-5 Observations
7-6 Summary
µC/OS-III port for the Cortex-M3
A-1 OS_CPU.H
A-2 OS_CPU_C.C
A-2-1 OS_CPU_C.C – OSIdleTaskHook()
A-2-2 OS_CPU_C.C – OSInitHook()
A-2-3 OS_CPU_C.C – OSStatTaskHook()
A-2-4 OS_CPU_C.C – OSTaskCreateHook()
A-2-5 OS_CPU_C.C – OSTaskDelHook()
A-2-6 OS_CPU_C.C – OSTaskReturnHook()
A-2-7 OS_CPU_C.C – OSTaskStkInit()
A-2-8 OS_CPU_C.C – OSTaskSwHook()
A-2-9 OS_CPU_C.C – OSTimeTickHook()
A-2-10 OS_CPU_C.C – OS_CPU_SysTickHandler()
A-2-11 OS_CPU_C.C – OS_CPU_SysTickInit()
A-3 OS_CPU_A.ASM
A-3-1 OS_CPU_A.ASM – OSStartHighRdy()
A-3-2 OS_CPU_A.ASM – OSCtxSw() and OSIntCtxSw()
A-3-3 OS_CPU_A.ASM – OS_CPU_PendSVHandler()
µC/CPU port for the Cortex-M3
B-1 CPU_CORE.C
B-2 CPU_CORE.H
B-3 CPU_DEF.H
B-4 CPU_CFG.H
B-5 µC/CPU functions in BSP.C
B-5-1 µC/CPU functions in BSP.C, CPU_TS_TmrInit()
B-5-2 µC/CPU functions in BSP.C, CPU_TS_TmrRd()
B-6 CPU.H
B-6-1 CPU.H – #defines
B-6-2 CPU.H – Data Types
B-6-3 CPU.H – Function Prototypes
B-7 CPU_A.ASM
IAR Systems IAR Embedded Workbench for ARM
C-1 IAR Embedded Workbench for ARM – Highlights
C-2 Modular and extensible IDE
C-3 Highly optimizing C/C++ Compiler
C-4 Device Support
C-5 State-of-the-art C-SPY® Debugger
C-6 C-SPY Debugger and target system support
C-7 IAR Assembler
C-8 IAR J-LINK Linker
C-9 IAR Library and library tools
C-10 Comprehensive documentation
C-11 First class technical support
Micriµm’s µC/Probe
D-1 µC/Probe is a Windows™-based application
D-2 Assigning a variable to an object
µC/Eval-STM32F107 User’s Guide
E-1 Features
E-2 Hardware layout and configuration
E-3 Power Supply
E-4 Boot Options
E-5 Reset Sources
E-6 CAN (Controller Area Network)
E-7 RS-232C
E-8 SD/MMC card
E-9 USB-OTG (USB On-The-Go)
E-10 LM75 Temperature Sensor
E-11 Debug Interface
E-12 Ethernet
E-13 Clock SourceS
E-14 Connectors
E-14-1 Extension connector (CN3)
E-14-2 Power connectors (CN1 & CN9)
E-14-3 RS-232C connectors (CN7)
E-15 I/O Assignments
E-16 Schematics
Bibliography
Licensing Policy
Index