Rte Configuration
What You Will Do
In this chapter you configure the module Rte by hand. The Rte maps each runnable event of the SW-Cs and each main function of the BSW, the main function of CanNm included, to an Os task and the alarm that activates it.
Before You Begin
- Start after finishing Os Configuration. The Rte references pick the Os tasks and alarms made there.
- Open the tab
VehicleDesign:Configurationand click MODULE > Configuration >Rte. - "+" means the + at the right end of a row in the CONFIGURATION tree. It adds the container and selects it. Only the values given here are changed.
- References are picked from their dropdown, except
RteBswImplementationRefandRteBswEventRef: their dropdown offers nothing, so type the path and pressTab. - The panel may show only the end of a long path.
Some containers already exist because the Rte values file of PRTE Setup made them. Do not add those again; only complete them.
| Origin | Containers | What you do |
|---|---|---|
| Rte values file | The SW-C instances (EcuMInstance, BswMInstance, ..., SwcSensorInstance, SwcActuatorInstance) | Nothing |
| Rte values file | BswMInstance/RteEventToTaskMapping_0 | Complete it |
| Rte values file | RteBswModuleInstance_0, _3, _4, _5, _6, each with RteBswExclusiveAreaImpl_0 | Complete them |
| "+" (26) | RteGeneration, RteBswGeneral, RteInitializationBehavior_0, three RteEventToTaskMapping, RteModeMachineInstanceConfig_0, RteOsInteraction, three RteUsedOsActivation, RteBswModuleInstance_1, _2 and _7, twelve RteBswEventToTaskMapping | Add and fill them |
Checking What the Rte Values File Brought
-
Click
Rte. The tree already holds the SW-C instances and five BSW module instances.
Figure 8-1. ①
Rte, ②BswMInstance(from the Rte values file), ③RteBswModuleInstance_0(from the Rte values file).
Generation and Initialization
-
Press "+" on the
RteGenerationrow.
Figure 8-2. ①
Rte, ②RteGeneration, ③ +. -
In
RteCodeVendorIdtype79and pressTab.
Figure 8-3. ①
RteGeneration, ②RteCodeVendorId. -
Press "+" on
RteBswGeneral. It needs no values. -
Press "+" on
RteInitializationBehavior. SetRteInitializationStrategytoRTE_INITIALIZATION_STRATEGY_AT_DATA_DECLARATIONand typeINITinRteSectionInitializationPolicy.
SW-C Event Mappings
RteEventIsMappedToTask is the trap here: "+" writes FALSE, and every mapping that names a task needs TRUE.
-
Under
SwcSensorInstance, press "+" onRteEventToTaskMapping.
Figure 8-4. ①
Rte, ②RteEventToTaskMappingunderSwcSensorInstance, ③ +. -
Press TRUE at
RteEventIsMappedToTask, then pick the references from the table.
Figure 8-5. ①
RteEventToTaskMapping_0, ②RteEventIsMappedToTask, ③RteEventRef, ④RteMappedToTaskRef, ⑤RteUsedOsAlarmRef. -
Add the two mappings of
SwcActuatorInstancethe same way. -
Select
BswMInstance/RteEventToTaskMapping_0(from the Rte values file). ItsRteEventRefis already set; fill the rest.
Figure 8-6. ①
RteEventToTaskMapping_0, ②RteEventIsMappedToTask, ③RtePositionInTask, ④RteMappedToTaskRef, ⑤RteUsedOsAlarmRef, ⑥RteEventRef(from the Rte values file).
RteEventIsMappedToTask is TRUE in every row.
| Container | RtePositionInTask | RteEventRef | RteMappedToTaskRef | RteUsedOsAlarmRef |
|---|---|---|---|---|
SwcSensorInstance/RteEventToTaskMapping_0 ("+") | - | SwComponentType/Atomic/Application/SwcSensor/InternalBehavior/SensorCyclicTiming | Os/OsTask_2 | Os/OsAlarm_1 |
SwcActuatorInstance/RteEventToTaskMapping_0 ("+") | 2 | SwComponentType/Atomic/Application/SwcActuator/InternalBehavior/ActuatorInitEvent | Os/OsTask_3 | - |
SwcActuatorInstance/RteEventToTaskMapping_1 ("+") | 1 | SwComponentType/Atomic/Application/SwcActuator/InternalBehavior/ActuatorOnDataEvent | Os/OsTask_3 | - |
BswMInstance/RteEventToTaskMapping_0 (Rte values file) | 0 | (from the Rte values file) | Os/OsTask_3 | Os/OsAlarm_2 |
Do not map ActuatorGetScaleEvent, the operation-invoked event of Actuator_GetScale. The code generator accepts an unmapped event only for a server runnable that can be invoked concurrently, which you set in Internal Behavior with CAN BE INVOKED = TRUE.
EcuM Mode Machine
-
Under
EcuMInstance, press "+" onRteModeMachineInstanceConfig.
Figure 8-7. ①
Rte, ②RteModeMachineInstanceConfigunderEcuMInstance, ③ +. -
In
RteModeMachineQueueLengthtype1and pressTab. -
In
RteSwcModeManagerRefpickPortInterface/ModeSwitch/EcuM_CurrentMode/currentMode. -
Select another tree node, then
RteModeMachineInstanceConfig_0again. Only now the Context Refs row appears. PickSwComponentType/Atomic/Service/EcuM/currentMode(ABSTRACT-PROVIDED-PORT-PROTOTYPE).
Figure 8-8. ①
RteModeMachineInstanceConfig_0, ②RteModeMachineQueueLength, ③RteSwcModeManagerRef, ④ Context Refs.
Os Activations
-
Press "+" on
RteOsInteraction. It needs no values. -
Under it, press "+" on
RteUsedOsActivation. In the newRteUsedOsActivation_0, enter the values of the table.
Figure 8-9. ①
RteUsedOsActivation_0, ②RteExpectedActivationOffset, ③RteExpectedTickDuration, ④RteActivationOsAlarmRef. -
Add
_1and_2the same way from the table.
| Container | RteExpectedActivationOffset | RteExpectedTickDuration | RteActivationOsAlarmRef |
|---|---|---|---|
RteUsedOsActivation_0 | 0 | 0.01 | Os/OsAlarm_0 |
RteUsedOsActivation_1 | 0 | 0.01 | Os/OsAlarm_1 |
RteUsedOsActivation_2 | 0 | 0.01 | Os/OsAlarm_2 |
BSW Module Instances
The Rte values file brought _0, _3, _4, _5 and _6. "+" gives the smallest free number, so add the instances in this order: EcuM's (_1), Can's (_2), then CanNm's (_7). Nm needs no instance.
-
Select
RteBswModuleInstance_0(from the Rte values file). TypeBswModuleDescription/BswM/BswMImplementationinRteBswImplementationRefand pressTab. -
Select its
RteBswExclusiveAreaImpl_0(from the Rte values file). SetRteExclusiveAreaImplMechanismtoALL_INTERRUPT_BLOCKING.RteBswExclusiveAreaRefis already set.
Figure 8-10. ①
RteBswExclusiveAreaImpl_0, ②RteExclusiveAreaImplMechanism, ③RteBswExclusiveAreaRef(from the Rte values file). -
Complete
_3,_4,_5and_6the same way from the table. -
Press "+" on
RteBswModuleInstance. Type the EcuM path from the table inRteBswImplementationRefofRteBswModuleInstance_1and pressTab. -
Press "+" on
RteBswModuleInstanceagain.
Figure 8-11. ①
Rte, ②RteBswModuleInstance, ③ +. -
Type
BswModuleDescription/Can/CanImplementationinRteBswImplementationRefofRteBswModuleInstance_2and pressTab.
Figure 8-12. ①
RteBswModuleInstance_2, ②RteBswImplementationRef. -
Press "+" on
RteBswModuleInstanceonce more. The editor names itRteBswModuleInstance_7, because_3to_6are taken. Type the CanNm path from the table in itsRteBswImplementationRefand pressTab.
| Instance | Origin | RteBswImplementationRef (typed) | RteExclusiveAreaImplMechanism of RteBswExclusiveAreaImpl_0 |
|---|---|---|---|
RteBswModuleInstance_0 | Rte values file | BswModuleDescription/BswM/BswMImplementation | ALL_INTERRUPT_BLOCKING |
RteBswModuleInstance_1 | "+" | BswModuleDescription/EcuM/EcuMImplementation | - |
RteBswModuleInstance_2 | "+" | BswModuleDescription/Can/CanImplementation | - |
RteBswModuleInstance_3 | Rte values file | BswModuleDescription/CanIf/CanIfImplementation | ALL_INTERRUPT_BLOCKING |
RteBswModuleInstance_4 | Rte values file | BswModuleDescription/CanSM/CanSMImplementation | ALL_INTERRUPT_BLOCKING |
RteBswModuleInstance_5 | Rte values file | BswModuleDescription/ComM/ComMImplementation | ALL_INTERRUPT_BLOCKING |
RteBswModuleInstance_6 | Rte values file | BswModuleDescription/Com/ComImplementation | ALL_INTERRUPT_BLOCKING |
RteBswModuleInstance_7 | "+" | BswModuleDescription/CanNm/CanNmImplementation | - |
BSW Event Mappings
RteBswEventIsMappedToTask has the same trap: "+" writes FALSE; press TRUE.
-
Under
RteBswModuleInstance_2, press "+" onRteBswEventToTaskMapping. -
Press TRUE at
RteBswEventIsMappedToTaskand type4inRteBswPositionInTask. -
Type
BswModuleDescription/Can/Can/CanInternalBehavior/CanMainWriteTimingEventinRteBswEventRefand pressTab. -
Pick
Os/OsTask_0inRteBswMappedToTaskRefandOs/OsAlarm_0inRteBswUsedOsAlarmRef.
Figure 8-13. ①
RteBswEventToTaskMapping_0, ②RteBswEventIsMappedToTask, ③RteBswPositionInTask, ④RteBswEventRef, ⑤RteBswMappedToTaskRef, ⑥RteBswUsedOsAlarmRef. -
Add the other mappings the same way from the table. Every one is added with "+", has
RteBswEventIsMappedToTaskTRUE,RteBswMappedToTaskRefOs/OsTask_0andRteBswUsedOsAlarmRefOs/OsAlarm_0. -
The last one is the main function of
CanNm: underRteBswModuleInstance_7, press "+" onRteBswEventToTaskMapping, press TRUE, type13inRteBswPositionInTaskand the CanNm event of the table inRteBswEventRef, and pick the task and alarm.
Figure 8-14. ①
RteBswEventToTaskMapping_0, ②RteBswEventIsMappedToTask, ③RteBswPositionInTask, ④RteBswEventRef, ⑤RteBswMappedToTaskRef, ⑥RteBswUsedOsAlarmRef. -
Save the module with
Ctrl+S.
| Mapping | RteBswPositionInTask | RteBswEventRef (typed) |
|---|---|---|
RteBswModuleInstance_0/RteBswEventToTaskMapping_0 | 2 | BswModuleDescription/BswM/BswM/BswMInternalBehavior/BswMMainTimingEvent |
RteBswModuleInstance_1/RteBswEventToTaskMapping_0 | 3 | BswModuleDescription/EcuM/EcuM/EcuMInternalBehavior/EcuMMainTimingEvent |
RteBswModuleInstance_2/RteBswEventToTaskMapping_0 | 4 | BswModuleDescription/Can/Can/CanInternalBehavior/CanMainWriteTimingEvent |
RteBswModuleInstance_2/RteBswEventToTaskMapping_1 | 5 | BswModuleDescription/Can/Can/CanInternalBehavior/CanMainReadTimingEvent |
RteBswModuleInstance_2/RteBswEventToTaskMapping_2 | 6 | BswModuleDescription/Can/Can/CanInternalBehavior/CanMainModeTimingEvent |
RteBswModuleInstance_2/RteBswEventToTaskMapping_3 | 7 | BswModuleDescription/Can/Can/CanInternalBehavior/CanMainBusOffTimingEvent |
RteBswModuleInstance_2/RteBswEventToTaskMapping_4 | 8 | BswModuleDescription/Can/Can/CanInternalBehavior/CanMainWakeupTimingEvent |
RteBswModuleInstance_4/RteBswEventToTaskMapping_0 | 9 | BswModuleDescription/CanSM/CanSM/CanSMInternalBehavior/CanSMMainTimingEvent |
RteBswModuleInstance_5/RteBswEventToTaskMapping_0 | 10 | BswModuleDescription/ComM/ComM/ComMInternalBehavior/ComMMainFunctionTimingEvent_ComMChannel_0 |
RteBswModuleInstance_6/RteBswEventToTaskMapping_0 | 11 | BswModuleDescription/Com/Com/ComInternalBehavior/ComMainFunctionRxTimingEvent_ComMainFunctionRx |
RteBswModuleInstance_6/RteBswEventToTaskMapping_1 | 12 | BswModuleDescription/Com/Com/ComInternalBehavior/ComMainFunctionTxTimingEvent_ComMainFunctionTx |
RteBswModuleInstance_7/RteBswEventToTaskMapping_0 | 13 | BswModuleDescription/CanNm/CanNm/CanNmInternalBehavior/CanNmMainTimingEvent |
Why Is It Designed This Way?
- Mappings. A runnable or a BSW main function runs only when an Rte mapping puts it into an Os task.
- TRUE on every mapping. PRTE rejects a mapping that names a task while its flag says
FALSE(RTE_EVENT_MAPPING_TASK_FLAG_MISMATCH,RTE_BSW_EVENT_MAPPING_TASK_FLAG_MISMATCH). - Com events named after containers.
Comhas one main function event perComMainFunctionRxandComMainFunctionTxcontainer, so the event names end with the names of the two containers you add in Communication Configuration. - An instance for CanNm.
CanNmhas a main function, so PRTE requires its BSW module instance (RTE_BSW_INSTANCE_MISSINGwithout it).Nmhas none and needs no instance. - The Rte values file. It carries only what the panel cannot take (the BswM poll event and the BSW exclusive areas) and the SW-C instances, which the import would otherwise wipe.
- Positions.
RteBswPositionInTasksets the call order of the BSW main functions insideOsTask_0.
Checklist
- Every
RteEventToTaskMappingandRteBswEventToTaskMappingshows TRUE at its mapped-to-task flag. -
RteBswModuleInstance_0to_7each have anRteBswImplementationRef. -
RteModeMachineInstanceConfig_0shows the Context Refs row filled. - The tab
VehicleDesign:Configurationcarries no modified mark.
Next Step
In Communication Configuration you configure the CAN communication stack, from EcuC and the CAN driver to LSduR, PduR and Com.