Opposite to earlier versions of Frameworks by Willert Software Tools,
the latest Frameworks are build inside your IDE and no longer inside
Rhapsody. As a result, you no longer can set properties in the Rhapsody
model to specify various RTOS details. Instead, you must use the
mechanisms offered by your RTOS manufactorer.
For CMX-RTX, you must configure its kernel by modifying the
file cxconfig.h
Please note that there is a default version of this file in
your
installed CMX-RTX, but you should use a copy of that file and not
modify the original. During installation of your product, an instance
of cxconfig.h is installed in <your
Rhapsody>\Share\WST_RXF_V5\<your
product>\Source
By no means this documentation can be regarded as the complete CMX-RTX
kernel documentation: please refer to the CMX documentation. We focus
on integration with Rhapsody generated C code and the RXF by Willert
Software Tools:
C_MAX_TASKS
which defaults to 12.
You should set this constant to match the number of active classes + 2
in your Rhapsody model. If the Framework fails to create a new task,
the error handler RiCErrorHandler_error() is called with the constant OXF_TASK_CREATE_FAILED.
C_MAX_RESOURCES
which is defined as C_MAX_TASKS - 2 + 3: the RXF uses 3 mutexes by
default, plus 1 for each active object. You should set the constant
C_MAX_RESOURCES to C_MAX_TASKS plus 3
plus the number of mutexes you want to use yourselves via the
RiCOSMutex class in Rhapsody.
If the Framework fails to create a new mutex, the error handler
RiCErrorHandler_error() is called with the
constant OXF_MUTEX_CREATE_FAILED.
C_MAX_CYCLIC_TIMERS
which is set to 1. Timers are part of the OSAL interface but
Rhapsody
timers in UML are handled by a single timer in our RXF. CMX-RTX uses
cyclic timers, so we 'translate' a WST timer into a cyclic timer.
C_MAX_MESSAGES
is the maximum number
of messages in all mailboxes. It is defined as 32 * (C_MAX_TASKS - 2 +
1). An event in
the RXF results in the Framework (including a timer event), results in
a mailbox. You should set the constant C_MAX_MESSAGES to the maximum
number of
messages * ( number of tasks + 1 ). 32 * ( number of tasks +
1 )
is a good start.
C_MAX_QUEUES
defaults to 5 but can be set to 0
C_MAX_MAILBOXES
which is set to C_MAX_QUEUES + C_MAX_TASKS. Message queues are part of
the OSAL interface and implemented in the
RXF via mailboxes. Each active objects has its own queue. The main task
and the Bridge task also use a queue, so you should set this constant
to match the number of
active classes + 2
in your Rhapsody model. If the Framework fails to create a new message
queue, the error handler RiCErrorHandler_error() is called with the
constant OXF_MSGQ_CREATE_FAILED.
C_MAX_SEMAPHORES
can be set to 1. Although semaphores are part of the OSAL interface,
unless you use the RiCOSSemaphore class yourselves, you do not need any
CMX-RTX semaphores. Stricktly speaking you could
set C_MAX_SEMAPHORES
to 0 when not using semaphores yourselves, but you will end up with a
linker error referring to _sem_array because the CMX-RTX source code
can not coop with an empty array.
C_TASK_STK_SIZE
which is the
stack size of all tasks, so including the stack of the main task and
the stack of the bridge task. The constant C_TASK_STK_SIZE is set it to:
C_TASK_STK_SIZE = RTOS_MAIN_STK_SIZE
+ RTOS_SMALL_STACK
+ ( ( C_MAX_TASKS
- 2 ) * RTOS_DEFAULT_STACK
)
C_INTERRUPT_SIZE
which is set to 256. This is the size of the interrupt stack. The CMX
timer task K_I_Scheduler, and K_I_Intrp_Pipe_Out function use this.
C_RTC_SCALE
which is set to 1. This is th enumber of timer interrupt ticks, before
CMX tick. All time counters based on this.
C_TSLICE_SCALE which is set
to 1. This is the number of timer interrupt ticks, before forcing task
to do time slice task switch
C_PIPE_SIZE which is set to 32. This is the size of the interrupt pipe.
The file WSTRTOS.h is used to specify details for CMX-RTX which are
needed by the RTOS
bridge interface. You can modify the constants:
RTOS_PRIORITY_LOW. This priority is used for the
Bridge task, when in simulated-time model.
RTOS_PRIORITY_NORMAL. This priority is used for any task,
created on behalf of your active class(es).
RTOS_PRIORITY_ABOVE_NORMAL. This priority is defined a little
higher than RTOS_PRIORITY_NORMAL and can be used for tasks that need to
be higher prioritized. It is not assigned to any tasks of the RXF or
the user model automatically.
RTOS_PRIORITY_HIGH. This priority is used for the Bridge
task, when in real-time model.
RTOS_SMALL_STACK.
This is the stack size in bytes for the bridge task.
RTOS_DEFAULT_STACK.
This is the default stack size for any task, created on behalf
of your active class(es).
RTOS_MQ_DEFAULT_SIZE . This is maximum number of
queued events within your application.
RTOS_MAIN_STK_SIZE.
This is the stack size for the Main task.
NOTE
If you modify a source file, you must rebuild your
application, see GettingStarted
example
Copyright (c) Willert
Software Tools GmbH. All rights reserved.