Renesas Electronics America Inc. “© 2010 Renesas Electronics America Inc. All rights reserved.” ID 720L: Software Development with an Open Source Real-Time.

Slides:



Advertisements
Similar presentations
Real-Time Library: RTX
Advertisements

Computer Systems/Operating Systems - Class 8
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
FreeRTOS.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Using a Renesas Code Generation Tool for RL78 Devices.
ID 020C: Hardware-in-Loop: System Testing Without the System Marcella Haghgooie Sr. Field Applications Engineer Version: 1.2 Applied Dynamics International.
ID 413C: Can Touch This: Designing Capacitive-Based Touch Solutions Mark F Rodriguez Senior Engineering 13 October 2010 Version: 1.0 Xaplos Inc.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID B32L: Graphical Application Development under Linux/Implementing.
Introduction to Embedded Systems
Renesas Electronics America Inc. ID 311L: PIC to R8C Converter David Hedley Staff AE, Applications Engineering 14 Oct 2010 Version: 1.1.
422L:Introduction to the.NET Micro Framework Julie Trygstad Vice President and Principal Engineer Version: 1.1 TrygTech 13 October 2010.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID A15C: Application Code Reprogramming Using Different Serial.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 320L: Rapid RX600 System Development Using the RPDL and.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 3L13B David Hedley, Applications Engineer Advanced.
Renesas Electronics America Inc. “© 2010 Renesas Electronics America Inc. All rights reserved ID 220L: Hands-on Embedded Ethernet Design with an Open Source.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. 431L: Using a Graphics API to Create User Interface Components—Advanced.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 9L02I Software Development with an Open Source.
An Introduction to OSEK l JRD l ETAS-STV/PRM-E l 2010 © ETAS GmbH All rights reserved. The names and designations used in this document are trademarks.
1 Previous lecture review n Out of basic scheduling techniques none is a clear winner: u FCFS - simple but unfair u RR - more overhead than FCFS may not.
Renesas Electronics America Inc. ID 322C:Using HEW's Many Capabilities to Boost Software Development Productivity Axel Wolf Marketing Manager, Development.
ID 310C:Run-Time Visualization on Renesas MCUs Matt Gordon Sr. Applications Engineer Version: 1.2 Micriµm 12 October 2010.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID A12C:Noise Fundamentals and Techniques for Minimizing.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 930L: Board ID Embedded Security Lab Shotaro Saito Application.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 410L: Low cost audio in 8/16 bit applications using ADPCM.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. A11L: 78K0R Low Power MCU Hands-On Lab Bob Proctor Staff.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. A30L: Increase the Dynamic Range and Precision of Digital.
ID A16C: Outfitting Embedded Devices with Low Power Wireless Communications Design considerations for adding wireless communications to low power embedded.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. 113C: Migration to the RX600 Made Easy Life in the fast lane.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID630L: Becoming Familiar with Sensorless Vector Control.
FreeRTOS.
Class ID: Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Using Virtual EEPROM and Flash API for.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 011C: VELOCITY LAB TM Embedded Development Ecosystem Amrit.
IAR Systems, Inc. ID 323C:A High Performance Compiler Solution for the RX Platform Shawn A. Prestridge Senior Field Applications Engineer 12 October 2010.
Class ID: Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Implementing Bootloaders on Renesas MCUs.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 434L: Incorporating a Capacitive Touch Interface into.
ID 415:Drive a Color TFT-LCD panel with Low-cost Flash MCUs Sridhar Lingam Product Marketing Manager 12 October 2010 Version: 06.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Advanced Debugging on the RX600.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Advanced E 2 Studio Topics.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 411L:A Direct Drive LCD Software Solution for Driving.
Overview Task State Diagram Task Priority Idle Hook AND Co-Routines
ID 222L: Get Connected with USB on RX62N
ID 024C: Auto Code Generation: The Shortest Distance From Idea to Implementation Christopher Myers Director of Software Development 12 October 2010 Version:
Global Edge Ian Carvalho Architect 14 October 2010 Copyright © 2010, Global Edge Software Ltd., Bangalore, India Version 1.0 ID 730L: Getting Started with.
ECGR-6185 µC/OS II Nayana Rao University of North Carolina at Charlotte.
Real Time Operating Systems Michael Thomas Date: Rev. 1.00Date.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 230L: Simplify your Networked Application with CAN and.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 416C:SH-2A Graphics for Low- to Mid-level Graphics Applications.
4300 Lines Added 1800 Lines Removed 1500 Lines Modified PER DAY DURING SUSE Lab.
MicroC/OS-II S O T R.  MicroC/OS-II (commonly termed as µC/OS- II or uC/OS-II), is the acronym for Micro-Controller Operating Systems Version 2.  It.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 3L05I Advanced Debugging on the RX600 Fatih Peksenar.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 5L08I Using the Renesas Graphics API to Create.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 322L:Advanced Debugging on the RX600 Brandon Hussey Applications.
IAR Systems, Inc. ID 324C:Introducing the Embedded Workbench for the Renesas SH Shawn A. Prestridge Senior Field Applications Engineer 12 October 2010.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 421L: R8C Segment-LCD API Lab Bob Proctor Staff Engineer.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID A10L:A Flexible Flash Rewrite Application Brandon Hussey.
ID 721C: Using an RTOS in SH Based Product Development John Carbone VP, Marketing 13 October 2010 Version: 3.2 Express Logic, Inc.
ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 130L: Optimizing your SH2A Application Kevin P King Senior.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Class ID: Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Using Software Building Blocks for Faster.
Semaphore 김백규. What is Semaphore?  A semaphore is a protected variable.  method for restricting access to shared resources (e.g. storage) in a multiprogramming.
Outlines  Introduction  Kernel Structure  Porting.
Outline Introduction to task synchronization Queues of FreeRTOS
REAL-TIME OPERATING SYSTEMS
David Hedley Staff AE, Applications Engineering 12 Oct 2010
Topics Covered What is Real Time Operating System (RTOS)
David Hedley Staff AE, Applications Engineering 13 October 2010
ID 325L: Getting Started with CubeSuite
Presentation transcript:

Renesas Electronics America Inc. “© 2010 Renesas Electronics America Inc. All rights reserved.” ID 720L: Software Development with an Open Source Real-Time Operating System Fatih Peksenar Senior Manager, Applications Engineering 14 October 2010 Version: 1.1

2 “© 2010 Renesas Electronics America Inc. All rights reserved.” Mr. Fatih Peksenar Manager, Applications Engineering Responsible for integrated firmware development environment framework within the Renesas America Applications Group. Ported FreeRTOS to various Renesas platforms. Examples are: RSKH8S1668, RSKSH7216, RSKRX62N, RDKRX62N PREVIOUS EXPERIENCE: Lead software engineer for telecom companies where used various RTOS frameworks including: VxWorks, eCos, MQX, and other home grown kernels MSEE from the University of Minnesota

3 “© 2010 Renesas Electronics America Inc. All rights reserved.” Renesas Technology and Solution Portfolio Microcontrollers & Microprocessors #1 Market share worldwide * Analog and Power Devices #1 Market share in low-voltage MOSFET** Solutions for Innovation ASIC, ASSP & Memory Advanced and proven technologies * MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010 **Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis).

4 “© 2010 Renesas Electronics America Inc. All rights reserved.” 4 Renesas Technology and Solution Portfolio Microcontrollers & Microprocessors #1 Market share worldwide * Analog and Power Devices #1 Market share in low-voltage MOSFET** ASIC, ASSP & Memory Advanced and proven technologies * MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010 **Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis). Solutions for Innovation

5 “© 2010 Renesas Electronics America Inc. All rights reserved.” 5 Microcontroller and Microprocessor Line-up Superscalar, MMU, Multimedia  Up to 1200 DMIPS, 45, 65 & 90nm process  Video and audio processing on Linux  Server, Industrial & Automotive  Up to 500 DMIPS, 150 & 90nm process  600uA/MHz, 1.5 uA standby  Medical, Automotive & Industrial  Legacy Cores  Next-generation migration to RX High Performance CPU, FPU, DSC Embedded Security  Up to 10 DMIPS, 130nm process  350 uA/MHz, 1uA standby  Capacitive touch  Up to 25 DMIPS, 150nm process  190 uA/MHz, 0.3uA standby  Application-specific integration  Up to 25 DMIPS, 180, 90nm process  1mA/MHz, 100uA standby  Crypto engine, Hardware security  Up to 165 DMIPS, 90nm process  500uA/MHz, 2.5 uA standby  Ethernet, CAN, USB, Motor Control, TFT Display High Performance CPU, Low Power Ultra Low Power General Purpose

6 “© 2010 Renesas Electronics America Inc. All rights reserved.” 6 Microcontroller and Microprocessor Line-up Superscalar, MMU, Multimedia  Up to 1200 DMIPS, 45, 65 & 90nm process  Video and audio processing on Linux  Server, Industrial & Automotive  Up to 500 DMIPS, 150 & 90nm process  600uA/MHz, 1.5 uA standby  Medical, Automotive & Industrial  Legacy Cores  Next-generation migration to RX High Performance CPU, FPU, DSC Embedded Security  Up to 10 DMIPS, 130nm process  350 uA/MHz, 1uA standby  Capacitive touch  Up to 25 DMIPS, 150nm process  190 uA/MHz, 0.3uA standby  Application-specific integration  Up to 25 DMIPS, 180, 90nm process  1mA/MHz, 100uA standby  Crypto engine, Hardware security  Up to 165 DMIPS, 90nm process  500uA/MHz, 2.5 uA standby  Ethernet, CAN, USB, Motor Control, TFT Display High Performance CPU, Low Power Ultra Low Power General Purpose RX Ethernet, CAN, USB, UART, SPI, IIC

7 “© 2010 Renesas Electronics America Inc. All rights reserved.” Innovation DVR Game Console Smart Phones Navigation Systems Music Players Tablet PC

8 “© 2010 Renesas Electronics America Inc. All rights reserved.” Our RTOS Solutions Renesas provides you a complete set of FREE tools and several MCUs with different peripherals. We work with FreeRTOS and other partner companies to arm you with a full set of software solutions so you can build the next Space Shuttle!

9 “© 2010 Renesas Electronics America Inc. All rights reserved.” Agenda Definitions Why RTOS? Why FreeRTOS? Lab Exercises Questions Feedback Form

10 “© 2010 Renesas Electronics America Inc. All rights reserved.” Key Takeaways By the end of this session you will be able to: Identify the basic RTOS concepts Find out how RTOS can help you Recite why FreeRTOS may be good solution for you Identify what other RTOS vendor we partner with

11 “© 2010 Renesas Electronics America Inc. All rights reserved.” What is Your RTOS Experience? I have previously used an RTOS in a commercial product I am using an RTOS in my current project I am considering using an RTOS in the near future and would like to get as much info as possible I am a “Super-Loop” user and here to burn you down

12 “© 2010 Renesas Electronics America Inc. All rights reserved.” Some Definitions REAL-TIME: Computing with a deadline Hard real-time (Air bag) Soft real-time (Adaptive volume) TASK: Self contained code that handles a singular functionality or semi-independent portion of an application Process Thread SCHEDULER: Implements the scheduling policy Kernel Operating system (OS) PRIORTY: Used in arbitration mechanism

13 “© 2010 Renesas Electronics America Inc. All rights reserved.” Why Use an RTOS? (1) Abstracting timing information Kernel is responsible for system time Modularity Tasks are independent modules with well defined purpose Team development Designers can work on different tasks simultaneously Code reuse Modules allow code re-use with less effort Improved efficiency Event driven software Code executes only when it is needed

14 “© 2010 Renesas Electronics America Inc. All rights reserved.” Why Use an RTOS? (2) Flexible interrupt handling Short interrupt routines that detects events Most of the work deferred to a task Mixed processing requirements Periodic execution Continuous functions Event driven processing Real-time requirement ordering with priorities Control over peripherals Shared resources Gatekeeper tasks

15 “© 2010 Renesas Electronics America Inc. All rights reserved.” Why FreeRTOS? Widely used and known Open source Free use and distribute Simple and easy to port Feature rich but small size Path to commercial versions OpenRTOS: Full support, additional components SafeRTOS: Functional safety, IEC compliant More on:

16 “© 2010 Renesas Electronics America Inc. All rights reserved.” What is our role with FreeRTOS? Port FreeRTOS to Renesas MCUs Work with FreeRTOS to qualify ports Provide sample projects with FreeRTOS Direct Drive LCD Integrated Firmware Development Platform Support by FreeRTOS Partner with other RTOS vendors for full support Micrium: uc/OS Segger: embOS CMX: CMX-RTX

“© 2010 Renesas Electronics America Inc. All rights reserved.” 17 Lab Exercises

18 “© 2010 Renesas Electronics America Inc. All rights reserved.” General Notes on Lab Exercises Refer to lab handout Total of 8 lab exercises Short description up front About 10 minutes each Recap at end LEDs show running task LED4System Tick LED5Task1 LED6Task2 LED7Task3 LED8Task 4 LED9Run time stats LED10Idle Task

“© 2010 Renesas Electronics America Inc. All rights reserved.” 19 Lab Exercise 1 - Tasks, Priorities, Task States

20 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 1 - Tasks, Priorities, Task States APIs: xTaskCreate(), vTaskDelay(), vTaskDelayUntil(), vTaskStartScheduler() Pre-emptive scheduling Highest priority ready task Time slice same priority tasks Idle task Low priority background or continuous tasks Spare processing time System in low power MUST NOT BLOCK!

“© 2010 Renesas Electronics America Inc. All rights reserved.” 21 Lab Exercise 1 – You can start the lab now

22 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 1 – Recap

“© 2010 Renesas Electronics America Inc. All rights reserved.” 23 Lab Exercise 2 – Task Properties

24 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 2 – Task Properties APIs: uxTaskPriorityGet(), vTaskPrioritySet(), vTaskDelete(), vTaskSuspend(), vTaskResume() Task handle Used to access to a task Query properties Modify properties Suspend Resume Delete

“© 2010 Renesas Electronics America Inc. All rights reserved.” 25 Lab Exercise 2 – You can start the lab now

26 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 2 – Recap Task1 is the highest priority task. How do Task2 run? Task1 raises priority of Task2 so it can run. Task2 lowers its priority. What does happen when task priorities not changed? Task1 becomes the only running task Adding a delay allows Task2 to run. In this case Task2 runs once because it deletes itself.

27 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 2 – Recap Hard real time -> Higher priority Soft real time -> Lower priority Execution times Processor utilization Rate Monotonic Scheduling (RMS) Unique priority based on the periodic execution rate The higher periodic execution the higher the priority Better scheduling of tasks Not all tasks are periodic Execution times must be considered

“© 2010 Renesas Electronics America Inc. All rights reserved.” 28 Lab Exercise 3 – Queue Management

29 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 3 – Queue Management APIs: xQueueCreate(), xQueueSendToBack(), xQueueSendToFront(), xQueueReceive(), uxQueueMessagesWaiting() Communication between tasks and interrupts Blocking API call Not owned by a particular task Any task can write to a queue Any task can read from a queue Byte by byte copy of the data

30 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 3 – More on Queues Use pointers for large data Pointers queued Some rules must be followed Clearly define the owner of RAM Avoid simultaneous memory modifications Sending task accesses the memory until pointer is queued Receiving task accesses the memory after the pointer is received from the queue NO ACCESS IN BETWEEN! Make sure RAM being pointed is valid DO NOT USE STACK!

“© 2010 Renesas Electronics America Inc. All rights reserved.” 31 Lab Exercise 3 – You can start the lab now

32 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 3 – Recap Receiver task is the highest priority task so it runs as soon as data is sent to queue and removes it. Therefore, the items in queue is always zero. Receiver task priority is lower than the sender task. Sender tasks fills the queue and can not send anymore. All tasks are at the same priority so they are time-sliced.

“© 2010 Renesas Electronics America Inc. All rights reserved.” 33 Lab Exercise 4 – Interrupt Management

34 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 4 – Interrupt Management Events Message reception Button push Exceeding a threshold Detection methods Polled Interrupt driven Timing In the ISR In the handler task Semaphores links events to tasks Let’s look at a sequence of events

35 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 4 – Semaphores APIs: vSemaphoreCreateBinary(), xSemaphoreCreateCounting(), xSemaphoreGiveFromISR(), xSemaphoreTake() Binary semaphore Queue with a length of one Always either empty or full Counting semaphore Event count, initial value = zero Resource management, initial count = number of resource

“© 2010 Renesas Electronics America Inc. All rights reserved.” 36 Lab Exercise 4 – You can start the lab now

37 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 4 – Recap Binary semaphores are available after created. Sequence of events: Periodic task causes an interrupt ISR runs and gives the semaphore ISR pends a context switch Context switches and handler task runs Context switches back to periodic task Same sequence of events with counting semaphore but multiple events are captured.

“© 2010 Renesas Electronics America Inc. All rights reserved.” 38 Lab Exercise 5 – Queues and Interrupts

39 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 5 – Queues and Interrupts APIs: xQueueReceiveFromISR(), xQueueSendToBackFromISR(), xQueueSendToFrontFromISR() FromISR() APIs Do not specify block time therefore they do not block Do not perform context switch Indicate if a higher priority task moves to ready state A port specific macro causes immediate context switch If the macro is not called in ISR: – context switch happens at the next timer tick

“© 2010 Renesas Electronics America Inc. All rights reserved.” 40 Lab Exercise 5 – You can start the lab now

41 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 5 – Recap Generator task sends 5 integer values to integer queue and causes an interrupt ISR receives the integers, uses them to select strings and sends them to string queue String tasks receives the strings and prints them out If context switch is not scheduled within ISR, generator task runs to completion before string task runs

42 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 5 – Recap xQueueSendToFrontFromISR() API Back / Front same as FIFO / LIFO Notice the difference in the sequence of strings SendToBackSendToFront

“© 2010 Renesas Electronics America Inc. All rights reserved.” 43 Lab Exercise 6 – Resource Management

44 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 6 – Resource Management Resource sharing/Peripheral access LCD, standard IO, memory Read/Modify/Write operation Non-atomic operations Non-atomic access to variables Multiple member of a structure 32-bit access on a 16-bit device Reentrant Functions Safe to call from more than one task/interrupt No data access other than on the stack or registers

45 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 6 – Best Practices Do not share resources Use mutual exclusion when accessing a shared resource Access a resource only from a single task RTOS tools for resource management Creating critical sections – taskENTER_CRITICAL() Suspending the scheduler – vTaskSuspendAll() Make use of mutexes Designing gatekeeper tasks

46 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 6 – Mutual Exclusion = Mutexes APIs: xSemaphoreCreateMutex(), xSemaphoreTake(), xSemaphoreGive() Special type of binary semaphore Used to control a shared resource A task “takes” the mutex before accessing the resource No other tasks can use the resource when mutex is taken The task “gives” the mutex back after it is done Resource is now available to other tasks Works as longs as all agree with these rules DO NOT COME IN FROM THE BACK DOOR!

“© 2010 Renesas Electronics America Inc. All rights reserved.” 47 Lab Exercise 6 – You can start the lab now

48 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 6 – Recap Print 2 is a higher priority tasks and preempts Print 1 task corrupting the output Why we did not see this in previous exercises? No corruption in the output when mutex is used

“© 2010 Renesas Electronics America Inc. All rights reserved.” 49 Lab Exercise 7 – Priority Inversion, Inheritance

50 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 7 – Priority Inversion, Inheritance

“© 2010 Renesas Electronics America Inc. All rights reserved.” 51 Lab Exercise 7 – You can start the lab now

52 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 7 – Recap Initially, LP task takes the resource, and resumes MP task MP task takes 8 seconds to complete HP task attempts to run every 1 second but it blocks waiting for the resource LP task’s priority raises to HP task level and gives the resource back with no delay HP task runs every 1 second 8 seconds delay HP task runs about 8 times between LP task executions No delay

“© 2010 Renesas Electronics America Inc. All rights reserved.” 53 Lab Exercise 8 – Gatekeeper Tasks

54 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 8 – Gatekeeper Tasks Gatekeeper tasks has sole ownership of a resource Only the gatekeeper tasks accesses the resource Other tasks access the recourse through the services provided by the gatekeeper Things to consider when creating gatekeeper tasks Up front system design Agree on services and interfaces Allow for future expansion/changes Always use the services to access the resource

“© 2010 Renesas Electronics America Inc. All rights reserved.” 55 Lab Exercise 8 – You can start the lab now

56 “© 2010 Renesas Electronics America Inc. All rights reserved.” Lab Exercise 8 – Recap Print 1, Print 2 tasks and an interrupt service routine use the services of a gatekeeper task Gatekeeper task uses a queue as an interface No corruption with the print out

57 “© 2010 Renesas Electronics America Inc. All rights reserved.” Innovation Renesas is here to help you to create your next innovation. Let’s build it together!

58 “© 2010 Renesas Electronics America Inc. All rights reserved.” Questions?

“© 2010 Renesas Electronics America Inc. All rights reserved.” 59 Thank You!

Renesas Electronics America Inc.