IAR PowerPac RTOS User Guide
IAR PowerPac RTOS User Guide IAR PowerPac RTOS User Guide
ResourceAnything in the computer system with limited availability (for example memory, timers,computation time). Essentially, anything used by a task.Resource semaphoreA type of semaphore used for managing resources by ensuring that only one task has accessto a resource at a time.RTOSReal-time Operating System.SchedulerThe program section of an RTOS that selects the active task, based on which tasks areready to run, their relative priorities, and the scheduling system being used.SemaphoreA data structure used for synchronizing tasks.Software timerA data structure which calls a user-specified routine after a specified delay.StackAn area of memory with FIFO storage of parameters, automatic variables, return addresses,and other information that needs to be maintained across function calls. In multitaskingsystems, each task normally has its own stack.SuperloopA program that runs in an infinite loop and uses no real-time kernel. ISRs are used for realtimeparts of the software.TaskA program running on a processor. A multitasking system allows multiple tasks to executeindependently from one another.TickThe OS timer interrupt. Usually equals 1 ms.TimesliceThe time (number of ticks) for which a task will be executed until a round-robin taskchange may occur.144IAR PowerPac RTOSfor ARM CoresPPRTOS-2
IndexIndexAAdditional modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139CC startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Configuration defines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111Configuration, of embOS . . . . . . . . . . . . . . . . . . . . . . . . . 111–112copyright notice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Counting Semaphores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Critical regions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16, 107–108DDebug version, of embOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123–125error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124runtime errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123disclaimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2document conventions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Eedition, of this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2embOSbuilding libraries of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137different builds of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22features of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11embOS features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11embOS profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17, 77–81, 83–88Gguidelines, reading. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3IInternal data-structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109Interrupt control macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104Interrupt level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Interrupt service routines . . . . . . . . . . . . . . . . . . . . . . . . . . . 13, 99Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99–106enabling/disabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103interrupt handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101ISR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99KKeyboard manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139KEYMAN.C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139LLibraries, building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137Limitations, of embOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135MMailboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17, 61–70basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61single-byte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113high-resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115low-resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113Memory managementfixed block size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91Memory pools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91–95Multitasking systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13cooperative multitasking . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14preemptives multitasking. . . . . . . . . . . . . . . . . . . . . . . . . . . . 15NNesting interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105Non-maskable interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106OOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21, 26OS_ClearEvents() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80OS_ClearMB(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69OS_CONFIG(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112OS_CREATECSEMA() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55OS_CreateCSema(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56OS_CREATEMB() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63OS_CREATERSEMA() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51OS_CreateTaskEx() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29OS_CREATETASK() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26OS_CreateTask() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27OS_CREATETASK_EX() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28OS_CREATETIMER(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38, 43OS_CreateTimer(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39, 44OS_DecRI() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103OS_DelayUntil() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30PPRTOS-2145
- Page 93 and 94: Fixed block size memory poolsProtot
- Page 95 and 96: Fixed block size memory poolsProtot
- Page 97 and 98: StacksIntroductionThe stack is the
- Page 99 and 100: InterruptsIntroductionIn this chapt
- Page 101 and 102: InterruptsRules for interrupt handl
- Page 103 and 104: InterruptsOS_LeaveInterruptNoSwitch
- Page 105 and 106: InterruptsNesting interrupt routine
- Page 107 and 108: Critical RegionsIntroductionCritica
- Page 109 and 110: System variablesIntroductionThe sys
- Page 111 and 112: Configuration for your targetsystem
- Page 113 and 114: Time measurementIntroductionIAR Pow
- Page 115 and 116: Time measurementPrototypeU32 OS_Get
- Page 117 and 118: Time measurementPrototypeOS_U32 OS_
- Page 119 and 120: RTOS-aware debuggingThis chapter de
- Page 121 and 122: RTOS-aware debuggingTimersA softwar
- Page 123 and 124: DebuggingRuntime errorsSome error c
- Page 125 and 126: DebuggingValue Define Description17
- Page 127 and 128: Performance and resource usageThis
- Page 129 and 130: Performance and resource usageThe c
- Page 131 and 132: Performance and resource usage*/sta
- Page 133 and 134: ReentranceAll routines that can be
- Page 135 and 136: LimitationsThe following limitation
- Page 137 and 138: Source code of kernel and libraryIn
- Page 139 and 140: Additional modulesKeyboard manager:
- Page 141 and 142: FAQ (frequently asked questions)Q:
- Page 143: GlossaryActive TaskCooperativemulti
- Page 147: IndexOS_WaitSingleEventTimed(). . .
ResourceAnything in the computer system with limited availability (for example memory, timers,computation time). Essentially, anything used by a task.Resource semaphoreA type of semaphore used for managing resources by ensuring that only one task has accessto a resource at a time.<strong>RTOS</strong>Real-time Operating System.SchedulerThe program section of an <strong>RTOS</strong> that selects the active task, based on which tasks areready to run, their relative priorities, and the scheduling system being used.SemaphoreA data structure used for synchronizing tasks.Software timerA data structure which calls a user-specified routine after a specified delay.StackAn area of memory with FIFO storage of parameters, automatic variables, return addresses,and other information that needs to be maintained across function calls. In multitaskingsystems, each task normally has its own stack.SuperloopA program that runs in an infinite loop and uses no real-time kernel. ISRs are used for realtimeparts of the software.TaskA program running on a processor. A multitasking system allows multiple tasks to executeindependently from one another.TickThe OS timer interrupt. Usually equals 1 ms.TimesliceThe time (number of ticks) for which a task will be executed until a round-robin taskchange may occur.144<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>for ARM CoresPP<strong>RTOS</strong>-2