ITRON History ITRON1 – designed for 8 and 16 bit MCU ITRON2 – support 32 bit MCU μITRON2 – adaptation for low-cost MCU μITRON3 – scalability enhancements μITRON4 – compatibility enhancement Targeted for 32 bit MPU The first spec for ITRON Kernel Targeted for 8-bit and 16-bit MCU Copyright © 2011 DSR Corporation Scalability Enhancement Compatibility Enhancement 1 ITRON Usage (cont.) Copyright © 2011 DSR Corporation 2 Configure the System .c and .h files are generated as a result of configurator functioning RTOS configuration file Source files for the task Source files for the interrupt handler Configurator Software Components Software Components Other Libraries RTOS Libraries Compiling and linking Object file To ROM MPU Copyright © 2011 DSR Corporation 3 Task States (cont.) Copyright © 2011 DSR Corporation 4 Scheduling Rules (cont.) Scheduling example Task A of the highest priority Task B, C, D of the middle priority Task E of the lowest priority Workflow Task A terminates, task B moves to RUNNING state If task B goes to WAITING or SUSPENDEND state and then back to READY, it has the lowest precedence If Task A is reactivated, Task B is pre-empted and return to the READY state, it has the highest precedence Copyright © 2011 DSR Corporation 5 Dispatch Pending State • • Dispatch does not occur (dispatch pending state) – During execution of processing units with higher precedence than that of the dispatcher – The CPU in locked state – Dispatch disabled state Task state transition into SUSPENDED or DORMANT state is hold until dispatch is turned on – Task state transition may be done using service calls from non-task context Low priority task A is running Dispatch pending state during interrupt handler execution High priority task B is activated from interrupt handler Task state changes only after dispatcher executes Copyright © 2011 DSR Corporation 6 Semaphore (cont.) Semaphore usage example Task 1 Semaphore Task 2 (Priority: Low) (SID1) (Priority: High) Semaphore acquire req. Semaphore acquired Sem. resource number = 1 Sem. resource number = 0 Start Work with shared resources Semaphore acquire req. Dispatch Release semaphore Semaphore acquired Wait release, dispatch Work with shared resources Copyright © 2011 DSR Corporation 7 Eventflag (cont.) Eventflag usage example Task 1 Task 2 Eventflag (Priority: Low) Event flag is cleared (Priority: High) flag=00 Starting Wait for event 11 Dispatch Set event flag 01 Release waiting flag=01 Copyright © 2011 DSR Corporation Wait release, dispatch 8 Data Queue (cont.) Data queue functioning example: wait for receive Task 1 Data queue (Priority: Low) Task 2 (Priority: High) Empty queue Dispatch Receive message Receive wait Send message Release waiting Wait release, dispatch Copyright © 2011 DSR Corporation 9 Data Queue (cont.) Data queue functioning example: asynchronous send Task 1 Data queue (Priority: Low) Task 2 (Priority: High) Empty queue Time Send a message Start 1 message in queue Receive message Empty queue Copyright © 2011 DSR Corporation 10 Data Queue (cont.) Data queue functioning example: wait for send Task 1 Data queue (Priority: Low) Task 2 (Priority: Low) Queue is full Send a message Dispatch Send-wait state Data queue Wait release, dispatch Receive message Put data to queue Queue is full Copyright © 2011 DSR Corporation 11 References μITRON4.0 Specification RTEMS ITRON 3.0 User’s Guide http://citforum.ru/operating_systems/rtos/27.shtml FAQ of ITRON Specification OS http://ecos.sourceware.org/docs-1.3.1/ref/ecos-ref.a.html ITRON short description http://www.rtems.com/onlinedocs/releases/rtemsdocs-4.9.4/share/rtems/pdf/itron.pdf eCOS μITRON API http://www.t-engine.org/wp-content/themes/wp.vicuna/pdf/specifications/en_US/WG024-S00104.03.00_en.pdf http://www.t-engine.org/tron-project/itron/itron-faq TOPEERS/JSP http://www.toppers.jp/en/index.html Copyright © 2011 DSR Corporation 12