RTA-OS3.0 Reference Guide
RTA-OS3.0 Reference Guide
0
Reference Guide
Copyright
The data in this document may not be altered or amended without special
notification from ETAS GmbH. ETAS GmbH undertakes no further obligation
in relation to this document. The software described in it can only be used
if the customer is in possession of a general license agreement or single li-
cense. Using and copying is only allowed in concurrence with the specifica-
tions stipulated in the contract. Under no circumstances may any part of this
document be copied, reproduced, transmitted, stored in a retrieval system or
translated into another language without the express written permission of
ETAS GmbH.
The names and designations used in this document are trademarks or brands
belonging to the respective owners.
Document: 10384-RG-1.0.0
2 Copyright
Contents
1 Introduction 16
1.3 References . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2 ActivateTask . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.3 CancelAlarm . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.4 ChainTask . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.5 ClearEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.6 DisableAllInterrupts . . . . . . . . . . . . . . . . . . . . . . 28
2.7 EnableAllInterrupts . . . . . . . . . . . . . . . . . . . . . . . 30
2.8 GetActiveApplicationMode . . . . . . . . . . . . . . . . . . 32
2.9 GetAlarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.10 GetAlarmBase . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.11 GetCounterValue . . . . . . . . . . . . . . . . . . . . . . . . 37
2.12 GetElapsedCounterValue . . . . . . . . . . . . . . . . . . . 39
2.13 GetEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.14 GetISRID . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.15 GetResource . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.16 GetScheduleTableStatus . . . . . . . . . . . . . . . . . . . . 47
2.17 GetTaskID . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.18 GetTaskState . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.19 IncrementCounter . . . . . . . . . . . . . . . . . . . . . . . 53
Contents 3
2.20 NextScheduleTable . . . . . . . . . . . . . . . . . . . . . . . 55
2.21 Os_AdvanceCounter . . . . . . . . . . . . . . . . . . . . . . 57
2.22 Os_AdvanceCounter_<CounterID> . . . . . . . . . . . . . . 60
2.23 Os_GetExecutionTime . . . . . . . . . . . . . . . . . . . . . 62
2.24 Os_GetISRMaxExecutionTime . . . . . . . . . . . . . . . . . 64
2.25 Os_GetISRMaxStackUsage . . . . . . . . . . . . . . . . . . 66
2.26 Os_GetStackSize . . . . . . . . . . . . . . . . . . . . . . . . 68
2.27 Os_GetStackUsage . . . . . . . . . . . . . . . . . . . . . . . 70
2.28 Os_GetStackValue . . . . . . . . . . . . . . . . . . . . . . . 72
2.29 Os_GetTaskMaxExecutionTime . . . . . . . . . . . . . . . . 73
2.30 Os_GetTaskMaxStackUsage . . . . . . . . . . . . . . . . . . 75
2.31 Os_GetVersionInfo . . . . . . . . . . . . . . . . . . . . . . . 77
2.32 Os_IncrementCounter_<CounterID> . . . . . . . . . . . . . 78
2.33 Os_ResetISRMaxExecutionTime . . . . . . . . . . . . . . . . 79
2.34 Os_ResetISRMaxStackUsage . . . . . . . . . . . . . . . . . 81
2.35 Os_ResetTaskMaxExecutionTime . . . . . . . . . . . . . . . 83
2.36 Os_ResetTaskMaxStackUsage . . . . . . . . . . . . . . . . . 85
2.37 Os_Restart . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
2.38 Os_SetRestartPoint . . . . . . . . . . . . . . . . . . . . . . . 89
2.39 ReleaseResource . . . . . . . . . . . . . . . . . . . . . . . . 91
2.40 ResumeAllInterrupts . . . . . . . . . . . . . . . . . . . . . . 93
2.41 ResumeOSInterrupts . . . . . . . . . . . . . . . . . . . . . . 95
2.42 Schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
2.43 SetAbsAlarm . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4 Contents
2.46 ShutdownOS . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Contents 5
3.16 StartupHook . . . . . . . . . . . . . . . . . . . . . . . . . . 144
6 Contents
4.24 Std_ReturnType . . . . . . . . . . . . . . . . . . . . . . . . . 153
Contents 7
5.2 CAT1_ISR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
8 Contents
5.28 OS_NUM_APPMODES . . . . . . . . . . . . . . . . . . . . . . 169
Contents 9
6.8 Os_LogCat1ISREnd . . . . . . . . . . . . . . . . . . . . . . . 187
10 Contents
6.34 Os_TriggerOnAdvanceCounter . . . . . . . . . . . . . . . . 235
Contents 11
7.3 Os_Cbk_TraceCommInitTarget . . . . . . . . . . . . . . . . 264
12 Contents
10.1 Namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Contents 13
12.2.3 Examples . . . . . . . . . . . . . . . . . . . . . . 299
13.2.1 OS . . . . . . . . . . . . . . . . . . . . . . . . . . 302
14 Contents
14.2.10 Software Counter Driver . . . . . . . . . . . . . . 312
Contents 15
1 Introduction
This guide contains the complete technical reference for RTA-OS3.0. The con-
tent is arranged into two parts:
• Part 1 deals with the OS kernel, describing the API, types, macros, etc.
that are supported by RTA-OS3.0 and common to all target hardware.
• Part 2 deals with the PC-based tooling provided with RTA-OS3.0. The
command line interfaces, input and output file formats etc. that are
common to all target hardware are described.
You should also be familiar with common use of the Microsoft Windows®2000,
Windows®XP or Windows®Vista operating systems, including installing soft-
ware, selecting menu items, clicking buttons, navigating files and directories.
16 Introduction
Activate(Task1) Program code, header file names,
C type names, C functions and
RTA-OS3.0. Component API call
names all appear in the courier
typeface.
See Section 1.2. Hyperlinks through the document
are shown in red letters.
Functionality that is provided in
RTA-OS3.0 but it may not be
portable to another AUTOSAR OS
implementation is marked with the
ETAS logo.
Caution! Notes like this contain im-
portant instructions that you must
follow carefully in order for things
to work correctly.
1.3 References
OSEK is a European automotive industry standards effort to produce open
systems interfaces for vehicle electronics. For details of the OSEK standards,
please refer to:
http://www.osek-vdx.org
http://www.autosar.org
Introduction 17
2 RTA-OS3.0 API calls
Syntax
/* C function prototype for the API call */
ReturnValue NameOfAPICall(Parameter Type, ...)
Parameters
A list of parameters for each API call and their mode:
out The parameter is passed out of the API call by passing a reference
(pointer) to the parameter into the call.
inout The parameter is passed into the call and then (updated) and passed
out.
Return Values
Where API calls return a StatusType the values of the type returned and
an indication of the reason for the error/warning are listed. The build column
indicates whether the value is returned for both standard and extended status
builds or for extended status build only.
Description
A detailed description of the behavior of the API call.
Portability
The RTA-OS3.0 API includes four classes of API calls:
OSEK OS calls are those specified by the OSEK OS standard. OSEK OS calls
are portable to other implementations of OSEK OS and are portable to
other implementations of AUTOSAR OS R3.0.
Example Code
A C code listing showing how to use the API calls
Calling Environment
The valid calling environment for the API call. A 3 indicates that a call can be
made in the indicated context. A 7 indicates that the call cannot be made in
the indicated context.
See Also
A list of related API calls.
Syntax
StatusType ActivateTask(
TaskType TaskID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
If TaskID is in the suspended state then it is transferred into the ready state.
If TaskID is in either the ready or the running state and the total number of
queued activations is less than the task activation limit then the requested
activation is queued.
- if the caller is a non-preemptive task the rescheduling does not occur until
the caller terminates or makes a Schedule() call.
- if the caller is a preemptive task and TaskID is higher priority then reschedul-
ing will take place immediately.
- if the caller is a Category 2 ISR then rescheduling will not occur until the
Category 2 ISR terminates.
Portability
Calling Environment
See Also
DeclareTask
ChainTask
TerminateTask
GetTaskState
GetTaskID
Syntax
StatusType CancelAlarm(
AlarmType AlarmID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call cancels (stops) the specified alarm.
Portability
Example
TASK(MyExtendedTask){
...
CancelAlarm(TimeOutAlarm);
...
}
Calling Environment
CancelAlarm
DeclareAlarm
GetAlarm
GetAlarmBase
SetRelAlarm
Syntax
StatusType ChainTask(
TaskType TaskID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This service causes the termination of the calling task followed by the activa-
tion of TaskID. A successful call of ChainTask() does not return to the calling
context.
Standard or linked resources held by the calling task are also released auto-
matically and this is reported as an error condition in extended status.
A task can chain itself without affecting the queued activation count.
The ChainTask() call always causes re-scheduling. However, note that TaskID
may not run immediately - there may be higher priority tasks in the ready
queue that will run in preference, for example tasks with a higher priority
that share an internal resource with TaskID.
Example
TASK(MyTask){
...
ChainTask(YourTask);
/* Any code here will not execute if the call is successful
*/
...
}
Calling Environment
See Also
DeclareTask
ActivateTask
TerminateTask
GetTaskState
GetTaskID
Syntax
StatusType ClearEvent(
EventMaskType Mask
)
Parameters
Return Values
The call returns values of type StatusType.
Description
The events of the extended task calling ClearEvent are cleared according to
the event mask Mask.
Any events that are not set in the event mask remain unchanged.
Portability
Example
TASK(MyExtendedTask){
EventMaskType WhatHappened;
while (WaitEvent(Event1 | Event2 | Event3) == E_OK ) {
GetEvent(MyExtendedTask, &WhatHappened);
if (WhatHappened & Event1) {
ClearEvent(Event1);
/* Take action on Event1 */
...
} else if (WhatHappened & (Event2 | Event3) {
ClearEvent(Event2 | Event3);
/* Take action on Event2 or Event3 */
...
}
Calling Environment
See Also
DeclareEvent
GetEvent
SetEvent
WaitEvent
Syntax
void DisableAllInterrupts(void)
Return Values
None.
Description
This call is intended to start a (short) critical section of the code. This critical
section must be finished by calling EnableAllInterrupts(). No API calls are
allowed within the critical section.
The call does not support nesting. If nesting is needed for critical sections,
e.g. for libraries, then SuspendAllInterrupts()/ResumeAllInterrupts() should
be used.
Portability
Example
TASK(MyTask){
...
DisableAllInterrupts();
/* Critical section */
/* No RTA-OS3.0 API calls allowed */
EnableAllInterrupts();
...
}
Calling Environment
EnableAllInterrupts
ResumeAllInterrupts
ResumeOSInterrupts
SuspendAllInterrupts
SuspendOSInterrupts
Syntax
void EnableAllInterrupts(void)
Return Values
None.
Description
This API call marks the end of a critical section that is protected from any
maskable interrupt occuring. The critical section must have been entered
using the DisableAllInterrupts() call.
This call restores the state of the interrupt mask saved by DisableAllInter-
rupts().
Portability
Example
TASK(MyTask){
...
DisableAllInterrupts();
/* Critical section */
/* No RTA-OS3.0 API calls allowed */
EnableAllInterrupts();
...
}
Calling Environment
DisableAllInterrupts
ResumeAllInterrupts
ResumeOSInterrupts
SuspendAllInterrupts
SuspendOSInterrupts
Syntax
AppModeType GetActiveApplicationMode(void)
Return Values
The call returns values of type AppModeType.
Description
The call returns the currently active application mode (i.e. the value of
parameter that was passed to StartOS()). The call can be used to write
application-mode dependant code.
Portability
Example
TASK(MyTask){
...
if (GetActiveApplicationMode() == DiagnosticsMode) {
/* Send diagnostic message */
}
...
}
Calling Environment
See Also
StartOS
Syntax
StatusType GetAlarm(
AlarmType AlarmID,
TickRefType Tick
)
Parameters
Return Values
The call returns values of type StatusType.
Description
Returns the relative number of ticks from the point at which the call was made
before the alarm AlarmID is due to expire.
Note that between making this call and evaluating the out parameter Tick the
task may have been pre-empted and the alarm may have already expired.
Exercise caution when making program decisions based on the value of Tick.
Portability
Example
TASK(MyTask){
TickType TicksToExpiry;
...
GetAlarm(MyAlarm, &TicksToExpiry);
...
}
See Also
CancelAlarm
DeclareAlarm
GetAlarmBase
SetAbsAlarm
SetRelAlarm
Syntax
StatusType GetAlarmBase(
AlarmType AlarmID,
AlarmBaseRefType Info
)
Parameters
Return Values
The call returns values of type StatusType.
Description
GetAlarmBase() reads the alarm base characteristics. These are the static
properties of the counter with which AlarmID is associated.
The out parameter Info refers to a structure in which the information of data
type AlarmBaseType gets stored.
Portability
Example
TASK(MyTask){
AlarmBaseType Info;
TickType maxallowedvalue;
TickType ticksperbase;
TickType mincycle;
GetAlarmBase(MyAlarm, &Info);
maxallowedvalue = Info.maxallowedvalue;
ticksperbase = Info.ticksperbase;
mincycle = Info.mincycle;
Calling Environment
See Also
CancelAlarm
DeclareAlarm
GetAlarm
SetAbsAlarm
SetRelAlarm
Syntax
StatusType GetCounterValue(
CounterType CounterID,
TickRefType Value
)
Parameters
Return Values
The call returns values of type StatusType.
Description
Returns the current value of the specified counter CounterID in Value.
The Operating System ensures that the lowest value is zero and consecutive
reads return an increasing count value until the counter wraps.
Portability
Example
Task(MyTask){
TickType Value;
...
GetCounterValue(MyCounter,&Value);
...
}
See Also
IncrementCounter
GetElapsedCounterValue
Os_AdvanceCounter
Os_AdvanceCounter_<CounterID>
Os_IncrementCounter_<CounterID>
Syntax
StatusType GetElapsedCounterValue(
CounterType CounterID,
TickRefType Value,
TickRefType ElapsedValue
)
Parameters
Return Values
The call returns values of type StatusType.
Description
Returns the number of ticks that have elapsed on the counter current since
Value.
Value is updated with the the current value of the counter when the call re-
turns.
Note that the call can only return a value up to maxallowedvalue ticks in
length.
If the counter has ticked more than maxallowedvalue ticks since Value then
ElapsedValue will be Value modulo maxallowedvalue.
Portability
Example
Task(MyTask){
Calling Environment
See Also
GetCounterValue
Syntax
StatusType GetEvent(
TaskType TaskID,
EventMaskRefType Event
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call returns all event that are set for the extended task TaskID.
Note that all set events are returned, regardless of which events the task may
have been waiting for.
Portability
Example
TASK(MyExtendedTask){
EventMaskType WhatHappened;
while (WaitEvent(Event1 | Event2 | Event3) == E_OK ) {
GetEvent(MyExtendedTask, &WhatHappened);
if(WhatHappened & Event1) {
ClearEvent(Event1);
/* Take action on Event1 */
...
} else if (WhatHappened & (Event2 | Event3) {
ClearEvent(Event2 | Event3);
Calling Environment
See Also
ClearEvent
DeclareEvent
SetEvent
WaitEvent
Syntax
ISRType GetISRID(void)
Return Values
The call returns values of type ISRType.
Description
The call returns the ID of the currently running Category2 ISR or INVALID_ISR
no ISR is running. The main use of the call is to identify which ISR is running
in hook functions.
Portability
Example
FUNC(void, OS_APPL_CODE) ErrorHook(StatusType Error){
ISRType ISRInError;
TaskType TaskInError;
ISRInError = GetISRID();
if (ISRInError != INVALID_ISR) {
/* Must be an ISR in error */
} else {
/* Maybe its a task in error */
GetTaskID(&TaskInError);
...
}
...
}
Calling Environment
Syntax
StatusType GetResource(
ResourceType ResID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call enters a named critical section (the resource), protecting the code
inside the critical section against concurrent access by any other tasks and
ISRs that are configured to be able to access the resource.
Nested resource occupation is allowed, but only where the inner critical
sections are completely executed within the surrounding critical section as
shown in the example.
Nested occupation of the same resource is not allowed, although you can use
linked resources to achieve this effect.
Calls that put the running task into any other state must not be used in critical
sections. (e.g. as ChainTask(), Schedule(), TerminateTask() or WaitEvent().)
A system where Category 2 ISRs can lock a resource has slightly higher run-
time overheads than one where only Tasks lock resources.
Example
TASK(MyTask){
...
GetResource(Outer);
/* Outer Critical Section */
...
GetResource(Inner);
/* Inner Critical Section */
ReleaseResource(Inner);
...
ReleaseResource(Outer);
...
}
Calling Environment
See Also
DeclareResource
ReleaseResource
Syntax
StatusType GetScheduleTableStatus(
ScheduleTableType ScheduleTableID,
ScheduleTableStatusRefType ScheduleStatus
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call returns the status of the ScheduleTableID.
Portability
Example
TASK(MyTask){
ScheduleTableStatusType Status;
GetScheduleTableStatus(MyScheduleTable, &Status);
if (Status != SCHEUDLETABLE_RUNNING){
StartScheduleTableAbs(MyScheduleTable,42);
Calling Environment
See Also
DeclareScheduleTable
NextScheduleTable
StartScheduleTableAbs
StartScheduleTableRel
StopScheduleTable
Syntax
StatusType GetTaskID(
TaskRefType TaskID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
The call returns a reference to the currently running Task. If the call is made
from a task, then it will return the identifer of that task. The main use of the
call is to identify which task is running in hook functions.
Portability
Example
FUNC(void, OS_APPL_CODE) ErrorHook(StatusType Error){
TaskType TaskInError;
GetTaskID(&TaskInError);
if (TaskInError == INVALID_TASK) {
/* Must be an ISR in error */
} else if (TaskInError == MyTask) {
/* Do something */
}
...
}
See Also
DeclareTask
TerminateTask
GetTaskState
GetTaskID
GetISRID
Syntax
StatusType GetTaskState(
TaskType TaskID,
TaskStateRefType State
)
Parameters
Return Values
The call returns values of type StatusType.
Description
The call returns the state of the task at the point GetTaskState() was called.
The main use of this API is to check that an extended task is not in the sus-
pended state before setting an event.
Note that when called from a pre-emptive task or from an ISR the state may
already be incorrect at the time it is evaluated because preemption may have
occurred between the call returning and the result being evaluated.
Portability
Example
TASK(MyTask){
...
TaskStateType CurrentState;
...
GetTaskState(YourTask, &CurrentState);
switch (CurrrentState) {
Calling Environment
See Also
DeclareTask
TerminateTask
GetTaskState
GetTaskID
Syntax
StatusType IncrementCounter(
CounterType CounterID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call increments (adds one to) CounterID. CounterID must be a software
counter.
If any alarms on the counter are triggered by the increment then the alarm
actions will be executed before the call returns.
Note that if an error occurs during the expiry of an alarm (for example, a task
activation raises E_OS_LIMIT), the error hook(s) are called for each error that
occurs.
Portability
Example
ISR(MillisecondTimerInterrupt){
...
IncrementCounter(MillisecondCounter);
...
}
See Also
Os_AdvanceCounter
Os_AdvanceCounter_<CounterID>
Os_IncrementCounter_<CounterID>
Syntax
StatusType NextScheduleTable(
ScheduleTableType ScheduleTableID_From,
ScheduleTableType ScheduleTableID_To
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call starts the processing of schedule table of ScheduleTableID_To
ScheduleTableID_From.FinalDelay ticks after the Final Expiry Point on Sched-
uleTableID_From has been processed.
If either schedule table is not valid or they are driven by different counters
then the states of both tables remain unchanged.
Example
TASK(MyTask){
/* Stop MyScheduleTable at the end and start
YourScheduleTable */
NextScheduleTableAbs(MyScheduleTable, YourScheduleTable);
...
}
Calling Environment
See Also
DeclareScheduleTable
GetScheduleTableStatus
StartScheduleTableAbs
StartScheduleTableRel
StopScheduleTable
Syntax
StatusType Os_AdvanceCounter(
CounterType CounterID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call tells the OS that the counter value has matched the value previously
set via the Os_Cbk_Set_<CounterID> callback.
The OS will then process any alarm or expiry point actions that are due. It will
then either set a new match value (via Os_Cbk_Set_<CounterID>) or cancel
counter matching (via Os_Cbk_Cancel_<CounterID>).
Note that it is possible for the new counter match value to be reached before
leaving any interrupt that is being used to drive the counter. It is important
that this occurance is not missed because otherwise the counter will not be
awoken again until a complete wrap of the underlying hardware counter value
has occured.
Example
/* For systems where the interrupt will be re-entered
automatically if the match occurs before leaving the ISR: */
ISR(SimpleCounterDriver){
Os_AdvanceCounter(MyHWCounter);
}
/* For systems where the software can force the interrupt to
get re-entered if the match occurs before leaving the ISR:
*/
ISR(RetriggeringCounterDriver){
Os_ScheduleTableStatusType CurrentState;
Os_AdvanceCounter(MyHWCounter);
Os_Cbk_State_MyHWCounter(&CurrentState);
if (CurrentState.Running && CurrentState.Pending) {
/* Retrigger this interrupt */
}
}
/* For systems where the software has to loop if the match
occurs before leaving the ISR: */
ISR(LoopingCounterDriver){
Os_ScheduleTableStatusType CurrentState;
do {
Os_AdvanceCounter(MyHWCounter);
Os_Cbk_State_MyHWCounter(&CurrentState);
} while (CurrentState.Running && CurrentState.Pending);
}
Calling Environment
IncrementCounter
Os_AdvanceCounter_<CounterID>
Os_IncrementCounter_<CounterID>
Os_Cbk_Set_<CounterID>
Os_Cbk_Cancel_<CounterID>
Os_Cbk_State_<CounterID>
Syntax
StatusType Os_AdvanceCounter_CounterID(void)
Return Values
The call returns values of type StatusType.
Description
This call has the same behavior as Os_AdvanceCounter(CounterID) but is cus-
tomized for a specific counter. This makes the call faster and more suitable
for use in interrupt handlers.
Portability
Example
/* For systems where the interrupt will be re-entered
automatically if the match occurs before leaving the ISR: */
ISR(SimpleCounterDriver){
Os_AdvanceCounter_MyHWCounter();
}
/* For systems where the software can force the interrupt to
get re-entered if the match occurs before leaving the ISR:
*/
ISR(RetriggeringCounterDriver){
Os_ScheduleTableStatusType CurrentState;
Os_AdvanceCounter_MyHWCounter();
Os_Cbk_State_MyHWCounter(&CurrentState);
if (CurrentState.Running && CurrentState.Pending) {
/* Retrigger this interrupt */
}
}
/* For systems where the software has to loop if the match
occurs before leaving the ISR: */
ISR(LoopingCounterDriver){
Os_ScheduleTableStatusType CurrentState;
do {
Calling Environment
See Also
IncrementCounter
Os_AdvanceCounter
Os_IncrementCounter_<CounterID>
Os_Cbk_Set_<CounterID>
Os_Cbk_Cancel_<CounterID>
Os_Cbk_State_<CounterID>
Syntax
Os_StopwatchTickType Os_GetExecutionTime(void)
Return Values
The call returns values of type Os_StopwatchTickType.
Description
Returns the net execution time consumed (i.e. excluding all preemptions)
since the start of the Task or ISR.
Any value read in PostTaskHook() is valid, but it will be greater than the value
that is used to determine a task’s maximum execution time.
If the value overflows, then the returned value will be the wrapped value.
Time monitoring must be enabled for this API to give meaningful results. It
returns zero if time monitoring is not enabled.
Portability
Example
TASK(MyTask){
Os_StopwatchTickType Start, Finish, Used, APICallCorrection;
Start = GetExecutionTime();
Finish = GetExecutionTime();
APICallCorrection = Finish - Start; /* Get time for
GetExecutionTime() call itself. */
Start = GetExecutionTime();
Call3rdPartyLibraryFunction(); /* Measure 3rd Party
Library Code Execution Time */
Finish = GetExecutionTime();
Used = Finish - Start - APICallCorrection; /* Calculate the
amount of time used. */
}
See Also
Os_GetISRMaxExecutionTime
Os_GetTaskMaxExecutionTime
Os_ResetISRMaxExecutionTime
Os_ResetTaskMaxExecutionTime
Syntax
Os_StopwatchTickType Os_GetISRMaxExecutionTime(
ISRType ISRID
)
Parameters
Return Values
The call returns values of type Os_StopwatchTickType.
Description
Returns the maximum observed execution time for the Category 2 ISR iden-
tified by ISRID.
This maximum value is over all complete invocations of the Category 2 ISR
that have completed since the previous call to ResetISRMaxExecutionTime()
for that Category 2 ISR or to StartOS().
Portability
Example
TASK(LoggingTask){
Os_StopwatchTickType ExecutionTimes[MAXISRS];
...
ExecutionTimes[0] = GetISRMaxExecutionTime(ISR1);
ExecutionTimes[1] = GetISRMaxExecutionTime(ISR2);
...
}
See Also
Os_GetExecutionTime
Os_GetTaskMaxExecutionTime
Os_ResetISRMaxExecutionTime
Os_ResetTaskMaxExecutionTime
Syntax
Os_StackSizeType Os_GetISRMaxStackUsage(
ISRType ISRID
)
Parameters
Return Values
The call returns values of type Os_StackSizeType.
Description
Returns the maximum observed stack usage for the Category 2 ISR identified
by ISRID.
This maximum value is over all invocations of the Category 2 ISR since the
previous call to ResetISRMaxStackUsage() for that Category 2 ISR or to Star-
tOS().
Portability
Example
TASK(LoggingTask){
Os_StackSizeType StackUsages[MAXISRS];
...
StackUsages[0] = GetISRMaxStackUsage(ISR1);
StackUsages[1] = GetISRMaxStackUsage(ISR2);
...
}
See Also
Os_GetStackUsage
Os_GetTaskMaxStackUsage
Os_ResetISRMaxStackUsage
Os_ResetTaskMaxStackUsage
Syntax
Os_StackSizeType Os_GetStackSize(
Os_StackValueType Base,
Os_StackValueType Sample
)
Parameters
Return Values
The call returns values of type Os_StackSizeType.
Description
Returns the difference between 2 Os_StackValueType values. To obtain a cor-
rect
value, it is important that ’Base’ represents an instant when the stack size
was smaller than (or the same as) the point at which ’Sample’ was measured.
Portability
Example
Os_StackValueType start_position;
Os_StackValueType end_position;
Os_StackSizeType stack_size;
TASK(MyTask){
start_position = Os_GetStackValue();
nested_call();
stack_size = Os_GetStackSize(start_position, end_position);
}
void nested_call(void) {
end_position = Os_GetStackValue();
}
See Also
Os_GetStackValue
Os_GetStackUsage
Syntax
Os_StackSizeType Os_GetStackUsage(void)
Return Values
The call returns values of type Os_StackSizeType.
Description
Returns the amount of stack used by the calling Task or ISR at the point of the
call.
The value is measured from the point at which the OS kernel starts to run the
Task or ISR, and it includes overheads within the kernel so that the values re-
turned can be used directly in the configuration of the stack allocation budget
for a Task or ISR.
Calling this API has the side-effect of updating the recorded maximum stack
usage for the calling Task or ISR (where necessary).
If the Task/ISR has a stack allocation budget, then a stack overrun may be
reported before this API returns.
Portability
Example
TASK(MyTask){
Os_StackSizeType stack_size;
stack_size = Os_GetStackUsage();
nested_call();
}
void nested_call(void) {
Os_GetStackUsage(); /* Identifies a possible max stack usage
location */
}
See Also
Os_Cbk_StackOverrunHook
Os_GetISRMaxStackUsage
Os_GetTaskMaxStackUsage
Os_ResetISRMaxStackUsage
Os_ResetTaskMaxStackUsage
Syntax
Os_StackValueType Os_GetStackValue(void)
Return Values
The call returns values of type Os_StackValueType.
Description
Returns the current position of the stack pointer (or pointers).
Portability
Example
Os_StackValueType start_position;
Os_StackValueType end_position;
Os_StackSizeType stack_size;
TASK(MyTask){
start_position = Os_GetStackValue();
nested_call();
stack_size = Os_GetStackSize(start_position, end_position);
}
void nested_call(void) {
end_position = Os_GetStackValue();
}
Calling Environment
See Also
Os_GetStackSize
Os_GetStackUsage
Syntax
Os_StopwatchTickType Os_GetTaskMaxExecutionTime(
TaskType TaskID
)
Parameters
Return Values
The call returns values of type Os_StopwatchTickType.
Description
Returns the maximum observed execution time for TaskID.
This maximum value is over all complete invocations of TaskID that have
completed since the previous call to ResetTaskMaxExecutionTime() for TaskID
or to StartOS().
Portability
Example
TASK(LoggingTask){
Os_StopwatchTickType ExecutionTimes[MAXTASKS];
...
ExecutionTimes[0] = GetTaskMaxExecutionTime(Task1);
ExecutionTimes[1] = GetTaskMaxExecutionTime(Task2);
ExecutionTimes[2] = GetTaskMaxExecutionTime(Task3);
ExecutionTimes[3] = GetTaskMaxExecutionTime(Task4);
...
}
See Also
Os_GetExecutionTime
Os_GetISRMaxExecutionTime
Os_ResetISRMaxExecutionTime
Os_ResetTaskMaxExecutionTime
Syntax
Os_StackSizeType Os_GetTaskMaxStackUsage(
TaskType TaskID
)
Parameters
Return Values
The call returns values of type Os_StackSizeType.
Description
Returns the maximum observed stack usage for TaskID.
This maximum value is over all invocations of TaskID since the previous call
to ResetTaskMaxStackUsage() for TaskID or to StartOS().
Portability
Example
TASK(LoggingTask){
Os_StackSizeType StackUsages[MAXTASKS];
...
StackUsages[0] = GetTaskMaxStackUsage(Task1);
StackUsages[1] = GetTaskMaxStackUsage(Task2);
StackUsages[2] = GetTaskMaxStackUsage(Task3);
StackUsages[3] = GetTaskMaxStackUsage(Task4);
...
}
See Also
Os_GetStackUsage
Os_GetISRMaxStackUsage
Os_ResetISRMaxStackUsage
Os_ResetTaskMaxStackUsage
Syntax
void Os_GetVersionInfo(
Std_VersionInfoType *versioninfo
)
Parameters
Return Values
None.
Description
The content of the structure ’Std_VersionInfoType’ is defined in Std_Types.h
Portability
Example
Std_VersionInfoType ver;
Os_GetVersionInfo(&ver);
Calling Environment
See Also
None.
Syntax
StatusType IncrementCounter_<CounterID>(void)
Return Values
The call returns values of type StatusType.
Description
This call has the same behavior as IncrementCounter(CounterID) but is cus-
tomized for a named counter. This makes the call faster and more suitable
for use in interrupt handlers.
Portability
Example
ISR(MillisecondTimerInterrupt){
...
Os_IncrementCounter_MillisecondCounter();
...
}
Calling Environment
See Also
IncrementCounter
Os_AdvanceCounter
Os_AdvanceCounter_<CounterID>
Syntax
StatusType Os_ResetISRMaxExecutionTime(
ISRType ISRID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
Reset the maximum observed execution time for the Category 2 ISR identified
by ISRID to zero.
Portability
Example
TASK(ProfilingTask){
Os_StopwatchTickType ExecutionTimeLog[SAMPLES];
...
ExecutionTimeLog[index++] = GetISRMaxExecutionTime(ISR1);
ResetISRMaxExecutionTime(ISR1);
...
}
See Also
Os_GetExecutionTime
Os_GetTaskMaxExecutionTime
Os_GetISRMaxExecutionTime
Os_ResetTaskMaxExecutionTime
Syntax
StatusType Os_ResetISRMaxStackUsage(
ISRType ISRID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
Reset the maximum observed stack usage for ISRID to zero.
Portability
Example
TASK(ProfilingTask){
Os_StackSizeType StackUsageLog[SAMPLES];
...
StackUsageLog[index++] = GetISRMaxStackUsage(ISR1);
ResetISRMaxStackUsage(ISR1);
...
}
Calling Environment
Os_GetStackUsage
Os_GetTaskMaxStackUsage
Os_GetISRMaxStackUsage
Os_ResetTaskMaxStackUsage
Syntax
StatusType Os_ResetTaskMaxExecutionTime(
TaskType TaskID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
Reset the maximum observed execution time for TaskID to zero.
Portability
Example
TASK(ProfilingTask){
Os_StopwatchTickType ExecutionTimeLog[SAMPLES];
...
ExecutionTimeLog[index++] = GetTaskMaxExecutionTime(Task1);
ResetTaskMaxExecutionTime(Task1);
...
}
Calling Environment
Os_GetExecutionTime
Os_GetISRMaxExecutionTime
Os_GetTaskMaxExecutionTime
Os_ResetISRMaxExecutionTime
Syntax
StatusType Os_ResetTaskMaxStackUsage(
TaskType TaskID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
Reset the maximum observed stack usage for TaskID to zero.
Portability
Example
TASK(ProfilingTask){
Os_StackSizeType StackUsageLog[SAMPLES];
...
StackUsageLog[index++] = GetTaskMaxStackUsage(Task1);
ResetTaskMaxStackUsage(Task1);
...
}
Calling Environment
Os_GetStackUsage
Os_GetISRMaxStackUsage
Os_GetTaskMaxStackUsage
Os_ResetISRMaxStackUsage
Syntax
StatusType Os_Restart(void)
Return Values
The call returns values of type StatusType.
Description
The call re-initializes any necessary context and branches to retstart point
set by Os_SetRestartPoint. The call does not return to the calling context.
The restart point must occur before a call to StartOS(), so that all OS re-
initialization re-occurs with the subsequent call to StartOS().
Portability
Example
FUNC(void, OS_APPL_CODE) ShutdownHook(StatusType Error){
...
Os_Restart();
...
}
Calling Environment
Os_SetRestartPoint
ShutdownOS
StartOS
Syntax
StatusType Os_SetRestartPoint(void)
Return Values
The call returns values of type StatusType.
Description
The call marks the location from which the code should resume following a
call to Os_Restart(). The location must be outside of OS control, i.e. at a point
before StartOS() was called. Making the call when a restart point is already
sets the restart point to the new location.
Portability
Example
OS_MAIN() {
...
Os_SetRestartPoint();
...
StartOS(OSDEFAULTAPPMODE);
Calling Environment
Os_Restart
ShutdownOS
StartOS
Syntax
StatusType ReleaseResource(
ResourceType ResID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
ReleaseResource is the counterpart of GetResource and serves to quit a crit-
ical section in the code.
Portability
Example
TASK(MyTask){
...
GetResource(Outer);
/* Outer Critical Section */
...
GetResource(Inner);
/* Inner Critical Section */
ReleaseResource(Inner);
...
ReleaseResource(Outer);
...
}
See Also
DeclareResource
GetResource
Syntax
void ResumeAllInterrupts(void)
Return Values
None.
Description
This API call marks the end of a critical section that is protected from any
maskable interrupt occuring. The critical section must have been entered
using the SuspendAllInterrupts() call.
Portability
Example
TASK(MyTask){
...
SuspendAllInterrupts():
/* Critical Section 1 */
FunctionWithNestedCriticalSection();
ResumeAllInterrupts():
...
}
void FunctionWithNestedCriticalSection(void) {
...
SuspendAllInterrupts():
/* Critical Section 2 */
ResumeAllInterrupts():
...
Calling Environment
See Also
DisableAllInterrupts
EnableAllInterrupts
ResumeOSInterrupts
SuspendAllInterrupts
SuspendOSInterrupts
Syntax
void ResumeOSInterrupts(void)
Return Values
None.
Description
This API call marks the end of a critical section that is protected from any
Category 2 (OS level) interrupt occuring. The critical section must have been
entered using the SuspendOSInterrupts() call.
Portability
Example
TASK(MyTask){
...
SuspendOSInterrupts():
/* Longer Critical Section */
SuspendAllInterrupts();
/* Shorter Critical Section */
ResumeAllInterrupts();
ResumeOSInterrupts():
...
}
See Also
DisableAllInterrupts
EnableAllInterrupts
ResumeAllInterrupts
SuspendAllInterrupts
SuspendOSInterrupts
Syntax
StatusType Schedule(void)
Return Values
The call returns values of type StatusType.
Description
The call allows a non-preemptive task, or a task/ISR that uses an internal
resource, to offer a preemption point.
1. The calling task is non-preemptive and a higher priority task has been
activated while the calling task was in the running state.
This service has no influence on preemptive tasks or ISRs that do not use
internal resources.
Note that allowing ISRs to share internal resources is an RTA-OS specific fea-
ture.
Portability
Example
TASK(MyTask){
CooperativeProcessA();
Schedule();
CooperativeProcessB();
Schedule();
CooperativeProcessC();
Calling Environment
See Also
DeclareTask
TerminateTask
GetTaskState
GetTaskID
Syntax
StatusType SetAbsAlarm(
AlarmType AlarmID,
TickType start,
TickType cycle
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call starts an alarm running and sets the match value with the associated
counter that triggers the alarm.
If cycle is equal to zero then the alarm will be triggered once only. If cycle is
nonzero then the alarm will be triggered every cycle ticks after start.
When the alarm expires, the statically configured action (activate a task / set
an event / run an alarm callback / increment a counter) occurs.
You must cancel an alarm if it is running before you can restart it with different
values.
Note that if the value of start is less than or equal to the current counter value
Portability
Example
TASK(MyTask){
...
/* SingleShotAlarm at tick 42 */
SetAbsAlarm(SingleShotAlarm, 42, 0);
...
/* PeriodicAlarm at 10, 60, 110, 160,... */
SetAbsAlarm(PeriodicAlarm, 10, 50);
...
}
Calling Environment
See Also
CancelAlarm
DeclareAlarm
GetAlarm
GetAlarmBase
SetRelAlarm
Syntax
StatusType SetEvent(
TaskType TaskID,
EventMaskType Mask
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This API call sets events for task TaskID according to Mask.
Events cannot be set for extended tasks that are in the suspended state.
In extended status this results in the error E_OS_STATE. In standard status,
setting an event for a suspended task has no effect.
Portability
Example
TASK(MyTask) {
Calling Environment
See Also
ClearEvent
DeclareEvent
SetEvent
WaitEvent
Syntax
StatusType SetRelAlarm(
AlarmType AlarmID,
TickType increment,
TickType cycle
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call starts an alarm running and sets the match value with the associated
counter that triggers the alarm. The match value is equal to the current
counter value plus the increment.
If cycle is equal to zero then the alarm will be triggered once only. If cycle is
nonzero then the alarm will be triggered every cycle ticks after start.
When the alarm expires, the statically configured action (activate a task / set
an event / run an alarm callback / increment a counter) occurs.
You must cancel an alarm if it is running before you can restart it with different
values.
Portability
Example
TASK(MyTask){
...
/* SingleShotAlarm in Now+123 ticks */
SetRelAlarm(SingleShotAlarm, 123, 0);
...
/* PeriodicAlarm at Now+42, Now+142, Now+184... */
SetRelAlarm(PeriodicAlarm, 42, 100);
...
}
Calling Environment
See Also
CancelAlarm
DeclareAlarm
GetAlarm
GetAlarmBase
SetAbsAlarm
Syntax
void ShutdownOS(
StatusType Error
)
Parameters
Return Values
None.
Description
This API causes the OS to shut down. Task scheduling, all interrupts, alarms
and schedule tables are stopped.
Portability
Example
TASK(MyTask){
...
if (ErrorCondition != E_OK) {
ShutdownOS(ErrorCondition);
}
...
}
See Also
Os_Restart
Os_SetRestartPoint
StartOS
Syntax
void StartOS(
AppModeType Mode
)
Parameters
Return Values
None.
Description
StartOS() initializes all internal OS data structures and starts the OS in the
specified Mode.
Any tasks that are autostarted in the specified Mode are set to the ready
state.
Any alarms or schedule tables that are autostarted in the specified Mode are
initialized appropriately.
The Mode OSDEFAULTAPPMODE must always exist, but other names can be
configured as needed.
StartOS() is only allowed outside the context of the OS. It has no effect if
called while the OS is already running.
Example
OS_MAIN() {
/* Initialize target hardware before starting OS */
StartOS(OSDEFAULTAPPMODE);
}
Calling Environment
See Also
Os_Restart
Os_SetRestartPoint
ShutdownOS
Os_Cbk_Idle
Syntax
StatusType StartScheduleTableAbs(
ScheduleTableType ScheduleTableID,
TickType Start
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call starts ScheduleTableID running when the counter reaches Start.
Note that if this gives a value less than or equal to the current counter value
then the first expiry will not happen until a full wrap of the underlying counter.
Portability
Example
TASK(MyTask){
/* Start MyScheduleTable when the associated counter reaches
100 */
StartScheduleTableAbs(MyScheduleTable, 100);
Calling Environment
See Also
DeclareScheduleTable
GetScheduleTableStatus
NextScheduleTable
StartScheduleTableRel
StopScheduleTable
Syntax
StatusType StartScheduleTableRel(
ScheduleTableType ScheduleTableID,
TickType Offset
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call starts ScheduleTableID running Offset ticks after the call was made.
Portability
Example
TASK(MyTask){
...
/* Start MyScheduleTable at Now+42 ticks */
StartScheduleTableRel(MyScheduleTable, 42);
...
}
See Also
DeclareScheduleTable
GetScheduleTableStatus
NextScheduleTable
StartScheduleTableAbs
StopScheduleTable
Syntax
StatusType StopScheduleTable(
ScheduleTableType ScheduleTableID
)
Parameters
Return Values
The call returns values of type StatusType.
Description
This call stops ScheduleTableID immediately. A call to StartScheduleTableAbs
or StartScheduleTableRel will re-start ScheduleTableID at the start.
Portability
Example
TASK(MyTask){
...
StopScheduleTable(MyScheduleTable);
...
}
See Also
DeclareScheduleTable
GetScheduleTableStatus
NextScheduleTable
StartScheduleTableAbs
StartScheduleTableRel
Syntax
void SuspendAllInterrupts(void)
Return Values
None.
Description
This API call marks the start of a critical section that is protected from any
maskable Category 1 or Category 2 interrupt occuring. The critical section
must be left with using the ResumeAllInterrupts() call.
The call saves the the current interrupt mask so that it can be restored later
by the ResumeAllInterrupts() call.
Portability
Example
TASK(MyTask){
...
SuspendAllInterrupts();;
...
ResumeAllInterrupts();;
...
}
See Also
DisableAllInterrupts
EnableAllInterrupts
ResumeAllInterrupts
ResumeOSInterrupts
SuspendOSInterrupts
Syntax
void SuspendOSInterrupts(void)
Return Values
None.
Description
This API call marks the start of a critical section that is protected from any
Category 2 interrupt occuring. Category 1 interrupts may still occur. The
critical section must be left using the ResumeOSInterrupts() call.
The call saves the the current interrupt mask so that it can be restored later
by the ResumeOSInterrupts() call.
Portability
Example
TASK(MyTask){
...
SuspendOSInterrupts():
/* Longer Critical Section */
...
SuspendAllInterrupts();
/* Shorter Critical Section */
ResumeAllInterrupts();
...
ResumeOSInterrupts():
...
}
See Also
DisableAllInterrupts
EnableAllInterrupts
ResumeAllInterrupts
ResumeOSInterrupts
SuspendOSInterrupts
Syntax
StatusType TerminateTask(void)
Return Values
The call returns values of type StatusType.
Description
This call terminates the calling task. This transfers the calling task from the
running state to the suspended state. The call does not return to the calling
context if successful.
If the calling task has queued activations pending then the next instance of
the task is automatically transferred into the ready state.
Standard or linked resources are also released automatically and this is re-
ported as an error condition in extended status.
Portability
Example
TASK(MyTask){
...
TerminateTask():
}
See Also
DeclareTask
TerminateTask
GetTaskState
GetTaskID
Syntax
StatusType WaitEvent(
EventMaskType Mask
)
Parameters
Return Values
The call returns values of type StatusType.
Description
Puts the calling task into the waiting state until one of the specified events is
set.
If one or more of the events is already set, then the task remains in the run-
ning state.
Portability
Example
TASK(MyExtendedTask){
...
WaitEvent(Event1);
/* Task resumes here when Event1 is set */
...
}
See Also
DeclareEvent
ClearEvent
GetEvent
SetEvent
Syntax
/* C function prototype for the callback */
ReturnValue NameOfCallback(Parameter Type, ...)
Parameters
A list of parameters for each callback and their mode:
out The parameter is passed out of the API callback by passing a reference
(pointer) to the parameter into the call.
inout The parameter is passed into the callback and then (updated) and
passed out.
Return Values
A description of the return value of the callback,
Description
A detailed description of the required functionality of the callback.
Portability
The portability of the call between OSEK OS, AUTOSAR OS, RTA-OS3.0 and
RTA-TRACE.
Example Code
A C code listing showing how to implement the callback.
Required When
The configuration that means user code must implement the callback.
See Also
A list of related callbacks.
Syntax
FUNC(void, OS_APPL_CODE)ErrorHook(
StatusType Error
)
Parameters
Return Values
None.
Description
This is called when an API call returns a StatusType not equal to E_OK. The
StatusType is passed into ErrorHook().
Macros are provided for obtaining information about the source of the error
ErrorHook(), but they are only available if the OS has been configured to gen-
erate them.
Portability
Example
Required when
Required when the ErrorHook is configured.
Syntax
FUNC(void, OS_APPL_CODE) Os_Cbk_Cancel_<CounterID>(void)
Return Values
The call returns values of type TickType.
Description
The callback must prevent interrupts related to the hardware counter occur-
ing.
The interrupt source should be disabled and any interrupt that has become
pending while the callback was running should be cleared.
Portability
Example
FUNC(void, OS_APPL_CODE) Os_Cbk_Cancel_MyCounter(void){
DISABLE_HW_COUNTER_INTERRUPT_SOURCE;
CLEAR_HW_COUNTER_PENDING_INTERRUPT;
}
Required when
Required for each hardware counter configured.
See Also
Os_Cbk_Now_<CounterID>
Os_Cbk_Set_<CounterID>
Os_Cbk_State_<CounterID>
Syntax
FUNC(Os_StopwatchTickType, OS_APPL_CODE) Os_Cbk_GetStopwatch(
void)
Return Values
The call returns values of type Os_StopwatchTickType.
Description
Os_Cbk_GetStopwatch() must return the current value of a free-running timer
which increments and overflows at the end of its range.
This timer provides the timebase for execution time and trace measurements.
Portability
Example
FUNC(Os_StopwatchTickType, OS_APPL_CODE) Os_Cbk_GetStopwatch(
void){
return (Os_StopwatchTickType) HARDWARE_TIMER_CHANNEL;
}
Required when
The callback must be provided if time monitoring or tracing is configured in
the OS.
See Also
Os_GetExecutionTime
Os_GetISRMaxExecutionTime
Os_GetTaskMaxExecutionTime
Os_ResetISRMaxExecutionTime
Os_ResetTaskMaxExecutionTime
Syntax
FUNC(boolean, OS_APPL_CODE) Os_Cbk_Idle(void)
Return Values
The call returns values of type boolean.
Description
Os_Cbk_Idle() is called when the OS first becomes idle after startup. Any
autostarted tasks will have run before it gets called.
If Os_Cbk_Idle() exits with a return value TRUE then it will be called again
immediately. If Os_Cbk_Idle() exits with a return value FALSE then it will not
be called again and the OS will busy wait when there are no tasks or ISRs
ready to run.
Portability
Example
FUNC(boolean, OS_APPL_CODE) Os_Cbk_Idle(void) {
sleep();
return TRUE;
}
Required when
See Also
StartOS
ShutdownOS
Syntax
FUNC(TickType, OS_APPL_CODE) Os_Cbk_Now_<CounterID>(void)
Return Values
The call returns values of type TickType.
Description
The callback must return the current value of hardware counter.
Portability
Example
FUNC(TickType, OS_APPL_CODE) Os_Cbk_Now_MyCounter(void){
return (TickType) HW_COUNTER_NOW_VALUE;
}
Required when
Required for each hardware counter configured.
See Also
Os_Cbk_Cancel_<CounterID>
Os_Cbk_Set_<CounterID>
Os_Cbk_State_<CounterID>
Syntax
FUNC(void, OS_APPL_CODE)Os_Cbk_RegSetRestore_<RegisterSetID>(
Os_RegSetDepthType Depth
)
Return Values
None.
Description
This callback is provided so that the application can restore the current con-
text for register set <RegisterSetID>.
Portability
Example
#ifdef OS_REGSET_FP_SIZE
static fp_context_save_area fpsave[OS_REGSET_FP_SIZE];
FUNC(void, OS_APPL_CODE) Os_Cbk_RegSetRestore_FP(
Os_RegSetDepthType Depth){
... = fpsave[Depth];
}
#endif /* OS_REGSET_FP_SIZE */
Required when
The callback must be provided if Register Set <RegisterSetID> exists and
preemption may require its context to be restored.
See Also
OS_REGSET_<RegisterSetID>_SIZE
Os_Cbk_RegSetSave_<RegisterSetID>
Syntax
FUNC(void, OS_APPL_CODE)Os_Cbk_RegSetSave_<RegisterSetID>(
Os_RegSetDepthType Depth
)
Return Values
None.
Description
This callback is provided so that the application can save the current context
for register set <RegisterSetID>.
Portability
Example
#ifdef OS_REGSET_FP_SIZE
static fp_context_save_area fpsave[OS_REGSET_FP_SIZE];
FUNC(void, OS_APPL_CODE) Os_Cbk_RegSetSave_FP(
Os_RegSetDepthType Depth){
fpsave[Depth] = ...;
}
#endif /* OS_REGSET_FP_SIZE */
Required when
The callback must be provided if Register Set <RegisterSetID> exists and
preemption may require its context to be saved.
See Also
OS_REGSET_<RegisterSetID>_SIZE
Os_Cbk_RegSetRestore_<RegisterSetID>
Syntax
FUNC(void, OS_APPL_CODE)Os_Cbk_Set_<CounterID>(
TickType Match
)
Parameters
Return Values
None.
Description
The callback must set up the hardware counter to raise the appropriate inter-
rupt when its value reaches the new Match value.
Match is an absolute value at which the next counter action needs to be pro-
cessed.
- Where intervals are short, it is possible for the hardware count to have
already moved past the Match value at the point this get called. If so, it is
important to ensure that the interrupt pending bit gets set in software.
- Where an alarm can be started with an interval shorter than one already set,
the code must be able to reduce the match value and detect if this means that
the hardware count has already passed this point.
The callback does not normally initialize the underlying hardware. This is
noramlly done in initialization code before the OS is started.
Portability
Required when
Required for each hardware counter configured.
See Also
Os_AdvanceCounter
SetAbsAlarm
SetRelAlarm
Os_Cbk_Cancel_<CounterID>
Os_Cbk_Now_<CounterID>
Os_Cbk_State_<CounterID>
Syntax
FUNC(void, OS_APPL_CODE)Os_Cbk_StackOverrunHook(
Os_StackSizeType Overrun,
Os_StackOverrunType Reason
)
Parameters
Return Values
None.
Description
This hook routine is called if:
(a) a stack allocation budget has been specified for a task/ISR and this budget
has been exceeded.
(b) an ECC task failed to start because there was no space on the stack
(c) an ECC task failed to resume from wait because there was no space on
the stack
(d) an ECC task failed to wait because it was using too much stack (and its
state could not, therefore, be safely preserved)
A default version of the hook is present in the kernel that calls ShutdownOS()
with the status E_OS_STACKFAULT. You can implement the callback within
your application to override this behaviour.
ECC related overruns occur when lower priority tasks exceed their stack bud-
OS_BUDGET and OS_ECC_WAIT can only occur when Stack Monitoring is con-
figured.
Portability
Example
FUNC(void, OS_APPL_CODE) Os_Cbk_StackOverrunHook(
Os_StackSizeType Overrun, Os_StackOverrunType Reason) {
switch (Reason) {
case OS_BUDGET:
/* The currently running task or ISR has exceeded its
stack budget */
break;
case OS_ECC_START:
/* An ECC task has failed to start because there is
insufficient room on the stack */
break;
case OS_ECC_RESUME:
/* An ECC task has failed to resume from wait because
there is insufficient room on the stack */
break;
case OS_ECC_WAIT:
/* An ECC task has failed to enter the waiting state
because it is exceeding its stack budget */
break;
}
}
Required when
Optional when Stack Monitoring is configured and budgets are assigned, or
when there are ECC tasks.
Os_GetStackUsage
Os_GetISRMaxStackUsage
Os_GetTaskMaxStackUsage
Os_ResetISRMaxStackUsage
Os_ResetTaskMaxStackUsage
GetISRID
GetTaskID
Syntax
FUNC(void, OS_APPL_CODE)Os_Cbk_State_<CounterID>(
Os_CounterStatusRefType State
)
Parameters
Return Values
None.
Description
This function must update the counter status structure to indicate if it is run-
ning, whether a counter interrupt is pending, and how long the interval is to
the next match.
Portability
Example
FUNC(void, OS_APPL_CODE) Os_Cbk_State_MyCounter(
Os_CounterStatusRefType State) {
State.Delay = HW_OUTPUT_COMPARE_VALUE - HW_COUNTER_NOW_VALUE;
State.Pending = counter_interrupt_pending();
State.Running = counter_interrupt_enabled();
}
Required when
Required for each hardware counter configured.
See Also
Os_Cbk_Cancel_<CounterID>
Os_Cbk_Now_<CounterID>
Os_Cbk_Set_<CounterID>
Syntax
FUNC(void, OS_APPL_CODE)Os_Cbk_TimeOverrunHook(
Os_StopwatchTickType Overrun
)
Parameters
Return Values
None.
Description
This hook routine is called if an execution budget has been specified for a
task/ISR and the execution time has exceeded this budget.
Budget overruns are detected at preemption points or when the Task/ISR ter-
minated. This hook is called once, when the overrun is first detected.
GetTaskID() and GetISRID() can be used to determine which Task or ISR has
overrun.
Portability
Example
FUNC(void, OS_APPL_CODE) Os_Cbk_TimeOverrunHook(
Os_StopwatchTickType Overrun) {
}
Required when
Required when Time Monitoring is configured and budgets are assigned.
Os_GetExecutionTime
Os_GetISRMaxExecutionTime
Os_GetTaskMaxExecutionTime
Os_ResetISRMaxExecutionTime
Os_ResetTaskMaxExecutionTime
GetISRID
GetTaskID
Syntax
FUNC(void, OS_APPL_CODE) PostTaskHook(void)
Return Values
None.
Description
This hook routine is called by the operating system immediately before it
leaves the running state.
The PostTaskHook is not called if a task is leaving the running state because
the ShutdownOS() call has been made.
Portability
Example
FUNC(void, OS_APPL_CODE) PostTaskHook(void){
TaskType LeavingTask;
GetTaskID(&LeavingTask);
if (LeavingTask == TaskA) {
/* Do action for leaving A */
} else if (LeavingTask == TaskB) {
/* Do action for leaving B */
}
...
}
Required when
Required when the PostTaskHook is configured.
See Also
PreTaskHook
Syntax
FUNC(void, OS_APPL_CODE) PreTaskHook(void)
Return Values
None.
Description
This hook routine is called by the operating system immediately after it enters
the running state but before the task itself begins to execute.
Portability
Example
FUNC(void, OS_APPL_CODE) PreTaskHook(void){
TaskType EnteringTask;
GetTaskID(&EnteringTask);
if (EnteringTask == TaskA) {
/* Do action for entering A */
} else if (EnteringTask == TaskB) {
/* Do action for entering B */
}
...
}
Required when
Required when the PreTaskHook is configured.
See Also
PostTaskHook
Syntax
FUNC(void, OS_APPL_CODE)ShutdownHook(
StatusType Error
)
Parameters
Return Values
None.
Description
If a ShutdownHook() is configured, this hook routine is called by the operating
system when the OS API call ShutdownOS() has been called.
This routine is called during the operating system shutdown. The OS can be
restarted from the ShutdownHook() using Os_Restart()
Portability
Example
FUNC(void, OS_APPL_CODE) ShutdownHook(StatusType Error){
if (Error == E_OS_STACKFAULT) {
/* Attempt recovery by restart */
Os_Restart();
/* Never reach here... */
} else if (Error == E_OK) {
/* Normal shutdown prodecure */
}
...
}
Required when
Required when the ShutdownHook is configured.
Os_Restart
StartupHook
Syntax
FUNC(void, OS_APPL_CODE) StartupHook(void)
Return Values
None.
Description
If a StartupHook() is configured, this hook routine is called by the OS at the
end of the OS initialization, but before the scheduler is running.
The application can start tasks, initialize device drivers and so on within Star-
tupHook().
Portability
Example
FUNC(void, OS_APPL_CODE) StartupHook(void){
/* Enable timer interrupt */
CHANNEL0_CONTROL_REG |= ONE_MILLISECOND_TIMER;
CHANNEL0_CONTROL_REG |= ENABLE;
}
Required when
Required when the StartupHook is configured.
See Also
ShutdownHook
4.1 AlarmBaseRefType
A pointer to an object of AlarmBaseType.
Portability
Example
AlarmBaseType AlarmBase;
AlarmBaseRefType AlarmBaseRef = &AlarmBase;
4.2 AlarmBaseType
Defines the configuration of a counter. The type is a C struct that contains
the fields maxallowedvalue, ticksperbase and mincycle.
Portability
Values
All values are of type TickType.
Example
TickType max,min,ticks;
AlarmBaseType SomeAlarmBase;
AlarmBaseRefType PointerToSomeAlarmBase = &SomeAlarmBase;
max = SomeAlarmBase.maxallowedvalue;
ticks = SomeAlarmBase.ticksperbase;
min = SomeAlarmBase.mincycle;
4.3 AlarmType
The type of an Alarm.
Example
AlarmType SomeAlarm;
4.4 AppModeType
The type of an application mode.
Portability
Values
Example
AppModeType SomeAppMode;
4.5 CounterType
The type of a Counter.
Portability
Example
CounterType SomeCounter;
4.6 EventMaskRefType
A pointer to an object of EventMaskType.
Portability
Example
EventMaskRefType SomeEventRef;
Portability
Values
Symbolic names of the EventMasks declared at configuration time.
Example
EventMaskType SomeEvent;
4.8 ISRRefType
A pointer to an object of ISRType.
Portability
Example
ISRType SomeISR;
ISRRefType PointerToSomeISR = &SomeISR;
4.9 ISRType
The type of a ISR.
Portability
Values
The symbolic names of ISRs declared at configuration time.
Constants
INVALID_ISR
Example
ISRType SomeISR;
Portability
Example
FUNC(void, OS_APPL_CODE) ErrorHook(StatusType Error){
OSServiceIdType ServiceExecuting;
ServiceExecuting = OSError_GetServiceID();
switch ( ServiceExecuting ) {
case OSServiceId_ActivateTask:
...
break;
case OSServiceId_CancelAlarm:
...
break;
case OSServiceId_ChainTask:
...
break;
...
default:
...
}
}
4.11 Os_CounterStatusRefType
A pointer to an object of Os_CounterStatusType.
Portability
Example
Os_CounterStatusType MyHwCounterStatus;
do {
Os_AdvanceCounter_MyHWCounter();
Os_Cbk_State_MyHWCounter(&MyHwCounterStatus);
} while (MyHwCounterStatus.Running && MyHwCounterStatus.Pending
);
Delay is a value that defines the number of ticks - relative to the last expiry
- at which the next expiry is due. An Os_CounterStatusType.Delay value of
zero represents maxallowedvalue+1 (the modulus) of the counter.
The Delay field is only valid when Running and Pending are TRUE.
Portability
Example
Os_CounterStatusType CounterStatus;
4.13 Os_StackOverrunType
Enumerated type defining the reason for a stack overrun.
Portability
Values
OS_BUDGET
OS_ECC_START
OS_ECC_RESUME
OS_ECC_WAIT
Example
FUNC(void, OS_APPL_CODE) Os_Cbk_StackOverrunHook(
Os_StackSizeType Overrun, Os_StackOverrunType Reason) {
switch (Reason) {
case OS_BUDGET:
/* The currently running task or ISR has exceeded its
stack budget */
break;
case OS_ECC_START:
4.14 Os_StackSizeType
An unsigned value representing an amount of stack in bytes.
Portability
Example
Os_StackSizeType stack_size;
stack_size = Os_GetStackSize(start_position, end_position);
4.15 Os_StackValueType
An unsigned value representing the position of the stack pointer (ESP).
Portability
Example
Os_StackValueType start_position;
start_position = Os_GetStackValue();
4.16 Os_StopwatchTickType
Scalar representing a ticks of a stopwatch (time monitoring or protection)
counter.
Example
Os_StopwatchTickType Duration;
GetExecutionTime(&Duration);
4.17 PhysicalTimeType
Scalar representing a units of physical (wall clock) time.
Portability
Example
PhysicalTimeType Milliseconds = OS_TICKS2MS_MyCounter(42);
4.18 ResourceType
The type of a Resource.
Portability
Values
Constants
RES_SCHEDULER
Example
ResourceType SomeResource;
4.19 ScheduleTableRefType
A pointer to an object of ScheduleTableType.
Portability
4.20 ScheduleTableStatusRefType
A pointer to an object of ScheduleTableStatusType.
Portability
Example
ScheduleTableStatusType SomeScheduleTableStatus;
GetScheduleTableStatus(&SomeScheduleTableStatus);
4.21 ScheduleTableStatusType
Enumerated type defining the runtime state of a schedule table.
Portability
Values
SCHEDULETABLE_STOPPED
SCHEDULETABLE_NEXT
SCHEDULETABLE_WAITING
SCHEDULETABLE_RUNNING
SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS
Example
ScheduleTableStatusType SomeScheduleTableStatus;
4.22 ScheduleTableType
The type of a ScheduleTable.
Portability
Example
ScheduleTableType SomeScheduleTable;
Portability
Values
E_OK
E_OS_ACCESS
E_OS_CALLEVEL
E_OS_ID
E_OS_LIMIT
E_OS_NOFUNC
E_OS_RESOURCE
E_OS_STATE
E_OS_VALUE
E_OS_SERVICEID
E_OS_ILLEGAL_ADDRESS
E_OS_MISSINGEND
E_OS_DISABLEDINT
E_OS_STACKFAULT
E_OS_PROTECTION_MEMORY
E_OS_PROTECTION_TIME
E_OS_PROTECTION_ARRIVAL
E_OS_PROTECTION_LOCKED
E_OS_PROTECTION_EXCEPTION
E_OS_SYS_NO_RESTART
E_OS_SYS_RESTART
E_OS_SYS_OVERRUN
Example
StatusType ErrorCode;
ErrorCode = ActivateTask(MyTask);
4.24 Std_ReturnType
AUTOSAR’s standard API service return type. This is NOT used by AUTOSAR
OS. The type is an 8-bit unsigned integer whose top 6 bits may encode
module-specific error codes.
Portability
E_OK=0
E_NOT_OK=1
Example
Std_ReturnType ErrorCode;
Std_ReturnType ErrorMask = 0x03;
ErrorCode = Rte_Call_SomePort_SomeOperation(self, 42);
if ((ErrorCode & ErrorMask)== E_NOT_OK) {
/* call succeeded */
}
4.25 Std_VersionInfoType
A C struct whose fields contained AUTOSAR version information for a module.
(Defined in Std_Types.h)
vendorID
moduleID
instanceID
sw_major_version
sw_minor_version
sw_patch_version
Portability
Values
Example
Std_VersionInfoType Version;
GetVersionInfo(&Version);
if (Version.vendorID == 11) {
/* Make ETAS-specific API call */
AdvanceCounter(HardwareCounter);
}
Portability
Example
TaskType SomeTask;
TaskRefType TaskRef = &SomeTask;
4.27 TaskStateRefType
A pointer to an object of TaskStateType.
Portability
Example
TaskStateType TaskState;
TaskStateRefType TaskStateRef = &TaskState;
4.28 TaskStateType
Enumerated type defining the current state of a task.
Portability
Values
SUSPENDED
READY
WAITING
RUNNING
Example
TaskStateType TaskState;
GetTaskState(&TaskState);
4.29 TaskType
The type of a task.
Values
The symbolic names of tasks declared at configuration time.
Constants
INVALID_TASK
Example
TaskType SomeTask;
4.30 TickRefType
A pointer to an object of TickType.
Portability
Example
TickRefType SomeTick;
GetCounterValue(MyCounter,SomeTick);
4.31 TickType
Scalar representing a ticks of a counter.
Portability
Example
TickType StartTime = 42;
TickType NoRepeat = 0;
SetAbsAlarm(MyAlarm,StartTime,NoRepeat);
4.32 boolean
Addressable 8 bits only for use with TRUE/FALSE. (Defined in Plat-
form_Types.h)
Values
0=FALSE
1=TRUE
Example
if (Condition == TRUE) {
x = y;
}
4.33 float32
Single precision floating point number. (Defined in Platform_Types.h)
Portability
Example
float32 x;
4.34 float64
Double precision floating point number. (Defined in Platform_Types.h)
Portability
Example
float64 x;
4.35 sint16
Signed 16-bit integer. (Defined in Platform_Types.h)
Portability
Values
-32768..32767
4.36 sint16_least
Signed integer at least 16-bits wide. (Defined in Platform_Types.h)
Portability
Values
At least -32768..32767
Example
sint16_least x;
4.37 sint32
Signed 32-bit integer. (Defined in Platform_Types.h)
Portability
Values
-2147483648..2147483647
Example
sint32 x;
4.38 sint32_least
Signed integer at least 32-bits wide. (Defined in Platform_Types.h)
Portability
Values
At least -2147483648..2147483647
Example
sint32_least x;
Portability
Values
-128..127
Example
sint8 x;
4.40 sint8_least
Signed integer at least 8-bits wide. (Defined in Platform_Types.h)
Portability
Values
At least -128..127
Example
sint8_least x;
4.41 uint16
Unsigned 16-bit integer. (Defined in Platform_Types.h)
Portability
Values
0..65535
Example
uint16 x;
4.42 uint16_least
Unsigned integer at least 16-bits wide. (Defined in Platform_Types.h)
Values
At least 0..65535
Example
uint16_least x;
4.43 uint32
Unsigned 32-bit integer. (Defined in Platform_Types.h)
Portability
Values
0..4294967295
Example
uint32 x;
4.44 uint32_least
Unsigned integer at least 32-bits wide. (Defined in Platform_Types.h)
Portability
Values
At least 0..4294967295
Example
uint32_least x;
4.45 uint8
Unsigned 8-bit integer. (Defined in Platform_Types.h)
Portability
Example
uint8 x;
4.46 uint8_least
Unsigned integer at least 8-bits wide. (Defined in Platform_Types.h)
Portability
Values
At least 0..255
Example
uint8_least x;
5.1 ALARMCALLBACK
Declares an alarm callack. The only OS API calls that can be made in an alarm
callback are SuspendAllInterrupts() and ResumeAllInterrupts().
Portability
Example
ALARMCALLBACK(MyCallback){...}
5.2 CAT1_ISR
Macro that should be used to create a Category 1 ISR entry function. This
macro exists to help make your code portable between targets.
Portability
Example
CAT1_ISR(MyISR) {...}
5.3 DeclareAlarm
This is used to declare an alarm and works similarly to external declaration
of variables in C. You will not normally need to use this because RTA-OS auto-
matically declares all Alarms in your configuration.
Portability
Example
DeclareAlarm(MyAlarm);
5.4 DeclareCounter
This is used to declare a Counter and works similarly to external declaration
of variables in C. You will not normally need to use this because RTA-OS auto-
matically declares all Counters in your configuration.
Example
DeclareCounter(MyCounter);
5.5 DeclareEvent
This is used to declare an Event and works similarly to external declaration
of variables in C. You will not normally need to use this because RTA-OS auto-
matically declares all Events in your configuration.
Portability
Example
DeclareEvent(MyEvent);
5.6 DeclareISR
This is used to declare an ISR and works similarly to external declaration of
variables in C. You will not normally need to use this because RTA-OS auto-
matically declares all ISRs in your configuration.
Portability
Example
DeclareISR(MyISR);
5.7 DeclareResource
This is used to declare a Resource and works similarly to external declara-
tion of variables in C. You will not normally need to use this because RTA-OS
automatically declares all Resources in your configuration.
Portability
Example
DeclareResource(MyResource);
Portability
Example
DeclareScheduleTable(MyScheduleTable);
5.9 DeclareTask
This is used to declare a Task and works similarly to external declaration of
variables in C. You will not normally need to use this because RTA-OS auto-
matically declares all Tasks in your configuration.
Portability
Example
DeclareTask(MyTask);
5.10 ISR
Macro that must be used to create a Category 2 ISR entry function.
Portability
Example
ISR(MyISR) {...}
5.11 OSCYCLEDURATION
Duration of an instruction cycle in nanoseconds.
Portability
Example
5.12 OSCYCLESPERSECOND
The number of instruction cycles per second.
Portability
Example
time_in_secs = CycleMeasurement / OSCYCLESPERSECOND;
5.13 OSErrorGetServiceId
Returns the identifier of the service that generated an error.
Portability
Example
OSServiceIdType WhatServiceFailed = OSErrorGetServiceId();
5.14 OSMAXALLOWEDVALUE
Constant definition of the maximum possible value of the Counter called Sys-
temCounter in ticks.
Portability
Example
SetAbsAlarm(MyAlarm,OSMAXALLOWEDVALUE,0)
5.15 OSMAXALLOWEDVALUE_<CounterID>
Constant definition of the maximum possible value of the Counter called
CounterID in ticks.
Portability
5.16 OSMINCYCLE
Constant definition of the minimum number of ticks for a cyclic alarm on the
Counter called SystemCounter.
Portability
Example
if (ComputedValue < OSMINCYCLE) {
SetAbsAlarm(MyAlarm,42,OSMINCYCLE);
} else {
SetAbsAlarm(MyAlarm,42,ComputedValue);
}
5.17 OSMINCYCLE_<CounterID>
Constant definition of the minimum number of ticks for a cyclic alarm on the
Counter called CounterID.
Portability
Example
if (ComputedValue < OSMINCYCLE_SomeCounter) {
SetAbsAlarm(MyAlarm,42,OSMINCYCLE_SomeCounter);
} else {
SetAbsAlarm(MyAlarm,42,ComputedValue);
}
5.18 OSSWTICKDURATION
Duration of a stopwatch tick in nanoseconds.
Portability
Example
time_in_ns = StopwatchMeasurement * OSSWTICKDURATION;
Portability
Example
time_in_secs = CycleMeasurement / OSSWTICKSPERSECOND;
5.20 OSTICKDURATION
Duration of a tick of the Counter called SystemCounter in nanoseconds.
Portability
Example
uint32 RealTimeDeadline = 50000; /* 50 ms */
TickType Deadline = (TickType)RealTimeDeadline / OSTICKDURATION
;
SetRelAlarm(Timeout,Deadline,0);
5.21 OSTICKDURATION_<CounterID>
Duration of a tick of the Counter called CounterID in nanoseconds.
Portability
Example
uint32 RealTimeDeadline = 50000; /* 50 ms */
TickType Deadline = (TickType)RealTimeDeadline /
OSTICKDURATION_SomeCounter;
SetRelAlarm(Timeout,Deadline,0);
5.22 OSTICKSPERBASE
Constant definition of the ticks per base setting of the Counter called System-
Counter in ticks.
5.23 OSTICKSPERBASE_<CounterID>
Constant definition of the ticks per base setting of the Counter called Coun-
terID in ticks.
Portability
5.24 OS_EXTENDED_STATUS
Defined when extended status is configured.
Portability
Example
#ifdef OS_EXTENDED_STATUS
CheckStatusType = ActivateTask(Task1);
if (CheckStatusType == E_OS_LIMIT) {
/* Log an error */
}
#else
ActivateTask(Task1);
#endif
5.25 OS_MAIN
Declare the main program. Use of OS_MAIN() rather than main() is preferred
for portable code, because different compilers have different requirements
on the parameters and return type of main().
Portability
Example
#include "Os.h"
OS_MAIN() {
/* Initialize target hardware */
5.26 OS_NOAPPMODE
The value returned by GetActiveApplicationMode() when the OS is not run-
ning.
Portability
5.27 OS_NUM_ALARMS
The number of alarms declared.
Portability
5.28 OS_NUM_APPMODES
The number of AppModes declared.
Portability
5.29 OS_NUM_COUNTERS
The number of counters declared.
Portability
5.30 OS_NUM_EVENTS
The number of Events declared.
Portability
5.31 OS_NUM_ISRS
The number of Category 2 ISRs declared.
5.32 OS_NUM_RESOURCES
The number of resources declared (excludes internal).
Portability
5.33 OS_NUM_SCHEDULETABLES
The number of schedule tables declared.
Portability
5.34 OS_NUM_TASKS
The number of tasks declared.
Portability
5.35 OS_REGSET_<RegisterSetID>_SIZE
This macro defines the size of the buffer needed to preserve Register Set
<RegisterSetID> at run time. If no buffer is needed, then it is not declared.
This can happen if no task/ISR that uses the register set can be preempted
by another one that also uses it.
Portability
Example
#ifdef OS_REGSET_FP_SIZE
fp_context_save_area fpsave[OS_REGSET_FP_SIZE];
#endif /* OS_REGSET_FP_SIZE */
Portability
Example
#ifdef OS_SCALABILITY_CLASS_1
ALARMCALLBACK(OnlyInSC1){
...
}
#endif
5.37 OS_SCALABILITY_CLASS_2
Defined when AUTOSAR Scalability Class 2 is configured.
Portability
Example
#if defined(OS_SCALABILITY_CLASS_2) || defined(
OS_SCALABILITY_CLASS_4)
StartScheduleTableSynchron(Table);
#endif
5.38 OS_SCALABILITY_CLASS_3
Defined when AUTOSAR Scalability Class 3 is configured.
Portability
Example
#if defined(OS_SCALABILITY_CLASS_3) || defined(
OS_SCALABILITY_CLASS_4)
FUNC(void, OS_APPL_CODE)
ErrorHook_MyApplication(StatusType Error){
/* Handle OS-Application error */
}
#endif
Portability
Example
#if defined(OS_SCALABILITY_CLASS_3) || defined(
OS_SCALABILITY_CLASS_4)
FUNC(void, OS_APPL_CODE)
ErrorHook_MyApplication(StatusType Error){
/* Handle OS-Application error */
}
#endif
5.40 OS_STACK_MONITORING
This macro is only defined if stack monitoring is configured.
Portability
Example
FUNC(boolean, OS_APPL_CODE) Os_Cbk_Idle(void){
#ifdef OS_STACK_MONITORING
Os_StackSizeType Task1Stack, Task2Stack, Task3Stack;
Task1Stack = Os_GetTaskMaxStackUsage(Task1);
Task2Stack = Os_GetTaskMaxStackUsage(Task2);
...
TaskNStack = Os_GetTaskMaxStackUsage(TaskN);
#endif
return TRUE;
}
5.41 OS_STANDARD_STATUS
Defined when standard status is configured.
Portability
Example
5.42 OS_TICKS2<Unit>_<CounterID>(ticks)
Converts ticks on CounterID to Unit where Unit is: NS (nanosecond), MS (Mil-
lisecond), US (Microsecond), SEC(Second).
Portability
Example
time_in_ms = OS_TICKS2MS_SystemCounter(time);
5.43 OS_TIME_MONITORING
This macro is only defined if time monitoring is configured.
Portability
Example
#ifdef OS_TIME_MONITORING
Os_StopwatchTickType start,end,function_duration;
start = Os_GetExecutionTime();
#endif
ThirdPartyFunction(x,y);
#ifdef OS_TIME_MONITORING
end = Os_GetExecutionTime();
function_duration = end - start;
#endif
5.44 TASK
Macro that must be used to create the task’s entry function.
Example
TASK(MyTask) {...}
Syntax
/* C function prototype for the API call */
ReturnValue NameOfAPICall(Parameter Type, ...)
Parameters
A list of parameters for each API call and their mode:
out The parameter is passed out of the API call by passing a reference
(pointer) to the parameter into the call.
inout The parameter is passed into the call and then (updated) and passed
out.
Return Values
Where API calls return a StatusType the values of the type returned and
an indication of the reason for the error/warning are listed. The build column
indicates whether the value is returned for both standard and extended status
builds or for extended status build only.
Description
A detailed description of the behavior of the API call.
Portability
The RTA-OS3.0 API includes four classes of API calls:
OSEK OS calls are those specified by the OSEK OS standard. OSEK OS calls
are portable to other implementations of OSEK OS and are portable to
other implementations of AUTOSAR OS R3.0.
Example Code
A C code listing showing how to use the API calls
Calling Environment
The valid calling environment for the API call. A 3 indicates that a call can be
made in the indicated context. A 7 indicates that the call cannot be made in
the indicated context.
See Also
A list of related API calls.
Syntax
void Os_CheckTraceOutput(void)
Return Values
None.
Description
When tracing in free-running mode, this must be called regularly by the ap-
plication. It is used to detect when the trace buffer has data to upload to
RTA-TRACE.
Portability
Example
Os_CheckTraceOutput();
Calling Environment
See Also
Os_Cbk_TraceCommDataReady
Os_Cbk_TraceCommTxStart
Os_Cbk_TraceCommTxByte
Os_Cbk_TraceCommTxEnd
Os_Cbk_TraceCommTxReady
Syntax
void Os_ClearTrigger(void)
Return Values
None.
Description
This API call clears all trigger conditions that have been set using an
Os_TriggerOnXXX() API.
Trace information will continue to be logged in the trace buffer, but no trace
record will trigger the upload of the trace buffer to the host.
Portability
Example
Os_ClearTrigger();
Calling Environment
See Also
Os_StartBurstingTrace
Os_StartFreeRunningTrace
Os_SetTriggerWindow
Os_SetTraceRepeat
Syntax
void Os_DisableTraceCategories(
Os_TraceCategoriesType CategoriesMask
)
Parameters
Return Values
None.
Description
Trace categories are used to filter whether tracepoints, task tracepoints and
intervals get recorded and are typically used to control the volume of data
that gets traced.
This call disables the specified run-time categories and therefore will inhibit
the logging of all tracepoints, task tracepoints and intervals that are filtered
by these categories.
Categories not listed in the call will be left in their current state.
Portability
Example
Os_DisableTraceCategories(DebugTracePoints | DataLogTracePoints
); /* Disable DebugTracePoints and DataLogTracePoints*/
_
Os LogTracepoint(tpTest, DebugTracePoints); /* tpTest is not
recorded: DebugTracePoints is disabled */
Os LogTracepoint(tpTest, OS_TRACE_CATEGORY_ALWAYS); /* tpTest
_
is recorded here */
Calling Environment
See Also
Os_EnableTraceCategories
Syntax
void Os_DisableTraceClasses(
Os_TraceClassesType ClassMask
)
Parameters
Return Values
None.
Description
Trace classes are used to filter whether complete types of trace events get
recorded. They are typically used to control the volume of data that gets
traced.
This call disables the specified run-time classes and therefore will inhibit the
tracing of events that are filtered by these classes.
Classes not listed in the call will be left in their current state.
Portability
Example
Os_DisableTraceClasses(OS_TRACE_TRACEPOINT_CLASS);
Os_LogTracepoint(tpTest, OS_TRACE_ALL_CATEGORIES); /* Will not
get recorded */
See Also
Os_EnableTraceClasses
Syntax
void Os_EnableTraceCategories(
Os_TraceCategoriesType CategoriesMask
)
Parameters
Return Values
None.
Description
Trace categories are used to filter whether tracepoints, task tracepoints and
intervals get recorded and are typically used to control the volume of data
that gets traced.
Categories not listed in the call will be left in their current state.
Portability
Example
Os_EnableTraceCategories(DebugTracePoints | DataLogTracePoints)
;
_
Os LogTracepoint(tpTest, DebugTracePoints); /* tpTest is
recorded */
_
Os LogTracepoint(tpTest, FunctionProfileTracePoints); /* tpTest
is not recorded - FunctionProfileTracePoints not enabled */
Os LogTracepoint(tpTest, OS_TRACE_ALL_CATEGORIES); /* tpTest is
_
recorded */
See Also
Os_DisableTraceCategories
Syntax
void Os_EnableTraceClasses(
Os_TraceClassesType ClassMask
)
Parameters
Return Values
None.
Description
Trace classes are used to filter whether complete types of trace events get
recorded. They are typically used to control the volume of data that gets
traced.
Classes not listed in the call will be left in their current state.
Portability
Example
Os_EnableTraceClasses(OS_TRACE_TRACEPOINT_CLASS);
Os_LogTracepoint(tpTest, OS_TRACE_ALL_CATEGORIES); /* Will get
recorded */
See Also
Os_DisableTraceClasses
Syntax
void Os_LogCat1ISREnd(
ISRType ISRID
)
Parameters
Return Values
None.
Description
This call marks the end of a Category 1 ISR. This type of ISR is not controlled
by the operating system so no automatic tracing of it can occur. If Category
1 ISRs need to be logged then it is necessary to do this manually using this
call.
Take care to ensure that both the start and end of the Category 1 ISR logged,
otherwise the resulting trace will be incorrect.
Portability
Example
CAT1_ISR(Category1Handler) {
Os_LogCat1ISRStart(Category1Handler);
...
Os_LogCat1ISREnd(Category1Handler);
}
See Also
Os_LogCat1ISRStart
Syntax
void Os_LogCat1ISRStart(
ISRType ISRID
)
Parameters
Return Values
None.
Description
This call marks the start of a Category 1 ISR. This type of ISR is not controlled
by the operating system so no automatic tracing of it can occur. If Category
1 ISRs need to be logged then it is necessary to do this manually using this
call.
Take care to ensure that both the start and end of the Category 1 ISR are
logged, otherwise the resulting trace will be incorrect.
Portability
Example
CAT1_ISR(Category1Handler) {
Os_LogCat1ISRStart(Category1Handler);
...
Os_LogCat1ISREnd(Category1Handler);
}
See Also
Os_LogCat1ISREnd
Syntax
void Os_LogCriticalExecutionEnd(
Os_TraceInfoType CriticalExecutionID
)
Parameters
Return Values
None.
Description
Logs the end of a critical point of execution in the trace buffer. This is typically
used to indicate that a task/ISR has completed a time-critical section of code.
This might be needed if the deadline that needs to be met by the task/ISR
occurs before the end of the task/ISR.
Portability
Example
TASK(MyTask){
...
ReadSensor(X);
Os_LogCriticalExecutionEnd(SensorRead);
...
WriteActuator(Y);
Os_LogCriticalExecutionEnd(SensorRead);
...
TerminateTask();
}
See Also
None.
Syntax
void Os_LogIntervalEnd(
Os_TraceIntervalIDType IntervalID,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the end of an interval in the trace buffer.
Portability
Example
Os_LogIntervalStart(EndToEndTime, SystemLoggingCategory);
...
Os_LogIntervalEnd(EndToEndTime, SystemLoggingCategory);
Calling Environment
Os_LogIntervalEndValue
Os_LogIntervalEndData
Os_LogIntervalStart
Os_LogIntervalStartValue
Os_LogIntervalStartData
Syntax
void Os_LogIntervalEndData(
Os_TraceIntervalIDType IntervalID,
Os_TraceDataPtrType DataPtr,
Os_TraceDataLengthType Length,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the end of an interval in the trace buffer and associate some data with it.
Portability
Example
Os_LogIntervalStart(EndToEndTime, SystemLoggingCategory);
...
Os_LogIntervalEndData(EndToEndTime, &DataBlock, 4,
SystemLoggingCategory);
See Also
Os_LogIntervalEnd
Os_LogIntervalEndValue
Os_LogIntervalStart
Os_LogIntervalStartValue
Os_LogIntervalStartData
Syntax
void Os_LogIntervalEndValue(
Os_TraceIntervalIDType IntervalID,
Os_TraceValueType Value,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the end of an interval in the trace buffer and associate a value with it.
Portability
Example
Os_LogIntervalStart(EndToEndTime, SystemLoggingCategory);
...
Os_LogIntervalEndValue(EndToEndTime, 42, SystemLoggingCategory)
;
See Also
Os_LogIntervalEnd
Os_LogIntervalEndData
Os_LogIntervalEndValue
Os_LogIntervalStartValue
Os_LogIntervalStartData
Syntax
void Os_LogIntervalStart(
Os_TraceIntervalIDType IntervalID,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the start of an interval in the trace buffer.
Portability
Example
Os_LogIntervalStart(EndToEndTime, SystemLoggingCategory);
...
Os_LogIntervalEnd(EndToEndTime, SystemLoggingCategory);
Calling Environment
Os_LogIntervalEnd
Os_LogIntervalEndData
Os_LogIntervalEndValue
Os_LogIntervalStartData
Os_LogIntervalStartValue
Syntax
void Os_LogIntervalStartData(
Os_TraceIntervalIDType IntervalID,
Os_TraceDataPtrType DataPtr,
Os_TraceDataLengthType Length,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the start of an interval in the trace buffer and associate some data with
it.
Portability
Example
Os_LogIntervalStartData(EndToEndTime, &DataBlock, 4,
SystemLoggingCategory);
...
Os_LogIntervalEnd(EndToEndTimeSystemLoggingCategory);
See Also
Os_LogIntervalEnd
Os_LogIntervalEndData
Os_LogIntervalEndValue
Os_LogIntervalStart
Os_LogIntervalStartValue
Syntax
void Os_LogIntervalStartValue(
Os_TraceIntervalIDType IntervalID,
Os_TraceValueType Value,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the start of an interval in the trace buffer and associate a value with it.
Portability
Example
Os_LogIntervalStartValue(EndToEndTime, 42,
SystemLoggingCategory);
...
Os_LogIntervalEnd(EndToEndTime, SystemLoggingCategory);
See Also
Os_LogIntervalEnd
Os_LogIntervalEndData
Os_LogIntervalEndValue
Os_LogIntervalStart
Os_LogIntervalStartData
Syntax
void Os_LogProfileStart(
Os_TraceInfoType ProfileID
)
Parameters
Return Values
None.
Description
Logs which execution profile is active in the trace buffer. Execution profiles
can be used to identify which route is taken through a Task or ISR when this
depends on external conditions.
Portability
Example
TASK(MyTask){
if (some_condition()) {
Os_LogProfileStart(TrueRoute);
...
} else {
Os_LogProfileStart(FalseRoute);
...
}
TerminateTask();
}
See Also
None.
Syntax
void Os_LogTaskTracepoint(
Os_TraceTracepointIDType TaskTracepointID,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the task tracepoint event in the trace buffer.
Portability
Example
Os_LogTaskTracepoint(MyTaskTracePoint, ACategory);
Calling Environment
Os_LogTracepoint
Os_LogTracepointData
Os_LogTracepointValue
Os_LogTaskTracepointData
Os_LogTaskTracepointValue
Syntax
void Os_LogTaskTracepointData(
Os_TraceTracepointIDType TracepointID,
Os_TraceDataPtrType DataPtr,
Os_TraceDataLengthType Length,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the task tracepoint event in the trace buffer and associate some data
with it.
Portability
Example
Os_LogTaskTracepointData(MyTracePoint, &DataBlock, 4, ACategory
);
See Also
Os_LogTracepoint
Os_LogTracepointValue
Os_LogTracepointData
Os_LogTaskTracepoint
Os_LogTaskTracepointValue
Syntax
void Os_LogTaskTracepointValue(
Os_TraceTracepointIDType TracepointID,
Os_TraceValueType Value,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the task tracepoint event in the trace buffer and associate a value with
it.
Portability
Example
Os_LogTaskTracepointValue(MyTracePoint, 99, ACategory);
See Also
Os_LogTracepoint
Os_LogTracepointData
Os_LogTracepointValue
Os_LogTaskTracepoint
Os_LogTaskTracepointData
Syntax
void Os_LogTracepoint(
Os_TraceTracepointIDType TracepointID,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the tracepoint event in the trace buffer.
Portability
Example
Os_LogTracepoint(MyTracepoint, ACategory);
Calling Environment
Os_LogTracepoint
Os_LogTracepointData
Os_LogTracepointValue
Os_LogTracepointData
Os_LogTracepointValue
Syntax
void Os_LogTracepointData(
Os_TraceTracepointIDType TracepointID,
Os_TraceDataPtrType DataPtr,
Os_TraceDataLengthType Length,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the tracepoint event in the trace buffer and associate some data with it.
Portability
Example
Os_LogTracepointData(MyTracePoint, &DataBlock, 4, ACategory);
See Also
Os_LogTracepoint
Os_LogTracepointValue
Os_LogTracepointData
Os_LogTracepoint
Os_LogTracepointValue
Syntax
void Os_LogTracepointValue(
Os_TraceTracepointIDType TracepointID,
Os_TraceValueType Value,
Os_TraceCategoriesType CategoryMask
)
Parameters
Return Values
None.
Description
Log the tracepoint event in the trace buffer and associate a value with it.
Portability
Example
Os_LogTracepointValue(MyTracePoint, 99, ACategory);
See Also
Os_LogTracepoint
Os_LogTracepointData
Os_LogTracepointValue
Os_LogTracepoint
Os_LogTracepointData
Syntax
void Os_SetTraceRepeat(
boolean Repeat
)
Parameters
Return Values
None.
Description
When TRUE, bursting and triggering trace modes automatically restart once
the most recent trace content has been transmitted from the trace buffer to
the RTA-TRACE client.
Portability
Example
Os_SetTraceRepeat(TRUE);
Calling Environment
See Also
Os_StartBurstingTrace
Os_StartTriggeringTrace
Syntax
void Os_SetTriggerWindow(
Os_TraceIndexType Before,
Os_TraceIndexType After
)
Parameters
Return Values
None.
Description
This call sets the number of records to be recorded before and after a trigger
event.
When the trigger occurs, tracing events continue to be logged until After trace
records have been written to the trace buffer, and the data is then uploaded.
The total number of records uploaded (Before + After) is limited by the size
of the trace buffer.
Note that a trace event that contains data values may required multiple
records to be written to the trace buffer. This means that the number of
complete events seen before or after the trigger point may be less than the
number of records requested.
Portability
Example
extern FUNC(void, OS_APPL_CODE) StartupHook(){
...
Os_SetTriggerWindow(100,50);
Os_StartTriggeringTrace();
Calling Environment
See Also
Os_StartBurstingTrace
Os_StartFreeRunningTrace
Syntax
void Os_StartBurstingTrace(void)
Return Values
None.
Description
Bursting trace mode logs trace information into the trace buffer until the
buffer is full. When the trace buffer is full, tracing stops and data transfer
begins. No attempt is made to upload data to the host until the trace buffer
has filled.
The trace buffer is cleared and tracing restarts again if this call is made whilst
tracing.
Portability
Example
extern FUNC(void, OS_APPL_CODE) StartupHook(){
...
Os_StartBurstingTrace();
...
}
Calling Environment
Os_SetTraceRepeat
Os_StartFreeRunningTrace
Os_StartTriggeringTrace
Syntax
void Os_StartFreeRunningTrace(void)
Return Values
None.
Description
Free running trace mode logs trace information while there is space in the
trace buffer. Data is uploaded to the host from the buffer as soon as it is
available, concurrently with capture.
If the trace buffer becomes full, logging of trace data is suspended until there
is space in the buffer. When space in the buffer is available again, tracing
resumes. The buffer might become full if the communications link is too slow
for the desired volume of trace data.
The trace buffer is cleared and tracing restarts again if this call is made whilst
tracing.
Portability
Example
extern FUNC(void, OS_APPL_CODE) StartupHook(){
...
Os_StartFreeRunningTrace();
...
}
Calling Environment
Os_StartBurstingTrace
Os_StartTriggeringTrace
Syntax
void Os_StartTriggeringTrace(void)
Return Values
None.
Description
Triggering trace mode logs trace information into the buffer continously, wait-
ing for a trigger condition. If the buffer overflows, then new trace information
overwrites existing information.
When a triggering event occurs (for example, when a task starts execut-
ing), data collection continues until post-trigger number of trace records are
logged. Data transfer to the host then begins.
The trace buffer is cleared and tracing restarts again if this call is made whilst
tracing.
Portability
Example
extern FUNC(void, OS_APPL_CODE) StartupHook(){
...
Os_SetTriggerWindow(100,50);
Os_StartTriggeringTrace();
...
}
See Also
Os_StartBurstingTrace
Os_StartFreeRunningTrace
Os_SetTriggerWindow
Os_SetTraceRepeat
Syntax
void Os_StopTrace(void)
Return Values
None.
Description
Stops data logging to the trace buffer. Any data remaining in the trace buffer
is uploaded to the host.
Note that the call does not stop the the data link.
Portability
Example
Os_StopTrace();
Calling Environment
See Also
Os_StartBurstingTrace
Os_StartFreeRunningTrace
Os_StartTriggeringTrace
Syntax
Os_TraceStatusType Os_TraceCommInit(void)
Return Values
The call returns values of type Os_TraceStatusType.
Description
This function is used to initialize a trace communications link. It should not
be used if you use a debugger link to extract trace data.
Portability
Example
extern FUNC(void, OS_APPL_CODE) StartupHook(){
...
Os_TraceCommInit();
Os_StartFreeRunningTrace();
...
}
Calling Environment
See Also
Os_Cbk_TraceCommInitTarget
Syntax
void Os_TraceDumpAsync(
Os_AsyncPushCallbackType fn
)
Return Values
None.
Description
This API is normally called in response to Os_Cbk_TraceCommDataReady(). It
gets passed a reference to a function that can transmit a single character. It
will call this function for each character that needs to be transmitted before
returning to the caller.
Portability
Example
extern FUNC(void, OS_APPL_CODE) push_async_io(uint8 val) {
while(!async_tx_ready) {/* wait for room */}
async_transmit(val) ;
}
FUNC(void, OS_APPL_CODE) Os_Cbk_TraceCommDataReady(void) {
Os_TraceDumpAsync(push_async_io);
}
Calling Environment
Syntax
void Os_TriggerNow(void)
Return Values
None.
Description
This API call forces a trigger condition to occur. This will cause the trace buffer
to be uploaded, regardless of any other trigger conditions.
The call does not modify the state of the trigger conditions.
Portability
Example
Os_TriggerNow();
Calling Environment
See Also
None.
Syntax
void Os_TriggerOnActivation(
TaskType TaskID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when specified task is activated.
The trigger will occur when a task is activated through ActivateTask, StartOS,
Alarms or ScheduleTables.
Portability
Example
Os_TriggerOnActivation(InterestingTask);
Calling Environment
Syntax
void Os_TriggerOnAdvanceCounter(
CounterType CounterID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified hardware counter is ad-
vanced.
Portability
Example
Os_TriggerOnAdvanceCounter(HWCounter);
Calling Environment
See Also
Os_TriggerOnIncrementCounter
Syntax
void Os_TriggerOnAlarmExpiry(
AlarmType AlarmID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified alarm expires.
Portability
Example
Os_TriggerOnAlarmExpiry(Alarm_10ms);
Calling Environment
See Also
None.
Syntax
void Os_TriggerOnCat1ISRStart(
ISRType ISRID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified Category 1 ISR starts run-
ning.
ISRID can be set to OS_TRIGGER_ANY, in which case any such ISR will cause
the trigger to occur.
Note that Category 1 ISRs are not controlled by RTA-OS, so you are respon-
sible for calling Os_LogCat1ISRStart() at the beginning of your interrupt han-
dler.
Portability
Example
Os_TriggerOnCat1ISRStart(InterestingCat1ISR);
Calling Environment
Os_TriggerOnCat1ISRStop
Os_LogCat1ISREnd
Syntax
void Os_TriggerOnCat1ISRStop(
ISRType ISRID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified Category 1 ISR stops run-
ning.
ISRID can be set to OS_TRIGGER_ANY, in which case any such ISR will cause
the trigger to occur.
Note that Category 1 ISRs are not controlled by RTA-OS, so you are responsi-
ble for calling Os_LogCat1ISREnd() at the end of your interrupt handler.
Portability
Example
Os_TriggerOnCat1ISRStop(InterestingCat1ISR);
Calling Environment
Os_TriggerOnCat1ISRStart
Os_LogCat1ISRStart
Os_LogCat1ISREnd
Syntax
void Os_TriggerOnCat2ISRStart(
ISRType ISRID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified Category 2 ISR starts run-
ning.
ISRID can be set to OS_TRIGGER_ANY, in which case any such ISR will cause
the trigger to occur.
Portability
Example
Os_TriggerOnCat2ISRStart(InterestingCat2ISR);
Calling Environment
See Also
Os_TriggerOnCat2ISRStop
Syntax
void Os_TriggerOnCat2ISRStop(
ISRType ISRID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified Category 2 ISR stops run-
ning.
ISRID can be set to OS_TRIGGER_ANY, in which case any such ISR will cause
the trigger to occur.
Portability
Example
Os_TriggerOnCat2ISRStop(InterestingCat2ISR);
Calling Environment
See Also
Os_TriggerOnCat2ISRStart
Syntax
void Os_TriggerOnChain(
TaskType TaskID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when an attempt is made to chain a specified
task. (Noting that chain attempts can fail.)
TaskID can be set to OS_TRIGGER_ANY, in which case chaining of any task will
cause the trigger to occur.
Portability
Example
Os_TriggerOnChain(InterestingTask);
Calling Environment
See Also
Os_TriggerOnActivation
Syntax
void Os_TriggerOnError(
StatusType Error
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified error is raised.
Error can be set to OS_TRIGGER_ANY, in which case any error will cause the
trigger to occur.
Portability
Example
Os_TriggerOnError(E_OS_LIMIT);
Calling Environment
See Also
None.
Syntax
void Os_TriggerOnGetResource(
ResourceType ResourceID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified resource is locked.
Portability
Example
Os_TriggerOnGetResource(CriticalSection);
Calling Environment
See Also
Os_TriggerOnReleaseResource
Syntax
void Os_TriggerOnIncrementCounter(
CounterType CounterID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified counter is incremented.
Portability
Example
Os_TriggerOnIncrementCounter(SWCounter);
Calling Environment
See Also
Os_TriggerOnAdvanceCounter
Syntax
void Os_TriggerOnIntervalEnd(
Os_TraceIntervalIDType IntervalID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified interval ends.
IntervalID can be set to OS_TRIGGER_ANY, in which case any interval end will
cause the trigger to occur.
Portability
Example
Os_TriggerOnIntervalEnd(EndToEndTimeMeasurement);
Calling Environment
See Also
Os_TriggerOnIntervalStart
Os_TriggerOnIntervalStop
Syntax
void Os_TriggerOnIntervalStart(
Os_TraceIntervalIDType IntervalID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified interval starts.
Portability
Example
Os_TriggerOnIntervalStart(EndToEndTimeMeasurement);
See Also
Os_TriggerOnIntervalEnd
Os_TriggerOnIntervalStop
Syntax
void Os_TriggerOnIntervalStop(
Os_TraceIntervalIDType IntervalID
)
Parameters
Return Values
None.
Description
This call is a synonym for Os_TriggerOnIntervalEnd.
IntervalID can be set to OS_TRIGGER_ANY, in which case any interval end will
cause the trigger to occur.
Portability
Example
Os_TriggerOnIntervalStop(EndToEndTimeMeasurement);
Calling Environment
See Also
Os_TriggerOnIntervalEnd
Syntax
void Os_TriggerOnReleaseResource(
ResourceType ResourceID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified resource is unlocked.
Portability
Example
Os_TriggerOnReleaseResource(CriticalSection);
Calling Environment
See Also
Os_TriggerOnGetResource
Syntax
void Os_TriggerOnScheduleTableExpiry(
ExpiryID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specific expiry point is reached.
ExpiryID can be set to OS_TRIGGER_ANY, in which case any expiry *or alarm*
will cause the trigger to occur.
Portability
Example
StartScheduleTableRel(SchedTable, 1);
Os_TriggerOnScheduleTableExpiry(SchedTable_ep1);
IncrementCounter(SystemCounter);
...
See Also
None.
Syntax
void Os_TriggerOnSetEvent(
TaskType TaskID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when an event is set for a specified task.
TaskID can be set to OS_TRIGGER_ANY, in which case any event setting will
cause the trigger to occur.
Portability
Example
Os_TriggerOnSetEvent(ExtendedTask);
Calling Environment
See Also
None.
Syntax
void Os_TriggerOnShutdown(
StatusType Status
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specific status is passed to Shut-
downOS.
Portability
Example
Os_TriggerOnShutdown(E_OK); /* Trigger on normal shutdown */
Calling Environment
See Also
ShutdownOS
Syntax
void Os_TriggerOnTaskStart(
TaskType TaskID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified task starts running.
TaskID can be set to OS_TRIGGER_ANY, in which case any task start will cause
the trigger to occur.
Note that a TaskID is started when its entry function is called, or when it
resumes from the WAITING state.
Portability
Example
Os_TriggerOnTaskStart(InterestingTask);
Calling Environment
See Also
Os_TriggerOnTaskStop
Syntax
void Os_TriggerOnTaskStop(
TaskType TaskID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified task stops running.
TaskID can be set to OS_TRIGGER_ANY, in which case any task stop will cause
the trigger to occur.
Note that a TaskID is stopped when its entry function is called, or when it
enters the WAITING state.
Portability
Example
Os_TriggerOnTaskStop(InterestingTask);
Calling Environment
See Also
Os_TriggerOnTaskStart
Syntax
void Os_TriggerOnTaskTracepoint(
Os_TraceTracepointIDType TaskTracepointID,
TaskType TaskID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified task-tracepoint for a speci-
fied task is logged.
Portability
Example
Os_TriggerOnTaskTracepoint(MyTaskTracepoint,InterestingTask);
Calling Environment
Syntax
void Os_TriggerOnTracepoint(
Os_TraceTracepointIDType TracepointID
)
Parameters
Return Values
None.
Description
Causes a trace trigger to occur when a specified tracepoint is logged.
Portability
Example
Os_TriggerOnTracepoint(MyTracepoint);
Calling Environment
See Also
Os_TriggerOnTaskTracepoint
Syntax
void Os_UploadTraceData(void)
Return Values
None.
Description
This API is responsible for sending individual bytes of trace data over a serial
communications link. It uses callbacks into the application code to manage
access to the actual communications link.
As a special case in interrupt mode, this function should be called from the
Os_Cbk_TraceCommDataReady() callback and the transmit-interrupt handler.
Portability
Example
/* This callback occurs when a new frame is ready for upload */
FUNC(void, OS_APPL_CODE) Os_Cbk_TraceCommDataReady(void) {
Os_UploadTraceData(); /* Causes call to
Os_Cbk_TraceCommTxStart() */
}
ISR(asyncio) {
Os_UploadTraceData();
}
FUNC(void, OS_APPL_CODE) Os_Cbk_TraceCommTxStart(void) {
/* Called from UploadTraceData when the first byte of a frame
is ready to send.
* It is immediately followed by a call to
Os_Cbk_TraceCommTxByte().
* In interrupt mode, this is used to enable the transmit
interrupt.
Calling Environment
See Also
Os_CheckTraceOutput
Os_Cbk_TraceCommDataReady
Os_Cbk_TraceCommTxStart
Os_Cbk_TraceCommTxByte
Os_Cbk_TraceCommTxEnd
Os_Cbk_TraceCommTxReady
Syntax
/* C function prototype for the callback */
ReturnValue NameOfCallback(Parameter Type, ...)
Parameters
A list of parameters for each callback and their mode:
out The parameter is passed out of the API callback by passing a reference
(pointer) to the parameter into the call.
inout The parameter is passed into the callback and then (updated) and
passed out.
Return Values
A description of the return value of the callback,
Description
A detailed description of the required functionality of the callback.
Portability
The portability of the call between OSEK OS, AUTOSAR OS, RTA-OS3.0 and
RTA-TRACE.
Example Code
A C code listing showing how to implement the callback.
Required When
The configuration that means user code must implement the callback.
See Also
A list of related callbacks.
Syntax
FUNC(void, OS_APPL_CODE) Os_Cbk_TraceCommDataReady(void)
Return Values
None.
Description
When tracing in Bursting or Triggering modes, this gets called automatically
when there is a new frame of data to be uploaded to RTA-TRACE.
Portability
Example
FUNC(void, OS_APPL_CODE) Os_Cbk_TraceCommDataReady(void) {
Os_UploadTraceData(); /* Causes call to
Os_Cbk_TraceCommTxStart() */
}
Required when
The callback may be provided if a communications link is used with tracing.
A default version is present in the kernel library.
See Also
Os_UploadTraceData
Os_CheckTraceOutput
Os_Cbk_TraceCommTxStart
Os_Cbk_TraceCommTxByte
Os_Cbk_TraceCommTxEnd
Os_Cbk_TraceCommTxReady
Syntax
FUNC(Os_TraceStatusType, OS_APPL_CODE)
Os_Cbk_TraceCommInitTarget(void)
Return Values
The call returns values of type Os_TraceStatusType.
Description
Os_Cbk_TraceCommInitTarget supports the Os_TraceCommInit by providing
application-specific code to initialize the communication link to RTA-TRACE.
Typically it sets up an RS232 link.
E_OK should be returned if the initialization succeeded. Any other value will
result in trace communication being disabled.
Portability
Example
FUNC(Os_TraceStatusType, OS_APPL_CODE)
Os_Cbk_TraceCommInitTarget(void){
initialize_uart();
return E_OK;
}
Required when
The callback must be provided if Os_TraceCommInit is used to initialize trac-
ing using an external communications link.
See Also
Os_TraceCommInit
Syntax
FUNC(void, OS_APPL_CODE)Os_Cbk_TraceCommTxByte(
uint8 val
)
Return Values
None.
Description
This is called from UploadTraceData when there is a byte of data to send.
Portability
Example
FUNC(void, OS_APPL_CODE) Os_Cbk_TraceCommTxByte(uint8 val) {
/* Called from UploadTraceData when there is a byte ready to
send */
async_transmit(val);
}
Required when
The callback must be provided if Os_UploadTraceData is used.
See Also
Os_UploadTraceData
Os_CheckTraceOutput
Os_Cbk_TraceCommDataReady
Os_Cbk_TraceCommTxStart
Os_Cbk_TraceCommTxEnd
Os_Cbk_TraceCommTxReady
Syntax
FUNC(void, OS_APPL_CODE) Os_Cbk_TraceCommTxEnd(void)
Return Values
None.
Description
This is called from UploadTraceData when the last byte of a frame has been
sent.
Portability
Example
FUNC(void, OS_APPL_CODE) Os_Cbk_TraceCommTxEnd(void) {
disable_asyncio_interrupt();
}
Required when
The callback must be provided if Os_UploadTraceData is used.
See Also
Os_UploadTraceData
Os_CheckTraceOutput
Os_Cbk_TraceCommDataReady
Os_Cbk_TraceCommTxStart
Os_Cbk_TraceCommTxByte
Os_Cbk_TraceCommTxReady
Syntax
FUNC(boolean, OS_APPL_CODE) Os_Cbk_TraceCommTxReady(void)
Return Values
The call returns values of type boolean.
Description
This is called from UploadTraceData to determine whether there is room in
the transmit buffer to send the next byte.
This should always return true in interrupt mode, because the interrupt
should only fire when there is room to send the next byte.
Portability
Example
FUNC(boolean, OS_APPL_CODE) Os_Cbk_TraceCommTxReady(void) {
return async_tx_ready();
}
Required when
The callback must be provided if Os_UploadTraceData is used.
See Also
Os_UploadTraceData
Os_CheckTraceOutput
Os_Cbk_TraceCommDataReady
Os_Cbk_TraceCommTxStart
Os_Cbk_TraceCommTxByte
Os_Cbk_TraceCommTxEnd
Syntax
FUNC(void, OS_APPL_CODE) Os_Cbk_TraceCommTxStart(void)
Return Values
None.
Description
This is called from UploadTraceData when the first byte of a frame is ready to
send.
Portability
Example
FUNC(void, OS_APPL_CODE) Os_Cbk_TraceCommTxStart(void) {
enable_asyncio_interrupt();
}
Required when
The callback must be provided if Os_UploadTraceData is used.
See Also
Os_UploadTraceData
Os_CheckTraceOutput
Os_Cbk_TraceCommDataReady
Os_Cbk_TraceCommTxByte
Os_Cbk_TraceCommTxEnd
Os_Cbk_TraceCommTxReady
8.1 Os_AsyncPushCallbackType
Type that represents a pointer to a void function that gets passed a single
uint8 value. Used by Os_TraceDumpAsync()
Portability
8.2 Os_TraceCategoriesType
Type that is used to contain mask values relating to user-defined trace filter
categories. An all and a non category are defined by default.
Portability
Values
OS_TRACE_NO_CATEGORIES
OS_TRACE_ALL_CATEGORIES
Example
Os_TraceCategoriesType ExtraTracing = DebugTracePoints |
DataLogTracePoints;
8.3 Os_TraceClassesType
Type that is used to contain mask values relating to trace filter classes.
Portability
OS_TRACE_ACTIVATIONS_CLASS
OS_TRACE_RESOURCES_CLASS
OS_TRACE_INTERRUPT_LOCKS_CLASS
OS_TRACE_SWITCHING_OVERHEADS_CLASS
OS_TRACE_TASKS_AND_ISRS_CLASS
OS_TRACE_ERRORS_CLASS
OS_TRACE_TASK_TRACEPOINT_CLASS
OS_TRACE_TRACEPOINT_CLASS
OS_TRACE_INTERVALS_CLASS
OS_TRACE_MESSAGE_DATA_CLASS
OS_TRACE_STARTUP_AND_SHUTDOWN_CLASS
OS_TRACE_ALARMS_CLASS
OS_TRACE_SCHEDULETABLES_CLASS
OS_TRACE_OSEK_EVENTS_CLASS
OS_TRACE_EXPIRY_POINTS_CLASS
OS_TRACE_NO_CLASSES
OS_TRACE_ALL_CLASSES
Example
Os_TraceClassesType AllTracepoints = OS_TRACE_TRACEPOINT_CLASS
| OS_TRACE_TASK_TRACEPOINT_CLASS;
8.4 Os_TraceDataLengthType
The length of a data block (in bytes).
Portability
Example
Os_TraceDataLengthType BlockLength = 8;
8.5 Os_TraceDataPtrType
A pointer to a block of data to log at a trace point or interval.
Portability
Example
Os_TraceDataPtrType DataPtr;
uint8 DataValues[10];
8.6 Os_TraceExpiryIDType
Enumerated type that defines Expiry points.
Portability
Values
The names of expiry points. These are generated using the pattern <sched-
uletable_name>_<expiry_name>.
8.7 Os_TraceIndexType
An unsigned integer value of at least 16 bits representing a number of trace
records.
Portability
Example
Os_TraceIndexType PreTriggerRecords = 100;
8.8 Os_TraceInfoType
An unsigned integer value representing a traced object.
Portability
8.9 Os_TraceIntervalIDType
Enumerated type that defines RTA-TRACE trace intervals.
Portability
Values
The names of user defined trace intervals.
Portability
Values
OS_TRACE_STATUS_OK
OS_TRACE_STATUS_COMM_INIT_FAILURE
8.11 Os_TraceTracepointIDType
Enumerated type that defines RTA-TRACE tracepoints.
Portability
Values
The names of user defined trace points.
8.12 Os_TraceValueType
An unsigned integer value representing either 16 or 32 bits depending on the
configuration of compact time.
Portability
9.1 OS_NUM_INTERVALS
The number of Trace Intervals declared.
Portability
9.2 OS_NUM_TASKTRACEPOINTS
The number of TaskTracepoints declared.
Portability
9.3 OS_NUM_TRACECATEGORIES
The number of Trace Categories declared.
Portability
9.4 OS_NUM_TRACEPOINTS
The number of Tracepoints declared.
Portability
9.5 OS_TRACE
This macro is only defined if tracing is enabled.
Portability
Example
#ifdef OS_TRACE
...
#endif
10.1 Namespace
The C programming language provides a single global scope for all names.
This prevents any two names declared in an entire program code from be-
ing identical even if the names are declared in different compilation units.
The AUTOSAR standard defines a naming convention for every basic soft-
ware module to avoid problems with namespace clashes. This is defined by
the “AUTOSAR General Requirements on Basic Software Modules”. RTA-OS3.0
has been implemented to satisfy these requirements. The namespace used
by RTA-OS3.0 therefore reserves all names that are prefixed by:
• OS*
• Os*
Note however, that the interface provided by AUTOSAR OS R3.0 does not
comply with the AUTOSAR naming convention. This means that the names
used by AUTOSAR OS R3.0 for types, API calls, macros, constants, callbacks
etc. are also reserved names and should not be duplicated in user code
The two forms can be used interchangeably in user code if required, but only
the second form represents standard AUTOSAR OS R3.0 API.
Every AUTOSAR XML file needs to reference the AUTOSAR schema instance
that defines the structure of the XML elements for AUTOSAR XML files. In the
simple case this is done as follows:
If you need to mix AUTOSAR and non-AUTOSAR content within the same file
then it is recommended that you use autosar as the namespace identifier.
This is done as follows:
In this case, all elements must now occur between <autosar:AUTOSAR> and
</autosar:AUTOSAR> have the form <autosar:TAG-NAME>.
<AUTOSAR>
<TOP-LEVEL-PACKAGES>
<AR-PACKAGE>
<SHORT-NAME>MyPackage</SHORT-NAME>
<DESC>This is one of my packages</DESC>
</AR-PACKAGE>
...
<AR-PACKAGE>
<SHORT-NAME>MyOtherPackage</SHORT-NAME>
<DESC>This is another</DESC>
</AR-PACKAGE>
</TOP-LEVEL-PACKAGES>
</AUTOSAR>
Rather than define a dedicated set of XML tags for the configuration of
each basic software module, the ECU configuration description defines a
<MODULE-CONFIGURATION> that contains CONTAINERS that hold configuration
data in a <CONTAINER>.
By default, references are rooted at /AUTOSAR. For the OS there are things
like:
• /AUTOSAR/Os/OsTask/OsTaskPriority
• /AUTOSAR/Os/OsResource
• /AUTOSAR/Os/OsIsr
The AUTOSAR <PACKAGE> name for the VSMD must not be AUTOSAR
so that tools can distinguish between standard configuration and
vendor-specific configuration. In RTA-OS3.0, the VSMD <PACKAGE>
is called RTAOS and all references to RTA-OS configuration ob-
jects have the form /RTAOS/path to configuration element.
References to standard AUTOSAR objects retain the the form
/AUTOSAR/path to configuration element. For example:
<CONTAINER>
<!-- Top-level container for global OS configuration
parameters -->
<SHORT-NAME>OsInfo</SHORT-NAME>
<PARAMETER-VALUES>
<!-- Standard AUTOSAR configuration parameters -->
<ENUMERATION-VALUE>
<DEFINITION-REF DEST="ENUMERATION-PARAM-DEF">/AUTOSAR/Os/
OsOS/OsStatus</DEFINITION-REF>
<VALUE>...</VALUE>
</ENUMERATION-VALUE>
<ENUMERATION-VALUE>
<DEFINITION-REF DEST="ENUMERATION-PARAM-DEF">/AUTOSAR/Os/
OsOS/OsScalabilityClass</DEFINITION-REF>
<VALUE>...</VALUE>
</ENUMERATION-VALUE>
<BOOLEAN-VALUE>
<DEFINITION-REF DEST="BOOLEAN-PARAM-DEF">/AUTOSAR/Os/OsOS
/OsStackMonitoring</DEFINITION-REF>
<VALUE>...</VALUE>
</BOOLEAN-VALUE>
<!-- ... -->
Description
Parameters to represent a specific piece of target hardware.
Multiplicity
0..1
String Parameters
Sub-container: Param
Description
Target-specific parameter representation.
Multiplicity
0..*
String Parameters
Sub-container: OsTbRate
Description
Specifies the duration of a tick on a non-default timebase
Multiplicity
0..*
String Parameters
String Parameters
Reference Parameters
Boolean Parameters
Integer Parameters
Reference Parameters
Boolean Parameters
Integer Parameters
String Parameters
Sub-container: Param
Description
Representation of parameters
Multiplicity
0..*
Sub-container: OsHooks
Boolean Parameters
Description
Target specific register sets that can be associated with a task or ISR. By
association with a task or ISR, the integrator is specifying that a specific task
or ISR uses this register set. Having no association defined allows potential
optimization.
Multiplicity
0..*
Enumeration Parameters
String Parameters
Description
An OsTimebase is a set of related timeunits, usually multiples of each other.
Multiplicity
0..*
Boolean Parameters
Integer Parameters
Sub-container: OsTbUnit
Description
An OsTbUnit is a time unit (eg. seconds)
Multiplicity
0..*
Float Parameters
String Parameters
Description
RTA-TRACE Data
Multiplicity
0..1
Boolean Parameters
Enumeration Parameters
Integer Parameters
Sub-container: OsEnumeration
Description
Specifies an enumeration for tracing.
Sub-container: OsEnumeration/Param
Description
Representation of name-value pairs
Multiplicity
0..*
String Parameters
Sub-container: OsTraceTracepoint
Description
Specifies a tracepoint
Multiplicity
0..*
Integer Parameters
String Parameters
Sub-container: OsTraceTaskTracepoint
Description
Specifies a task tracepoint
Multiplicity
0..*
String Parameters
Reference Parameters
Sub-container: OsInterval
Description
Specifies a named interval.
Multiplicity
0..*
Integer Parameters
String Parameters
Sub-container: Param
Description
Representation of name-value pairs
Multiplicity
0..*
Sub-container: OsClass
Description
Specifies an unnamed trace class.
Multiplicity
0..*
Boolean Parameters
Enumeration Parameters
Sub-container: OsCategory
Description
Specifies a named trace class.
Multiplicity
0..*
Boolean Parameters
Integer Parameters
Project files are specific to the RTA-OS3.0 tools and may not be
portable to third party AUTOSAR tooling.
The tools shipped with RTA-OS3.0 can be invoked from the command line,
making them easy to integrate into a build process. All commands accept any
number of XML input files together with tool-specific options as parameters.
The ordering of command line parameters is unimportant: options and XML
files can be mixed freely.
Some command line options can be specified using either short or long
(POSIX style) names. The two options forms provide identical functionality
and can be used interchangeably.
When a command line option takes an argument, the argument appears im-
mediately following short name options and after a colon following long name
options. For example, an option with argument arg could appear as either
The two forms are equivalent and can be mixed on the command line.
12.1.1 Options
Option Description
--diagnostic Display the diagnostic information on
the standard output. Diagnostic infor-
mation includes:
1. STANDARD
2. EXTENDED
rtaoscfg does not generate any files directly. When the Builder is used in
rtaoscfg this calls rtaosgen. See Section 12.2.2 for details of the files gener-
ated by rtaosgen.
12.1.3 Examples
rtaoscfg Config.xml
rtaoscfg MyProject.rtaos
12.2 rtaosgen
The command rtaosgen runs the RTA-OS3.0 kernel library generator.
12.2.1 Options
Option Description
@<FILE> Read command line parameters from
<FILE>. Each command in <FILE>
must appear on a separate. Quo-
tation marks are not required to es-
cape white space for filenames inside
a command file. The @<FILE> option
can itself appear multiple times inside
<FILE>.
1
Keeping source code is only possible with a valid source code license
1. STANDARD
2. EXTENDED
When rtaosgen runs and terminates without generating any errors or fatal
messages then it will have generated the following files:
Filename Contents
Os.h The main include file for the OS.
Os_Cfg.h Declarations of the objects you have configured. This
is included by Os.h.
Os_MemMap.h AUTOSAR memory mapping configuration used by
RTA-OS3.0 to merge with the system-wide MemMap.h
file.
RTAOS.<lib> The RTA-OS3.0 library for your application. The exten-
sion <lib> depends on your target.
RTAOS.<lib>.sig A signature file for the library for your application. The
extension <lib> depends on your target.
There may be other files which are generated that are specific to your port.
A list of additional files that can be generated can be found in the RTA-OS3.0
Target/Compiler Port Guide for your port.
12.2.3 Examples
Generate the OS as in the first example, but overwrite the existing sample
includes files and override the target to be ManchesterMk1:
For example, the OS has a RUNNINGTASK attribute that shows the task that is
currently running.
The following sections present the ORTI objects generated. Each section has
the following structure:
Object
Name of the ORTI object
Description
A description of the ORTI object.
Attributes
The attributes for the ORTI object.
Attribute Description
Attribute Name Attribute ORTI file description - Description of attribute
Each row of the table names the attribute being described and gives a brief
explanation of it. The name of each attribute is given in the Attribute column.
Attributes that are prefix with vs_ have been added for RTA-OS3.0 support
and are not standard ORTI attributes. Your debugger may or may not be able
to display these attributes depending on how well it conforms to the ORTI
standard.
13.2.1 OS
Object
OS
Description
There is only one OS object. It takes the name of the RTA-OS3.0 project.
Attributes
Attribute Description
RUNNINGTASK Running task - The name of the TASK
that is currently running. If an ISR in-
terrupts a task this attribute will con-
tinue to display the name of the task
that was interrupted while the ISR is
executing.
RUNNINGTASKPRIORITY Running task priority - The current pri-
ority of the running task, using the
same terms as in the OIL file. RUN-
NINGTASKPRIORITY does not show the
effect of locking a resource shared by
tasks and ISRs.
RUNNINGISR2 Running cat 2 ISR - The value of this
attribute is the name of the Category
2 ISR that is currently running (if there
is one). NO_ISR is displayed if no Cat-
egory 2 ISR is currently running.
SERVICETRACE OS Services Watch- Indicates the en-
try or exit of a service routine (an RTA-
OS3.0 Component API call) and the
name of this routine. Some debug-
gers recognize this attribute as a spe-
cial trace attribute and can provide ad-
ditional diagnostic support. On other
debuggers, you will be shown which
API call was most recently entered or
completed.
LASTERROR Last OSEK error - Gives the name of
the last error that has occurred. Ini-
tially set to E_OK.
13.2.2 Task
Object
TASK
Description
Generated in response to task declarations in the configuration file.
Attributes
Attribute Description
STATE State - The task state. One of SUS-
PENDED, RUNNING, READY and WAIT-
ING.
vs_BASEPRIORITY Base priority - Gives the base priority
of the task. The base priority is the pri-
ority of the task as defined in the OIL
file.
PRIORITY Dispatch priority - Gives the dispatch
priority of the task. The dispatch pri-
ority is the priority that the task starts
running at. This can be higher than the
base priority if internal resources are
used or if the task is non-preemptable.
CURRENTACTIVATIONS Activations - Gives the maximum num-
ber of activations allowed.
Object
RESOURCE
Description
Generated in response to resource declarations in the configuration file.
Attributes
Attribute Description
PRIORITY Ceiling Priority - Gives the ceiling prior-
ity of the resource in terms of the task
priority that defines the ceiling.
LOCKER Resource locker - Shows the current
holder of the resource.
STATE Resource State - Shows the state of
the resource as locked or not locked.
13.2.6 Events
13.2.7 Counter
13.2.8 Alarm
Object
ALARM
Description
Only generated in response to alarm declarations in the configuration file.
Attributes
Attribute Description
ALARMTIME Alarm Time - Shows when the alarm
expires next. Refer to the Count value
in the COUNTER object to establish the
current count value.
CYCLETIME Cycle Time - Gives the period of the cy-
cle for a cyclic alarm. CYCLETIME will
be zero for a single-shot alarm.
• Activate a task.
• Set an event.
Object
SCHEDULETABLE
Description
Only generated in response to alarm declarations in the configuration file.
Attributes
Attribute Description
COUNTER Counter - Gives the name of the
counter to which this alarm is at-
tached.
STATE State - Indicates the state of the
schedule table.
EXPIRYTIME Expiry Time - The tick at which the
next expiry point is due to be pro-
cessed.
NEXT Next table - The next schedule table (if
set).
This chapter provides compatibility information for RTA-OS3.0 with other ETAS
tooling and outlines the major changes between RTA-OS3.0 and the earlier
RTA-OSEK series of operating systems to assist users migrating to RTA-OS3.0.
3 Fully compatible
3 Partially compatible, see the notes for more details
7 Not compatible
1. OSEK API calls are portable with the exceptions which have slightly
modified behavior in AUTOSAR OS:
• All API calls, types and variables are prefixed Os_. For example:
LogTracepoint(MyTracepoint)
becomes
Os_LogTracepoint(MyTracepoint).
TRACE_ERRORS_CLASS
becomes
OS_TRACE_ERRORS_CLASS.
5. ASCET uses non-OSEK calls from the ERCOSEK API and is therefore not
compatible with RTA-OS3.0.
6. ASCET uses the RTA-OSEK API such that generated code is compatible
with RTA-OS3.0. The generated OIL file is not compatible with RTA-OS3.0
and will need to be converted to XML.
RTA-OS3.0 v1.0
RTA-OSEK v4.x
RTA-OSEK v5.x
See Section
API call
ActivateTask 3 3 3 3 3 3 3 3 3
ActivateTaskset 3 3 14.2.1
AdvanceSchedule 3 3 14.2.3
AssignTaskset 3 3 14.2.1
CallTrustedFunction 3 3
CancelAlarm 3 3 3 3 3 3 3 3 3
ChainTask 3 3 3 3 3 3 3 3 3
ChainTaskset 3 3 14.2.1
CheckISRMemoryAccess 3 3
CheckObjectAccess 3 3
CheckObjectOwnership 3 3
CheckTaskMemoryAccess 3 3
ClearEvent 3 3 3 3 3 3 3 3 3
CloseCOM 3 3 3 3 14.2.4
DisableAllInterrupts 3 3 3 3 3 3 3 3 3
EnableAllInterrupts 3 3 3 3 3 3 3 3 3
GetActiveApplicationMode 3 3 3 3 3 3 3 3 3
GetAlarm 3 3 3 3 3 3 3 3 3
GetAlarmBase 3 3 3 3 3 3 3 3 3
GetApplicationID 3 3
GetArrivalpointDelay 3 3 14.2.3
GetArrivalpointNext 3 3 14.2.3
GetArrivalpointTasksetRef 3 3 14.2.3
GetCounterValue 3 3 3 3 3 3 3
GetElapsedCounterValue 3 3 3 3 3
GetEvent 3 3 3 3 3 3 3 3 3
GetExecutionTime 3 3 14.2.2
GetISRID 3 3 3 3 3 3 3
GetLargestExecutionTime 3 3 14.2.2
GetMessageResource 3 3 3 3 14.2.4
GetMessageStatus 3 3 3 3 14.2.4
GetResource 3 3 3 3 3 3 3 3 3
GetScheduleNext 3 3 14.2.3
GetScheduleStatus 3 3 14.2.3
GetScheduleTableStatus 3 3 3 3 3 3 3 3
GetScheduleValue 3 3 14.2.3
GetStackOffset 3 3 14.2.11
GetTaskID 3 3 3 3 3 3 3 3 3
GetTasksetRef 3 3 14.2.1
GetTaskState 3 3 3 3 3 3 3 3 3
IncrementCounter 3 3 3 3 3 3 3
RTA-OS3.0 v1.0
RTA-OSEK v4.x
RTA-OSEK v5.x
See Section
API call
InitCOM 3 3 3 3 14.2.4
InitCounter 3
MergeTaskset 3 3 14.2.1
NextScheduleTable 3 3 3 3 3 3 3
Os_AdvanceCounter 3
Os_GetExecutionTime 3 14.2.2
Os_GetISRMaxExecutionTime 3 14.2.2
Os_GetISRMaxStackUsage 3 14.2.11
Os_GetStackUsage 3 14.2.11
Os_GetStackValue 3 14.2.11
Os_GetTaskMaxExecutionTime 3 14.2.2
Os_GetTaskMaxStackUsage 3 14.2.11
Os_ResetISRMaxExecutionTime 3 14.2.2
Os_ResetISRMaxStackUsage 3 14.2.11
Os_ResetTaskMaxExecutionTime 3 14.2.2
Os_ResetTaskMaxStackUsage 3 14.2.11
Os_Restart 3
Os_SetRestartPoint 3
osAdvanceCounter 3 14.2.7
osResetOS 3 14.2.12
ReadFlag 3 3 3 3 14.2.4
ReceiveMessage 3 3 3 3 14.2.4
ReleaseMessageResource 3 3 3 3 14.2.4
ReleaseResource 3 3 3 3 3 3 3 3 3
RemoveTaskset 3 3 14.2.1
ResetFlag 3 3 3 3 14.2.4
ResetLargestExecutionTime 3 3 14.2.2
ResumeAllInterrupts 3 3 3 3 3 3 3 3 3
ResumeOSInterrupts 3 3 3 3 3 3 3 3 3
Schedule 3 3 3 3 3 3 3 3 3
SendMessage 3 3 3 3 14.2.4
SetAbsAlarm 3 3 3 3 3 3 3 3 3
SetArrivalpointDelay 3 3 14.2.3
SetArrivalpointNext 3 3 14.2.3
SetEvent 3 3 3 3 3 3 3 3 3
SetRelAlarm 3 3 3 3 3 3 3 3 3 14.2.8
SetScheduleNext 3 3
SetScheduleTableAsync 3 3
ShutdownOS 3 3 3 3 3 3 3 3 3 14.2.6
StartCOM 3 3 3 3 14.2.4
StartOS 3 3 3 3 3 3 3 3 3 14.2.5
StartSchedule 3 3 14.2.3
RTA-OS3.0 v1.0
RTA-OSEK v4.x
RTA-OSEK v5.x
See Section
API call
StartScheduleTable 3 3 14.2.9
StartScheduleTableAbs 3 3 3 3 3
StartScheduleTableRel 3 3 3 3 3
StartScheduleTableSynchron 3 3
StopCOM 3 3 3 3 14.2.4
StopSchedule 3 3 14.2.3
StopScheduleTable 3 3 3 3 3 3 3
SuspendAllInterrupts 3 3 3 3 3 3 3 3 3
SuspendOSInterrupts 3 3 3 3 3 3 3 3 3
SyncScheduleTable 3 3
TerminateApplication 3 3
TerminateTask 3 3 3 3 3 3 3 3 3
TestArrivalpointWriteable 3 3 14.2.3
TestEquivalentTaskset 3 3 14.2.1
TestSubTaskset 3 3 14.2.1
Tick_<CounterID> 3 3 14.2.10
TickSchedule 3 3 14.2.3
WaitEvent 3 3 3 3 3 3 3 3 3
14.2.1 Tasksets
The RTA-OSEK timing build is replaced by the configuration option ‘Time Moni-
toring’. This provides means that it is possible to use EXTENDED status without
needing to provide stub implementations for time monitoring.
In RTA-OS3.0 the API calls are modified to take the Os_ prefix but have
identical behavior as the old RTA-OSEK calls. However, there are now spe-
cific calls for tasks and ISRs that replace the GetLargestExecutionTime and
GetLargestExecutionTime calls.
• Os_GetLargestExecutionTime is replaced by
_
Os Get[Task|ISR]MaxExecutionTime
14.2.3 Schedules
In OSEK OS, OSEK COM features may be provided by the OS (when OSEK
COM is not used). This feature is deprecated in AUTOSAR OS R3.0 as internal
communication for applications is provided by the AUTOSAR RTE.
The StartOS() call may return in OSEK OS. This is the behavior provided
in RTA-OSEK. In AUTOSAR OS this behavior is prohibited - the call must not
return. This is the behavior provided by RTA-OS3.0. This means that it is
no longer possible to use an idle loop placed after StartOS() as the idle
mechanism. In RTA-OS3.0 the kernel will busy wait by default when there are
no tasks and ISRs to run. You can replace this default behavior by providing
a function called Os_Cbk_Idle() that implements your own idle (background
task) functionality.
RTA-OSEK required you to calculate the amount of stack used by each task
or ISR. You can still do this with RTA-OS3.0, but an additional API call,
Os_GetStackUsage(), has been provided that returns the stack consumed
by the calling task/ISR alone at the point of the call. The avoids the need to
do any stack calculations yourself.
RTA-OS3.0 also logs the worst-case observed stack usage for each task/ISR
when a context switch (or a call to Os_GetStackUsage() is made. Addi-
tional API calls are provided to get the largest observed stack usage for each
task/ISR and to reset the largest observed value.
The best way to get technical support is by email. Any problems or questions
should be sent to: [email protected]
• the error message you received and the file Diagnostic.dmp if it was
generated.
If you prefer to discuss your problem with the technical support team you can
contact them by telephone during normal office hours (0900-1730 GMT/BST).
The telephone number for the RTA-OS3.0 support hotline is: +44 (0)1904
562624.
Europe
ETAS GmbH
Borsigstrasse 14 Phone: +49 711 89661-0
70469 Stuttgart Fax: +49 711 89661-300
Germany E-mail: [email protected]
WWW: www.etas.com
ETAS S.A.S.
1, place des États-Unis Phone: +33 1 56 70 00 50
SILIC 307 Fax: +33 1 56 70 00 51
94588 Rungis Cedex E-mail: [email protected]
France WWW: www.etas.com
ETAS Ltd.
Studio 3, Waterside Court Phone: +44 1283 54 65 12
Third Avenue, Centrum 100 Fax: +44 1283 54 87 67
Burton-upon-Trent E-mail: [email protected]
Staffordshire DE14 2WQ WWW: www.etas.com
United Kingdom
ETAS Inc.
3021 Miller Road Phone: +1 888 ETAS INC
Ann Arbor Fax: +1 734 997-9449
MI 48103 E-mail: [email protected]
USA WWW: www.etas.com
Japan
ETAS K.K.
Queen’s Tower C-17F Phone: +81 45 222-0900
2-3-5, Minatomirai, Nishi-ku Fax: +81 45 222-0956
Yokohama 220-6217 E-mail: [email protected]
Japan WWW: www.etas.com
Korea
P.R.China
India
A GetAlarm, 33
ActivateTask, 20 GetAlarmBase, 35
AlarmBaseRefType, 145 GetCounterValue, 37
AlarmBaseType, 145 GetElapsedCounterValue, 39
ALARMCALLBACK, 162 GetEvent, 41
AlarmType, 145 GetISRID, 43
AppModeType, 146 GetResource, 45
AUTOSAR OS includes GetScheduleTableStatus, 47
Os.h, 299 GetTaskID, 49
Os_Cfg.h, 299 GetTaskState, 51
Os_MemMap.h, 299
I
B IncrementCounter, 53
boolean, 156 ISR, 164
ISRRefType, 147
C ISRType, 147
CancelAlarm, 22
CAT1_ISR, 162 L
ChainTask, 24 Library
ClearEvent, 26 Name of, 299
CounterType, 146
N
D NextScheduleTable, 55
DeclareAlarm, 162
O
DeclareCounter, 162
Os_AdvanceCounter, 57
DeclareEvent, 163
Os_AdvanceCounter_<CounterID>,
DeclareISR, 163
60
DeclareResource, 163
Os_AsyncPushCallbackType, 269
DeclareScheduleTable, 164
Os_Cbk_Cancel_<CounterID>, 126
DeclareTask, 164
Os_Cbk_GetStopwatch, 127
DisableAllInterrupts, 28
Os_Cbk_Idle, 128
Os_Cbk_Now_<CounterID>, 129
E
Os_Cbk_RegSetRestore_<RegisterSetID>,
EnableAllInterrupts, 30
130
ErrorHook, 124
Os_Cbk_RegSetSave_<RegisterSetID>,
EventMaskRefType, 146
131
EventMaskType, 147
Os_Cbk_Set_<CounterID>, 132
F Os_Cbk_StackOverrunHook, 134
float32, 157 Os_Cbk_State_<CounterID>, 137
float64, 157 Os_Cbk_TimeOverrunHook, 138
Os_Cbk_TraceCommDataReady, 263
G Os_Cbk_TraceCommInitTarget, 264
GetActiveApplicationMode, 32 Os_Cbk_TraceCommTxByte, 265
Index 317
Os_Cbk_TraceCommTxEnd, 266 OS_NUM_EVENTS, 169
Os_Cbk_TraceCommTxReady, 267 OS_NUM_INTERVALS, 273
Os_Cbk_TraceCommTxStart, 268 OS_NUM_ISRS, 169
Os_CheckTraceOutput, 177 OS_NUM_RESOURCES, 170
Os_ClearTrigger, 178 OS_NUM_SCHEDULETABLES, 170
Os_CounterStatusRefType, 148 OS_NUM_TASKS, 170
Os_CounterStatusType, 149 OS_NUM_TASKTRACEPOINTS, 273
Os_DisableTraceCategories, 179 OS_NUM_TRACECATEGORIES, 273
Os_DisableTraceClasses, 181 OS_NUM_TRACEPOINTS, 273
Os_EnableTraceCategories, 183 OS_REGSET_<RegisterSetID>_SIZE,
Os_EnableTraceClasses, 185 170
OS_EXTENDED_STATUS, 168 Os_ResetISRMaxExecutionTime, 79
Os_GetExecutionTime, 62 Os_ResetISRMaxStackUsage, 81
Os_GetISRMaxExecutionTime, 64 Os_ResetTaskMaxExecutionTime, 83
Os_GetISRMaxStackUsage, 66 Os_ResetTaskMaxStackUsage, 85
Os_GetStackSize, 68 Os_Restart, 87
Os_GetStackUsage, 70 OS_SCALABILITY_CLASS_1, 171
Os_GetStackValue, 72 OS_SCALABILITY_CLASS_2, 171
Os_GetTaskMaxExecutionTime, 73 OS_SCALABILITY_CLASS_3, 171
Os_GetTaskMaxStackUsage, 75 OS_SCALABILITY_CLASS_4, 172
Os_GetVersionInfo, 77 Os_SetRestartPoint, 89
Os_IncrementCounter_<CounterID>, Os_SetTraceRepeat, 219
78 Os_SetTriggerWindow, 220
Os_LogCat1ISREnd, 187 OS_STACK_MONITORING, 172
Os_LogCat1ISRStart, 189 Os_StackOverrunType, 149
Os_LogCriticalExecutionEnd, 191 Os_StackSizeType, 150
Os_LogIntervalEnd, 193 Os_StackValueType, 150
Os_LogIntervalEndData, 195 OS_STANDARD_STATUS, 172
Os_LogIntervalEndValue, 197 Os_StartBurstingTrace, 222
Os_LogIntervalStart, 199 Os_StartFreeRunningTrace, 224
Os_LogIntervalStartData, 201 Os_StartTriggeringTrace, 226
Os_LogIntervalStartValue, 203 Os_StopTrace, 228
Os_LogProfileStart, 205 Os_StopwatchTickType, 150
Os_LogTaskTracepoint, 207 OS_TICKS2<Unit>_<CounterID>(ticks),
Os_LogTaskTracepointData, 209 173
Os_LogTaskTracepointValue, 211 OS_TIME_MONITORING, 173
Os_LogTracepoint, 213 OS_TRACE, 273
Os_LogTracepointData, 215 Os_TraceCategoriesType, 269
Os_LogTracepointValue, 217 Os_TraceClassesType, 269
OS_MAIN, 168 Os_TraceCommInit, 229
OS_NOAPPMODE, 169 Os_TraceDataLengthType, 270
OS_NUM_ALARMS, 169 Os_TraceDataPtrType, 270
OS_NUM_APPMODES, 169 Os_TraceDumpAsync, 230
OS_NUM_COUNTERS, 169 Os_TraceExpiryIDType, 271
318 Index
Os_TraceIndexType, 271 OsCyclesPerSecond, 284
Os_TraceInfoType, 271 OsDefCat1Stack, 284
Os_TraceIntervalIDType, 271 OsDefCat2Stack, 284
Os_TraceStatusType, 272 OsDefTaskStack, 284
Os_TraceTracepointIDType, 272 OsEnumeration, 287
Os_TraceValueType, 272 OSErrorGetServiceId, 165
Os_TriggerNow, 232 OsFormat, 282
Os_TriggerOnActivation, 233 OsHigherThanTaskRef, 286
Os_TriggerOnAdvanceCounter, 235 OsHooks, 285
Os_TriggerOnAlarmExpiry, 236 OsInterval, 289
Os_TriggerOnCat1ISRStart, 237 OsIntervalFormat, 289
Os_TriggerOnCat1ISRStop, 239 OsIntervalID, 289
Os_TriggerOnCat2ISRStart, 241 OsIsr, 282
Os_TriggerOnCat2ISRStop, 242 OsIsrAddress, 284
Os_TriggerOnChain, 243 OsIsrArbitrationOrder, 283
Os_TriggerOnError, 244 OsIsrBehavior, 283
Os_TriggerOnGetResource, 245 OsIsrBudget, 284
Os_TriggerOnIncrementCounter, 246 OsIsrBufferSize, 283
Os_TriggerOnIntervalEnd, 247 OsIsrFifo, 282
Os_TriggerOnIntervalStart, 248 OsIsrPriority, 283
Os_TriggerOnIntervalStop, 249 OsIsrRef, 289
Os_TriggerOnReleaseResource, 250 OsIsrStackAllocation, 284
Os_TriggerOnScheduleTableExpiry, OSMAXALLOWEDVALUE, 165
251 OSMAXALLOWEDVALUE_<CounterID>,
Os_TriggerOnSetEvent, 253 165
Os_TriggerOnShutdown, 254 OsMaxValue, 286
Os_TriggerOnTaskStart, 255 OSMINCYCLE, 166
Os_TriggerOnTaskStop, 256 OSMINCYCLE_<CounterID>, 166
Os_TriggerOnTaskTracepoint, 257 OsOS, 284
Os_TriggerOnTracepoint, 259 OsRate, 282
Os_UploadTraceData, 260 OsRegSet, 285
OsAppMode, 282 OsRegSetRef, 284, 286
OsBaseAmount, 286 OsRTATarget, 281
OsBaseUnit, 286 OsRTATargetName, 281
OsCategory, 290 OsRTATargetVariant, 281
OsCategoryAutostart, 290 OsRTATargetVersion, 281
OsCategoryFilter, 291 OSServiceIdType, 148
OsCategoryMask, 291 OsStackFaultHook, 285
OsClass, 290 OsStopwatch, 286
OsClassAutostart, 290 OsSuppressVectorGen, 284
OsClassFilter, 290 OSSWTICKDURATION, 166
OsCounter, 282 OSSWTICKSPERSECOND, 167
OSCYCLEDURATION, 164 OsTask, 285
OSCYCLESPERSECOND, 165 OsTaskBudget, 285
Index 319
OsTaskRef, 289 Options, 295
OsTaskStackAllocation, 285
OsTaskWaitStack, 285 S
OsTbRate, 282 Schedule, 97
OsTbUnit, 286 ScheduleTableRefType, 151
OSTICKDURATION, 167 ScheduleTableStatusRefType, 152
OSTICKDURATION_<CounterID>, 167 ScheduleTableStatusType, 152
OSTICKSPERBASE, 167 ScheduleTableType, 152
OSTICKSPERBASE_<CounterID>, 168 SetAbsAlarm, 99
OsTicksPerSecond, 284 SetEvent, 101
OsTimebase, 286 SetRelAlarm, 103
OsTimebaseRef, 282 ShutdownHook, 142
OsTrace, 287 ShutdownOS, 105
OsTraceAuto, 287 sint16, 157
OsTraceAutoComms, 287 sint16_least, 158
OsTraceAutoRepeat, 287 sint32, 158
OsTraceBufferSize, 287 sint32_least, 158
OsTraceCompactID, 287 sint8, 159
OsTraceCompactTime, 287 sint8_least, 159
OsTraceEnabled, 287 StartOS, 107
OsTraceFilter, 283, 285 StartScheduleTableAbs, 109
OsTraceTaskTracepoint, 288 StartScheduleTableRel, 111
OsTraceTaskTracepointFormat, 289 StartupHook, 144
OsTraceTaskTracepointID, 289 StatusType, 153
OsTraceTgtStack, 287 Std_ReturnType, 153
OsTraceTgtTrigger, 287 Std_VersionInfoType, 154
OsTraceTracepoint, 288 StopScheduleTable, 113
OsTraceTracepointFormat, 288 SuspendAllInterrupts, 115
OsTraceTracepointID, 288 SuspendOSInterrupts, 117
OsUnitAmount, 286
T
P TASK, 173
Param, 281, 284, 288, 289 TaskRefType, 155
PhysicalTimeType, 151 TaskStateRefType, 155
PostTaskHook, 140 TaskStateType, 155
PreTaskHook, 141 TaskType, 155
TerminateTask, 119
R TickRefType, 156
ReleaseResource, 91 TickType, 156
ResourceType, 151
ResumeAllInterrupts, 93 U
ResumeOSInterrupts, 95 uint16, 159
rtaoscfg uint16_least, 159
Options, 293 uint32, 160
rtaosgen uint32_least, 160
320 Index
uint8, 160 Value, 281, 285, 288, 290
uint8_least, 161
W
V WaitEvent, 121
Index 321