TRON Forum

FAQ of ITRON Specification OS

TRON
 [Question 1]What is ITRON specification OS?
 [Question 2]What is the difference between ITRON and μITRON?
 [Question 3]What is the relationship among ITRON specification OS, T-Kernel and μT-Kernel?
 [Question 4]What is loose standardization?
ITRON Specification-compatible Product Registration System
 [Question 5]I’d like to know about the screening for ITRON specification-compatible product registration.
Education and Learning
 [Question 6]What should I do first to learn about RTOSs such as ITRON specification OS and T-Kernel?
Programming
 [Question 7]Can I create a program to guarantee real-time performance using RTOS?
 [Question 8]Do the speed of programs increase by using RTOS?
 [Question 9]On what type of MPUs can ITRON specification OS and T-Kernel be used?
 [Question 10]What should I do to use a standard library with ITRON specification OS?
 [Question 11]How can task stack size be determined?
Task Management Function
 [Question 12]What is "task" in ITRON?
 [Question 13]Does the precedence need to be specified by consecutive numbers such as 1, 2, 3, … or non-consecutive numbers such as 2, 5, 6, 9, …?
 [Question 14]It seems like a function in the C language is specified for a task itself in μITRON. Is it possible to create multiple tasks with one function?
 [Question 15]Can I change the startup precedence of the tasks after creating tasks?
 [Question 16]In one system, I was running a task after changing the task priority by chg_pri. However, it was changed to another priority after a while. Why is that?
 [Question 17]If the task is terminated forcefully by ter_tsk, will the objects such as semaphore which is created by the task and the memory block obtained in the memory pool also be deleted?
Task-dependent Synchronization
 [Question 18]Both tslp_tsk and dly_tsk can cause the wait state for a certain period of time. How can I decide which one to use?
 [Question 19]tslp_tsk and dly_tsk specify waiting time to the parameter. Is there any difference among the values to be specified?
Synchronous Communication Function
 [Question 20]When I attempt to send a message using a mailbox, sometimes the received message is corrupted and a message cannot be sent. Why? Messages can be transmitted normally using a message buffer.
 [Question 21]Is it possible to send a message to the particular task?
 [Question 22]When multiple tasks send a message in a message buffer, in what order are the messages sent?
 [Question 23]What happens if rot_rdq is issued in the state where dispatch is prohibited?
Interrupt Management Function
 [Question 24]What happens if an interrupted handler returns without issuing ret_int() after invoking an ixxx_yyy service call?
 [Question 25]Can we invoke ixxx_yyy service calls from interrupt handlers that are not under the management of kernel? Do such interrupt handlers need to invoke ret_int()?
 [Question 26]What happens if an unpermitted service call (other than ixxx_yyy/sns_yyy) is issued by an interrupted handler (including service routine?)
System State Management Function
 [Question 27]What is "CPU lock state?"
Real-time OS Products
 [Question 28]How is the task control block structured?
 [Question 29]What is the structure of TLB which RTOS internally uses?
 [Question 30]Let me know the status of OS verification.

TRON

[Q1] What is ITRON specification OS?
What is ITRON specification OS?

[A1] 
"ITRON Specification OS" stands for "Industrial TRON Specification OS" and is the name of real-time operating system specification for controlling embedded devices.
ITRON specification allows adaptation to hardware and processor, and is designed based on the policy of "loose standardization" which values the reduction of the runtime overhead and memory footprint

Currently, ITRON specification-compliant OS is used for 50% or more of the embedded systems in Japan.

<Reference>
https://www.tron.org/tron-project/itron

Page TOP

TRON

[Q2] ITRON and μITRON
What is the difference between ITRON and μITRON?

[A2] 
μITRON specification is a name for a real-time OS specification based on ITRON specification with reduced number of functions so that it can be implemented on processors whose memory capacity and performance are limited.
Initially, μITRON specification was a specification for 8 to 16-bit MCUs. However currently, the specification has enough scalability to apply to MCUs from 8 to 32 bits.

Page TOP

TRON

[Q3] The relationship among ITRON specification OS, T-Kernel and μT-Kernel
What is the relationship among ITRON specification OS, T-Kernel and μT-Kernel?

[A3] 
ITRON specification OS is designed to achieve the small size and good performance by focusing on only some functions.
For μITRON, individual implementation can be freely done as only the functional specification as a real-time OS is stipulated aiming to adjust implementation to small embedded devices as well.

On the other hand, for T-Kernel, the detailed differences among implementations have been eliminated by releasing the source code as well as the specification and the distribution of the device driver and middleware has been promoted.

T-Kernel is a new real-time OS specification designed based on ITRON specification OS focusing on compatibility and scalability.

It realizes high software portability by strictly stipulating the specification.

Basic middleware (T-Kernel Standard Extension) is implemented and provided. While maintaining the real-time control function of ITRON specification OS, this middleware enhances the scalability of the OS by adopting the functions of the subsystems, and provides the file management and process management by using the enhanced OS scalability.

μT-Kernel is a real-time OS specification designed for sufficient real-time performance even in resource poor environment for implementation in small embedded devices, etc. while maintaining the compatibility and scalability of the T-Kernel design policy.

History of ITRON specification OS and T-Kernel

History of ITRON specification OS and T-Kernel

History of ITRON specification OS and T-Kernel

Page TOP

TRON

[Q4] Loose standardization
What is loose standardization?

[A4] 
Loose standardization is an approach in which the part that can lead to deteriorated performance at the time of execution if it is standardized will be left out of standardization, and be left as the part that is dependent on hardware or applications. The idea of loose standardization makes it possible to maximize the performance on various types of hardware.
ITRON is designed based on the policy of loose standardization.

Page TOP

ITRON Specification-compatible Product Registration System

[Q5] Screening for ITRON specification-compatible product registration
I’d like to know about the screening for ITRON specification-compatible product registration.

[A5] 
TRON Forum has a registration system for ITRON specification-compatible products to promote the dissemination and development of ITRON specification. The forum aims to promote ITRON specification itself and the registered products through its public relations’ activities by having the ITRON specification-compatible products developed by each company registered. Please see the TRON Forum webpage for details.

<URL of ITRON Specification-compatible Product Registration System>
https://www.tron.org/tron-project/itron/i_products

Page TOP

Education and Learning

[Q6] What to learn first
What should I do first to learn about RTOSs such as ITRON specification OS and T-Kernel?

[A6] 
First, learn to program using the C language. Functions of RTOSs including both ITRON specification OS and T-Kernel (service calls) are defined by functions in the C language. Thus, application programs that use RTOS (programs that perform target operations) are generally developed in the C language.

The purpose or significance of using RTOS can be found in some technical magazines and books. Information including how to use service calls, the task division method and examples, etc., is introduced on many websites. Also, seminars are held in various places. It may be a good idea to find the seminar that fits your needs.

TRON Forum holds such seminars, too. We encourage you to consider attending our seminars.

Page TOP

Programming

[Q7] Real-time Performance
Can I create a program to guarantee real-time performance using RTOS?

[A7] 
Real-time performance is greatly affected by the way the application program is coded.

RTOS offers the required functions which allow the application developers to create a program which guarantees the real-time performance. You can create a program to guarantee the real-time performance by properly combining the functions provided by RTOS.

Page TOP

Programming

[Q8] High-speed execution
Do the speed of programs increase by using RTOS?

[A8] 
When multiple functions are used, compared to programs that do not use RTOS and are not very efficient, programs that use RTOS can run relatively efficiently because of task division, etc. This can increase the speed of the overall system.

However, the speed can only increase within the capacity of the MPU. If an application program with a single function is used, you do not lose performance by executing only the program itself without using RTOS.

Page TOP

Programming

[Q9] Supported MPU
On what type of MPUs can ITRON specification OS and T-Kernel be used?

[A9] 
ITRON specification OS and T-Kernel run on from 8-bit MPUs to 64-bit MPUs. They also run on DSPs, etc. as well as general-purpose MPUs. Please check supported MPUs with each OS vendor for ITRON specification OS, and at the TRON Forum webpage for T-Kernel.

Page TOP

Programming

[Q10] Using a standard library
What should I do to use a standard library with ITRON specification OS?

[A10] 
Following are the points to be noted.

(1) Whether the library functions are re-entrant
If they cannot be re-entered, mutual exclusion will be necessary.

(2) Memory management
Low-level processing of memory management functions (malloc, etc.) may be handled outside of the library, depending on the compiler. In such a case, such low-level functions are implemented by the user side. Then, the user associates the functions with the memory pool function of ITRON specification OS, or implements memory management processing on their own.

Page TOP

Programming

[Q11] Task stack size
How can task stack size be determined?

[A11] 
Required stack size depends on systems and applications. It is required to reserve the area necessary for the local variables which are used for the task and the area used for function calling, etc. In addition, the saved area of the task context for task scheduling and interrupt, and the area used for a service call need to be reserved.

It is recommended preparing a stack with sufficient size which does not cause stack overflow, then reduce memory usage by adjusting stack size.

Page TOP

Task Management Function

[Q12] What is a task?
What is the concept of "task"?

[A12] 
The unit of program execution seen from a kernel is called a task. From the application side, tasks seem to be independent from each other and executed in parallel.

Page TOP

Task Management Function

[Q13] Specification of precedence
Does the precedence need to be specified by consecutive numbers such as 1, 2, 3, … or non-consecutive numbers such as 2, 5, 6, 9, …?

[A13] 
Any value can be specified for precedence, such as 2, 5, 6, 9, …

Page TOP

Task Management Function

[Q14] Sharing codes among tasks
It seems like a function in the C language is specified for a task itself in μITRON. Is it possible to create multiple tasks with one function?

[A14] 
It is possible to create multiple tasks with a shared program code. Create and activate a task as many times as necessary. When you create multiple tasks with one function, implement the function as re-entrant.

Page TOP

Task Management Function

[Q15] Change of startup precedence of tasks
Can I change the startup precedence of the tasks after creating tasks?

[A15] 
No, you cannot change the startup precedence of the tasks after creating them. To change the precedence, delete the tasks, change the precedence values, and then create tasks again.

Page TOP

Task Management Function

[Q16] Setting and automatic change of priority
In one system, I was running a task after changing the task priority by chg_pri. However, it was changed to another priority after a while. Why is that?

[A16] 
The following are the potential factors.

  1. chg_pri was issued from another task or handler.
  2. The task was terminated and then was restarted. The task priority is changed to the one at the time of task creation when a task is restarted.
  3. The priority is temporarily changed due to the influence of mutex.

Page TOP

Task Management Function

[Q17] Forced task termination and resource release
If the task is terminated forcefully by ter_tsk, will the objects such as semaphore which is created by the task and the memory block obtained in the memory pool also be deleted?

[A17] 
Kernel objects such as semaphore and memory block exist independently from the task. Therefore, they will not be deleted after the task is terminated forcefully by ter_tsk. The same applies if invoking task is terminated by ext_tsk. If the task needs to be terminated after deleting kernel objects, etc, terminate the invoking task after letting it delete the objects, etc using task exception handling, etc.

Page TOP

Task-dependent Synchronization

[Q18] Distinguishing tslp_tsk and dly_tsk
Both tslp_tsk and dly_tsk can cause the wait state for a certain period of time. How can I decide which one to use?

[A18] 
tslp_tsk is used when a task is to be woken up by wup_tsk, etc. issued by another task or handler. If the task is woken up while in the wait state, tslp-tsk returns normally and the return value will be E_OK. (If the wake up request to the invoking task is queuing, no wait occurs and tslp-tsk returns normally.) If the task does not wake up within the specified time period, a time-out error occurs and the return value will be E_TMOUT.

dly_tsk is used when you want the invoking task to be put in the wait state for a certain period of time. The task does not need to be woken up by operations of another task or handler. If the task ends up waiting for the specified period of time, dly_tsk returns normally and the return value will be E_OK.

Even with parameters that specify wait for a certain period of time for tslp_tsk and dly_tsk, there are cases where the wait state is forcibly released before the specified period of time passes by. In such cases, the result turns out to be an error, and the return value will be E_RLWAI.

Page TOP

Task-dependent Synchronization

[Q19] Waiting time specified by tslp_tsk and dly_tsk
tslp_tsk and dly_tsk specify waiting time to the parameter. Is there any difference among the values to be specified?

[A19] 
The parameter of tslp_tsk is TMO type and can specify TMO_FEVR which means waiting infinitely. On the other hand, the parameter of dly_tsk is RELTIM type and cannot specify TMO_FEVR.

Attention is required as the behavior differs when 0 (in case of tslp_tsk, synonymous with TMO_POL) is specified as waiting time. With μITRON4.0 specification, in case of tslp_tsk(0), wait state is not entered. However, in case of dly_tsk(0), invoking task is moved to the wait state and the wait is released at the next time tick.

Page TOP

Synchronous Communication Function

[Q20] Memory area used in a mailbox
When I attempt to send a message using a mailbox, sometimes the received message is corrupted and a message cannot be sent. Why? Messages can be transmitted normally using a message buffer.

[A20] 
Using a mailbox, the top address of the memory area where the message is placed is sent. The receiving side accesses the message using the received top address. In other words, the sending side needs to retain the content of the memory area where the message is placed until the receiving side finishes using the message trying not to corrupt the content (message).

Suppose the memory area where a message is placed is retained as an automatic variable, and its top address is sent using a mailbox. At this time, if a function that has the automatic variable returns, the memory area will be released at the same time. Although the receiving side can receive the top address normally, it does not necessarily mean that the message can be used. (In some cases the message remains, but it is not always the correct data.)

The memory area where a message is placed should be retained as static area and kept (without corrupting the data) until it is confirmed that the receiving side finished using the message. Or it is necessary for the sending side to obtain the memory area using memory pools or malloc and for the receiving side to release the memory area, etc.

On the other side, when a message buffer is used, the message is copied into the buffer (memory area) of the message buffer. Therefore, the memory area used for sending the message does not need to be kept after the sending is complete. However, as the message is copied when it is sent and received, the sending and receiving processing takes time when a long message is transmitted.

Page TOP

Synchronous Communication Function

[Q21] Sending message to a task
Is it possible to send a message to the particular task?

[A21] 
ITRON specification OS does not have a function to specify a task and send a message to it. This function can be realized by creating a dedicated mailbox used by the receiving task.

Page TOP

Synchronous Communication Function

[Q22] Order of receiving messages
When multiple tasks send a message in a message buffer, in what order are the messages sent?

[A22] 
They are sent in the order of messages entering the wait state (FIFO). There is no such function that sends the messages in the order of task priority.

Page TOP

Synchronous Communication Function

[Q23] Abandonment of execution right by rot_rdq
What happens if rot_rdq is issued in the state where dispatch is prohibited?

[A23] 
Even in the state where dispatch is prohibited, the priority order is changed if rot_rdq is issued. However, dispatch does not occur. When dispatch is permitted, the control is passed the task which has the highest priority. For this reason, even if rot_rdq is issued by specifying the current priority of its own to the targeted priority, the execution right is not abandoned immediately.

Page TOP

Interrupt Management Function

[Q24] Return from an interrupt handler
What happens if an interrupt hander returns without issuing ret_int() after invoking an ixxx_yyy service call?

[A24] 
In μITRON 4.0, ret_int() service call is not defined. However, if a similar service call is defined in an implement-dependent manner, dispatch may be put on hold by returning from an interrupt without issuing ret_int().

Page TOP

Interrupt Management Function

[Q25] Interrupt outside kernel management
Can we invoke ixxx_yyy service calls from interrupt handlers that are not under the management of kernel?
Do such interrupt handlers need to invoke ret_int()?

[A25] 
An implementation of RTOS based on μITRON 4.0 specification can define interrupts (and their handlers) with priority higher than a certain priority as interrupts outside the kernel’s management. Such interrupts includes non-maskable interrupts. Such interrupts outside the management of kernel can be serviced even when the interrupt is disabled in the OS itself. However, such interrupt handlers should not invoke service calls.

Page TOP

Interrupt Management Function

[Q26] Issuing a service call from an interrupt handler
What happens if an unpermitted service call (other than ixxx_yyy/sns_yyy) is issued by an interrupt handler (including service routine)?

[A26] 
In general, an error E_CTX will be returned and the service call will not be executed. However, depending on the implementation, there are cases where the service call can be invoked or an error will not be returned.

Page TOP

System State Management Function

[Q27] CPU lock state
What is "CPU lock state?"

[A27] 
CPU lock state is the state in which interrupt handler, time event handler, etc. are not started, and task dispatch is not performed.

Page TOP

Real-time OS Products

[Q28] Task control block
How is the task control block structured?

[A28] 
Area for the task control block for the use of each task must be in the memory. The structure and size of the task control block differ depending on the OS.

Page TOP

Real-time OS Products

[Q29] TLB
What is the structure of TLB which RTOS internally uses?

[A29] 
In case of an OS which manages address space using MMU, TLB area needs to be reserved in the main memory.

The structure and size of TLB vary according to OS.

Page TOP

Real-time OS Products

[Q30] Verification
Let me know the status of OS verification.

[A30] 
The verification status varies depending on the OS. Please contact the OS provider.

For the products registered under the ITRON Specification OS Compatible Product Registration System and contact information for inquiries regarding such registered products, refer to the following page.
https://www.tron.org/tron-project/itron/i_products

Page TOP

Return Top