IAR PowerPac RTOS User Guide
IAR PowerPac RTOS User Guide IAR PowerPac RTOS User Guide
●●●●●●●●●●●Full interrupt support:Interrupts can call any function except those that require waiting for data,as well as create, delete or change the priority of a task.Interrupts can wake up or suspend tasks and directly communicate with tasksusing all available communication instances (mailboxes, semaphores, events).Very short interrupt disable-time => short interrupt latency time.Nested interrupts are permitted.IAR PowerPac RTOS has its own interrupt stack (usage optional).Frame application for an easy start.Debug version performs runtime checks, simplifying development.Very fast and efficient, yet small code.Minimum RAM usage.Core written in assembly language.Interfaces C and/or assembly.Initialization of microcontroller hardware as sources.12IAR PowerPac RTOSfor ARM CoresPPRTOS-2
Basic conceptsTasksIn this context, a task is a program running on the CPU core of a microcontroller. Without a multitasking kernel (anRTOS), only one task can be executed by the CPU at a time. This is called a single-task system. A real-time operatingsystem allows the execution of multiple tasks on a single CPU. All tasks execute as if they completely "owned" theentire CPU. The tasks are scheduled, meaning that the RTOS can activate and deactivate every task.Single-task systems (superloop)A superloop application is basically a program that runs in an endless loop, calling OS functions to execute theappropriate operations (task level). No real-time kernel is used, so interrupt service routines (ISRs) must be used forreal-time parts of the software or critical operations (interrupt level). This type of system is typically used in small,uncomplex systems or if real-time behavior is not critical.Task levelInterrupt levelSuperloopISRTimeISRISR (nested)Of course, there are fewer preemption and synchronization problems with a superloop application. Also, because noreal-time kernel is used, only one stack exists in ROM, meaning that ROM size is smaller and less RAM is occupiedfor stacks. However, superloops can become difficult to maintain if the program becomes too large. Because onesoftware component cannot be interrupted by another component (only by ISRs), the reaction time of one componentdepends on the execution time of all other components in the system. Real-time behavior is therefore poor.Multitasking systemsIn a multitasking system, there are different scheduling systems in which the calculation power of the CPU can bedistributed among tasks.PPRTOS-2 13
- Page 1 and 2: IAR PowerPac RTOSUser GuidePPRTOS-2
- Page 3 and 4: PrefaceWelcome to the IAR PowerPac
- Page 5 and 6: ContentsPreface ...................
- Page 7 and 8: ContentsOS_WaitCSema() ............
- Page 9 and 10: ContentsOS_LeaveInterrupt() .......
- Page 11: Introduction to IAR PowerPacRTOSWha
- Page 15 and 16: Basic conceptsPREEMPTIVES MULTITASK
- Page 17 and 18: Basic conceptsMAILBOXES AND QUEUESA
- Page 19 and 20: Basic conceptsThe active task may b
- Page 21 and 22: Basic conceptsThe flowchart below i
- Page 23 and 24: Basic conceptsLIST OF LIBRARIESIn y
- Page 25 and 26: Task routinesIntroductionA task tha
- Page 27 and 28: Task routinesOS_CREATETASK() can be
- Page 29 and 30: Task routinesExampleThe following e
- Page 31 and 32: Task routinesExampleint sec,min;voi
- Page 33 and 34: Task routinesAdditional Information
- Page 35 and 36: Task routinesReturn valueOS_TASKID:
- Page 37 and 38: Software timersSoftware timerA soft
- Page 39 and 40: Software timers#define OS_CREATETIM
- Page 41 and 42: Software timersOS_SetTimerPeriod()D
- Page 43 and 44: Software timersAdditional Informati
- Page 45 and 46: Software timersAdditional Informati
- Page 47 and 48: Software timersExampleOS_TIMER TIME
- Page 49 and 50: Resource semaphoresIntroductionReso
- Page 51 and 52: Resource semaphoresResource semapho
- Page 53 and 54: Resource semaphoresOS_Request()Desc
- Page 55 and 56: Counting SemaphoresIntroductionCoun
- Page 57 and 58: Counting SemaphoresPrototypevoid OS
- Page 59 and 60: Counting SemaphoresReturn value0: I
- Page 61 and 62: MailboxesWhy mailboxes?In the prece
●●●●●●●●●●●Full interrupt support:Interrupts can call any function except those that require waiting for data,as well as create, delete or change the priority of a task.Interrupts can wake up or suspend tasks and directly communicate with tasksusing all available communication instances (mailboxes, semaphores, events).Very short interrupt disable-time => short interrupt latency time.Nested interrupts are permitted.<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> has its own interrupt stack (usage optional).Frame application for an easy start.Debug version performs runtime checks, simplifying development.Very fast and efficient, yet small code.Minimum RAM usage.Core written in assembly language.Interfaces C and/or assembly.Initialization of microcontroller hardware as sources.12<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>for ARM CoresPP<strong>RTOS</strong>-2