Skip to main content

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:Configuration and 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 RteBswImplementationRef and RteBswEventRef: their dropdown offers nothing, so type the path and press Tab.
  • 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.

OriginContainersWhat you do
Rte values fileThe SW-C instances (EcuMInstance, BswMInstance, ..., SwcSensorInstance, SwcActuatorInstance)Nothing
Rte values fileBswMInstance/RteEventToTaskMapping_0Complete it
Rte values fileRteBswModuleInstance_0, _3, _4, _5, _6, each with RteBswExclusiveAreaImpl_0Complete them
"+" (26)RteGeneration, RteBswGeneral, RteInitializationBehavior_0, three RteEventToTaskMapping, RteModeMachineInstanceConfig_0, RteOsInteraction, three RteUsedOsActivation, RteBswModuleInstance_1, _2 and _7, twelve RteBswEventToTaskMappingAdd and fill them

Checking What the Rte Values File Brought​

  1. Click Rte. The tree already holds the SW-C instances and five BSW module instances.

    Rte after the import

    Figure 8-1. ① Rte, ② BswMInstance (from the Rte values file), ③ RteBswModuleInstance_0 (from the Rte values file).

Generation and Initialization​

  1. Press "+" on the RteGeneration row.

    The + on RteGeneration

    Figure 8-2. ① Rte, ② RteGeneration, ③ +.

  2. In RteCodeVendorId type 79 and press Tab.

    RteGeneration

    Figure 8-3. ① RteGeneration, ② RteCodeVendorId.

  3. Press "+" on RteBswGeneral. It needs no values.

  4. Press "+" on RteInitializationBehavior. Set RteInitializationStrategy to RTE_INITIALIZATION_STRATEGY_AT_DATA_DECLARATION and type INIT in RteSectionInitializationPolicy.

SW-C Event Mappings​

RteEventIsMappedToTask is the trap here: "+" writes FALSE, and every mapping that names a task needs TRUE.

  1. Under SwcSensorInstance, press "+" on RteEventToTaskMapping.

    The + on RteEventToTaskMapping

    Figure 8-4. ① Rte, ② RteEventToTaskMapping under SwcSensorInstance, ③ +.

  2. Press TRUE at RteEventIsMappedToTask, then pick the references from the table.

    SwcSensorInstance/RteEventToTaskMapping_0

    Figure 8-5. ① RteEventToTaskMapping_0, ② RteEventIsMappedToTask, ③ RteEventRef, ④ RteMappedToTaskRef, ⑤ RteUsedOsAlarmRef.

  3. Add the two mappings of SwcActuatorInstance the same way.

  4. Select BswMInstance/RteEventToTaskMapping_0 (from the Rte values file). Its RteEventRef is already set; fill the rest.

    BswMInstance/RteEventToTaskMapping_0

    Figure 8-6. ① RteEventToTaskMapping_0, ② RteEventIsMappedToTask, ③ RtePositionInTask, ④ RteMappedToTaskRef, ⑤ RteUsedOsAlarmRef, ⑥ RteEventRef (from the Rte values file).

RteEventIsMappedToTask is TRUE in every row.

ContainerRtePositionInTaskRteEventRefRteMappedToTaskRefRteUsedOsAlarmRef
SwcSensorInstance/RteEventToTaskMapping_0 ("+")-SwComponentType/Atomic/Application/SwcSensor/InternalBehavior/SensorCyclicTimingOs/OsTask_2Os/OsAlarm_1
SwcActuatorInstance/RteEventToTaskMapping_0 ("+")2SwComponentType/Atomic/Application/SwcActuator/InternalBehavior/ActuatorInitEventOs/OsTask_3-
SwcActuatorInstance/RteEventToTaskMapping_1 ("+")1SwComponentType/Atomic/Application/SwcActuator/InternalBehavior/ActuatorOnDataEventOs/OsTask_3-
BswMInstance/RteEventToTaskMapping_0 (Rte values file)0(from the Rte values file)Os/OsTask_3Os/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​

  1. Under EcuMInstance, press "+" on RteModeMachineInstanceConfig.

    The + on RteModeMachineInstanceConfig

    Figure 8-7. ① Rte, ② RteModeMachineInstanceConfig under EcuMInstance, ③ +.

  2. In RteModeMachineQueueLength type 1 and press Tab.

  3. In RteSwcModeManagerRef pick PortInterface/ModeSwitch/EcuM_CurrentMode/currentMode.

  4. Select another tree node, then RteModeMachineInstanceConfig_0 again. Only now the Context Refs row appears. Pick SwComponentType/Atomic/Service/EcuM/currentMode (ABSTRACT-PROVIDED-PORT-PROTOTYPE).

    RteModeMachineInstanceConfig_0

    Figure 8-8. ① RteModeMachineInstanceConfig_0, ② RteModeMachineQueueLength, ③ RteSwcModeManagerRef, ④ Context Refs.

Os Activations​

  1. Press "+" on RteOsInteraction. It needs no values.

  2. Under it, press "+" on RteUsedOsActivation. In the new RteUsedOsActivation_0, enter the values of the table.

    RteUsedOsActivation_0

    Figure 8-9. ① RteUsedOsActivation_0, ② RteExpectedActivationOffset, ③ RteExpectedTickDuration, ④ RteActivationOsAlarmRef.

  3. Add _1 and _2 the same way from the table.

ContainerRteExpectedActivationOffsetRteExpectedTickDurationRteActivationOsAlarmRef
RteUsedOsActivation_000.01Os/OsAlarm_0
RteUsedOsActivation_100.01Os/OsAlarm_1
RteUsedOsActivation_200.01Os/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.

  1. Select RteBswModuleInstance_0 (from the Rte values file). Type BswModuleDescription/BswM/BswMImplementation in RteBswImplementationRef and press Tab.

  2. Select its RteBswExclusiveAreaImpl_0 (from the Rte values file). Set RteExclusiveAreaImplMechanism to ALL_INTERRUPT_BLOCKING. RteBswExclusiveAreaRef is already set.

    RteBswExclusiveAreaImpl_0

    Figure 8-10. ① RteBswExclusiveAreaImpl_0, ② RteExclusiveAreaImplMechanism, ③ RteBswExclusiveAreaRef (from the Rte values file).

  3. Complete _3, _4, _5 and _6 the same way from the table.

  4. Press "+" on RteBswModuleInstance. Type the EcuM path from the table in RteBswImplementationRef of RteBswModuleInstance_1 and press Tab.

  5. Press "+" on RteBswModuleInstance again.

    The + on RteBswModuleInstance

    Figure 8-11. ① Rte, ② RteBswModuleInstance, ③ +.

  6. Type BswModuleDescription/Can/CanImplementation in RteBswImplementationRef of RteBswModuleInstance_2 and press Tab.

    RteBswModuleInstance_2

    Figure 8-12. ① RteBswModuleInstance_2, ② RteBswImplementationRef.

  7. Press "+" on RteBswModuleInstance once more. The editor names it RteBswModuleInstance_7, because _3 to _6 are taken. Type the CanNm path from the table in its RteBswImplementationRef and press Tab.

InstanceOriginRteBswImplementationRef (typed)RteExclusiveAreaImplMechanism of RteBswExclusiveAreaImpl_0
RteBswModuleInstance_0Rte values fileBswModuleDescription/BswM/BswMImplementationALL_INTERRUPT_BLOCKING
RteBswModuleInstance_1"+"BswModuleDescription/EcuM/EcuMImplementation-
RteBswModuleInstance_2"+"BswModuleDescription/Can/CanImplementation-
RteBswModuleInstance_3Rte values fileBswModuleDescription/CanIf/CanIfImplementationALL_INTERRUPT_BLOCKING
RteBswModuleInstance_4Rte values fileBswModuleDescription/CanSM/CanSMImplementationALL_INTERRUPT_BLOCKING
RteBswModuleInstance_5Rte values fileBswModuleDescription/ComM/ComMImplementationALL_INTERRUPT_BLOCKING
RteBswModuleInstance_6Rte values fileBswModuleDescription/Com/ComImplementationALL_INTERRUPT_BLOCKING
RteBswModuleInstance_7"+"BswModuleDescription/CanNm/CanNmImplementation-

BSW Event Mappings​

RteBswEventIsMappedToTask has the same trap: "+" writes FALSE; press TRUE.

  1. Under RteBswModuleInstance_2, press "+" on RteBswEventToTaskMapping.

  2. Press TRUE at RteBswEventIsMappedToTask and type 4 in RteBswPositionInTask.

  3. Type BswModuleDescription/Can/Can/CanInternalBehavior/CanMainWriteTimingEvent in RteBswEventRef and press Tab.

  4. Pick Os/OsTask_0 in RteBswMappedToTaskRef and Os/OsAlarm_0 in RteBswUsedOsAlarmRef.

    RteBswModuleInstance_2/RteBswEventToTaskMapping_0

    Figure 8-13. ① RteBswEventToTaskMapping_0, ② RteBswEventIsMappedToTask, ③ RteBswPositionInTask, ④ RteBswEventRef, ⑤ RteBswMappedToTaskRef, ⑥ RteBswUsedOsAlarmRef.

  5. Add the other mappings the same way from the table. Every one is added with "+", has RteBswEventIsMappedToTask TRUE, RteBswMappedToTaskRef Os/OsTask_0 and RteBswUsedOsAlarmRef Os/OsAlarm_0.

  6. The last one is the main function of CanNm: under RteBswModuleInstance_7, press "+" on RteBswEventToTaskMapping, press TRUE, type 13 in RteBswPositionInTask and the CanNm event of the table in RteBswEventRef, and pick the task and alarm.

    RteBswModuleInstance_7/RteBswEventToTaskMapping_0

    Figure 8-14. ① RteBswEventToTaskMapping_0, ② RteBswEventIsMappedToTask, ③ RteBswPositionInTask, ④ RteBswEventRef, ⑤ RteBswMappedToTaskRef, ⑥ RteBswUsedOsAlarmRef.

  7. Save the module with Ctrl+S.

MappingRteBswPositionInTaskRteBswEventRef (typed)
RteBswModuleInstance_0/RteBswEventToTaskMapping_02BswModuleDescription/BswM/BswM/BswMInternalBehavior/BswMMainTimingEvent
RteBswModuleInstance_1/RteBswEventToTaskMapping_03BswModuleDescription/EcuM/EcuM/EcuMInternalBehavior/EcuMMainTimingEvent
RteBswModuleInstance_2/RteBswEventToTaskMapping_04BswModuleDescription/Can/Can/CanInternalBehavior/CanMainWriteTimingEvent
RteBswModuleInstance_2/RteBswEventToTaskMapping_15BswModuleDescription/Can/Can/CanInternalBehavior/CanMainReadTimingEvent
RteBswModuleInstance_2/RteBswEventToTaskMapping_26BswModuleDescription/Can/Can/CanInternalBehavior/CanMainModeTimingEvent
RteBswModuleInstance_2/RteBswEventToTaskMapping_37BswModuleDescription/Can/Can/CanInternalBehavior/CanMainBusOffTimingEvent
RteBswModuleInstance_2/RteBswEventToTaskMapping_48BswModuleDescription/Can/Can/CanInternalBehavior/CanMainWakeupTimingEvent
RteBswModuleInstance_4/RteBswEventToTaskMapping_09BswModuleDescription/CanSM/CanSM/CanSMInternalBehavior/CanSMMainTimingEvent
RteBswModuleInstance_5/RteBswEventToTaskMapping_010BswModuleDescription/ComM/ComM/ComMInternalBehavior/ComMMainFunctionTimingEvent_ComMChannel_0
RteBswModuleInstance_6/RteBswEventToTaskMapping_011BswModuleDescription/Com/Com/ComInternalBehavior/ComMainFunctionRxTimingEvent_ComMainFunctionRx
RteBswModuleInstance_6/RteBswEventToTaskMapping_112BswModuleDescription/Com/Com/ComInternalBehavior/ComMainFunctionTxTimingEvent_ComMainFunctionTx
RteBswModuleInstance_7/RteBswEventToTaskMapping_013BswModuleDescription/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. Com has one main function event per ComMainFunctionRx and ComMainFunctionTx container, so the event names end with the names of the two containers you add in Communication Configuration.
  • An instance for CanNm. CanNm has a main function, so PRTE requires its BSW module instance (RTE_BSW_INSTANCE_MISSING without it). Nm has 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. RteBswPositionInTask sets the call order of the BSW main functions inside OsTask_0.

Checklist​

  • Every RteEventToTaskMapping and RteBswEventToTaskMapping shows TRUE at its mapped-to-task flag.
  • RteBswModuleInstance_0 to _7 each have an RteBswImplementationRef.
  • RteModeMachineInstanceConfig_0 shows the Context Refs row filled.
  • The tab VehicleDesign:Configuration carries 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.