ControlCore OS Definition

This MotoHawk™ block allows the attributes of the ControlCore OS that will execute on the target to be configured.

Block ID

ControlCore OS

Library

motohawk_tasking_lib/Target OS Blocks

Description

This MotoHawk™ block allows the attributes of the ControlCore OS that will execute on the target to be configured. To use this block the Use Advanced OS Configuration option of the Target Definition block needs to be checked and ControlCore selected as the Target OS.

This block replaces OS configurations found in the Starvation Timer Definition block, Target Definition block and Trigger Definition block as well as exposing additional configuration flexibility.

Additional Help

The Understanding ControlCore Task Scheduling help topic also provides some background on the operation of the ControlCore OS. That help topic is written under the assumption that the Use Advanced OS Configuration option of the Target Definition block hasn't been checked, but the principles are the same. This definition just provides the developer with additional configuration flexibility. Thus the number, priority and names of the tasks can be altered when this block and its companions are used where as they are pre-defined (as detailed in the help topic) when the Use Advanced OS Configuration option isn't used.

Block Parameters

Main

Attributes that need to be defined based upon the functionality of the application that is to execute within the constrains of the ControlCore OS.

Parameter Field Values Comments/Description
Name Single quote enclosed alpha numeric The name that will be assigned to the OS definition.
Kernel's RTI Period [us] Integer above 0 Defines the Real Time Interrupt (RTI) period. All kernel timed events will operate using this period. Indeterminate application operation may result if this value is greater than 20000 microseconds. The application developer is responsible for validating proper functionality if this value is exceeded. MotoHawk™ will warn if the limit is exceeded unless that warning is explicitly suppressed via the Suppress RTI Period Warning Check Box.

This attribute replaces the RTI interval specified by the Trigger Definition block.
Suppress RTI Period Warning Check Box Checking this box will suppress a warning that is displayed when the Kernel's RTI Period is set to a value greater than 20000 microseconds.
Number of cores to be used Integer greater than 0 Specifies how many of the available cores (which is defined by the microcontroller of the selected target) are to be used by ControlCore. Selecting fewer cores than are available may make sense if CPU processing requirements are low, or the model is restricted on memory. Each core used by the model will require an interrupt stack to be defined, which consume memory.

It should be noted that a core is only considered available if that core can be used by ControlCore to execute independent code. A lockstep core, for example, does not allow independent code execution (it follows in lockstep with another core) and thus is not considered available for use by ControlCore.
Force task execution to be exclusive to one core Checkbox This attribute is only relevent when multiple cores are in use. When checked an error will result if a task definition specifies that it may execute on more than a single core. That is share its execution over multiple cores.

Memory

Attributes related to ControlCore OS memory allocation.

Interrupt Stack Size (Nx1)
[bytes]
Vector of integers greater than 0 An interrupt stack holds temporary variables required during the execution of an interrupt (CAN message, crank tooth etc.). Indeterminate operation and/or module reset can result if a stack of insufficient size is declared. An interrupt stack is required for each core in use (which is why this is a vector definition).
Interrupt Stack Margin (Nx1)
[bytes]
Vector of integers 0 or higher Defines the allowed margin on the interrupt stack. Certain systems may take action if the number of free bytes on the interrupt stack is smaller than this value. A margin is required for each core in use (which is why this is a vector definition).
Heap Size [bytes] Integer greater than zero Defines the size of the freestore memory. This memory is primarily used for dynamic mailboxes, which can grow as required and for queues.
Heap Margin [bytes] Integer 0 or higher Defines the allowed margin on heap usage. Certain systems may take action if the number of free bytes in the heap is smaller than this value.

Services

The ControlCore OS includes services that the developer has some control over. Some MotoHawk™ features will also utilize these services.

Parameter Field Values Comments/Description
Application Interrupt Task Single quote enclosed alpha numeric The name of the task that will be used by device drivers to service interrupt based events. The selected task should be the highest priority task in the model.
Non-volatile Memory Write Task Single quote enclosed alpha numeric A physical write of non-volatile memory take a finite amount of time to complete. Sometimes writing a page of non-volatile memory can take more than 10ms and typically a non-volatile memory has multiple pages. The named task is used to monitor these writes. The selected task can be shared with other activity, but should be a task that can afford to have its execution stalled for long periods of time. Thus a task that is used to house the execution of periodic trigger events is not a good candidate to house the Non-volatile Memory Write function.
Idle Task Single quote enclosed alpha numeric The ControlCore OS requires a task that can house idle activity. This task will have the lowest execution priority and will execute when there is no other work that needs to be performed.

OS Integrity

Attributes related to OS integrity operation. Often the default values can be used without modification.

Parameter Field Values Comments/Description
Starvation Time [ms] Positive number Task starvation will be detected if the idle loop does not execute within this time. A value of zero is treated an infinite and thus disables the detection of task starvation. Detecting task starvation will result in module reset.

This attribute operates in the same manner as the Starvation Time defined by the Starvation Timer Definition block. Having a ControlCore™ OS Definition block removes the need to include a Starvation Timer Definition block in the model.

Defining starvation time provides further detail on how to configure this attribute.
Starvation Timer Margin [ms] Numeric The margin to determine when the starvation time is being approached.

Legacy Compatibility

Some older MotoHawk blocks such as the Function Trigger were designed for use within MotoHawk™ before this block was made available. These blocks can continue to be used and will base their behavior around the attributes defined on this tab.

Parameter Field Values Comments/Description
Period for BASE (multiples of RTI) Integer above 0 This value defines the BASE trigger period (used in Function Trigger) as a multiple of the Kernel's RTI Period.

This attribute replaces the BASE period specified by the Trigger Definition block.