Skip to main content

PRTE Setup

What You Will Do​

In this chapter you prepare the ECU's BSW configuration (ECUC) in three steps.

  1. In the VFB ECU Configuration window, bring in the BSW modules with PRTE Platform Import, the network management modules CanNm and Nm included. This creates the module definitions and one empty configuration per module.
  2. In the ECU Configuration editor, set the start-up and hardware values of EcuM, BswM, Mcu and Det by hand. The design does not decide them; they are this ECU's own values.
  3. Import the Rte values file. It carries the six Rte references the property panel does not offer yet.

Caution. This tutorial does not use PRTE AUTO CONFIGURATION. You configure the BSW by hand in the ECU Configuration editor, module by module, so that you see and decide every value. Do not click PRTE AUTO CONFIGURATION, the PRTE Auto Configuration icon of the ECU Configuration editor or Auto-Generate, and do not apply the ECU Configuration window. They write BSW values from the design and would overwrite what you enter.

Before You Begin​

Caution. The file holds values for an ECU named ECU, the node ECU of the AUTOSAR System Tutorial. Do not rename the node.

WhereItemValue
PRTE Platform Import windowModule mapThe suggested selection, plus CanNm and Nm
ECU Configuration [ECU] windowClose with Esc
ECU Configuration editorEcuM, BswM, Mcu, DetThe tables below
Conflict Resolution windowModule DefinitionAll → Use Imported

Importing the BSW Modules​

  1. In the tab VehicleDesign:VFB, go inside the composition ECU. Click the ECU icon at the top right of the frame to open the ECU Configuration [ECU] window. Click PRTE Platform Import at its top right. Do not click PRTE AUTO CONFIGURATION next to it.

    The ECU Configuration window

    Figure 6-1. ① PRTE Platform Import.

  2. The PRTE Platform Import window shows a map of the BSW modules. The bright ones are selected already, from the design. The CAN stack is selected: Can, CanIf, LSduR, CanSM, ComM, Com and PduR. The network management modules CanNm and Nm are not. Click CanNm: Nm is selected with it, and the line at the bottom reads Selected CanNm, Nm. Leave the rest as it is and click Import. Nm is the module AUTOSAR calls the Network Management Interface (NmIf); PRTE names it Nm.

    The PRTE Platform Import window

    Figure 6-2. ① CanNm, ② Nm, ③ Import.

    Wait until the progress reaches Complete.

  3. Press Esc to close the ECU Configuration window. Do not press Ctrl+S in this window: there it applies the window. Closing with Esc writes nothing.

Note. The import also adds the composition PRTE_ECU with the BSW service components to the frame, and the interfaces and data types of the BSW modules, so the Interface and DataType editors now list many entries you did not create. Selecting CanNm and Nm adds only their definitions and empty configurations, no service component.

Opening the ECU Configuration Editor​

Click Configuration under MODULE. The ECU Configuration editor opens. The ECU list on the left shows the ECUs. The imported modules are under ECU. Their configurations are empty, except that Rte holds the SW-C pairs of the import.

The ECU Configuration editor

Figure 6-3. ① Configuration, ② EcuM, one of the modules of ECU.

At the right end of each ECU row are two icons, Add Module and PRTE Auto Configuration (the circular arrow). Do not click PRTE Auto Configuration.

The editor works the same way in every module of this chapter and of the chapters after it:

  • + at the right end of a row in the CONFIGURATION tree adds a container of that definition, with its default values, and selects it. Change only the values in the table. Type a number and press Tab; pick a reference from its list.
  • A bold name in the Container column is not the name + gives. Type it in Name in the panel and press Tab.
  • A reference whose target does not exist yet is not in its list. Type the path shown in the table and press Tab. Until the target exists the path is shown in yellow; a field that takes a list of references also adds (unresolved) to it.

Setting Up EcuM​

  1. Click EcuM in the list. The CONFIGURATION tree lists the container definitions of EcuM, all empty. Click + on the EcuMGeneral row. The editor adds EcuMGeneral and selects it.

    The EcuMGeneral row in the EcuM tree

    Figure 6-4. ① EcuM, ② the EcuMGeneral row, ③ +.

  2. In the panel on the right, click TRUE for EcuMDevErrorDetect and type 0.01 in EcuMMainFunctionPeriod. Leave EcuMVersionInfoApi at FALSE.

    The values of EcuMGeneral

    Figure 6-5. ① EcuMGeneral, ② EcuMDevErrorDetect, ③ EcuMMainFunctionPeriod, ④ EcuMVersionInfoApi.

  3. Add EcuMFlexGeneral, EcuMConfiguration and, under it, EcuMCommonConfiguration the same way, each with its values from the table. In EcuMCommonConfiguration, type Os/OSDEFAULTAPPMODE in EcuMDefaultAppMode and Os/RES_AUTOSAR_ECUM in EcuMOSResource. You create both in chapter 7, so both stay yellow until then, and Os/RES_AUTOSAR_ECUM carries (unresolved).

    The values of EcuMCommonConfiguration

    Figure 6-6. ① EcuMCommonConfiguration, ② EcuMIgnoreWakeupEvValOffPreOS, ③ EcuMDefaultAppMode, ④ EcuMOSResource.

  4. Under EcuMCommonConfiguration, add EcuMDriverInitListOne. Under it, click + on the EcuMDriverInitItem row.

    The EcuMDriverInitItem row under EcuMDriverInitListOne

    Figure 6-7. ① EcuM, ② the EcuMDriverInitItem row under EcuMDriverInitListOne, ③ +.

  5. The editor adds EcuMDriverInitItem_0. In Name, replace it with the name in the table, choose the EcuMModuleParameter of the table (POSTBUILD_PTR, for NmInit NULL_PTR) and pick the module for EcuMModuleRef. Add the items in the order of the table: it is the order in which EcuM initializes the drivers.

    The values of CanInit

    Figure 6-8. ① CanInit, ② Name, ③ EcuMModuleParameter, ④ EcuMModuleRef.

  6. Add the remaining containers from the table and save with Ctrl+S.

Container+ onValues
EcuMGeneralEcuMGeneralEcuMDevErrorDetect TRUE, EcuMMainFunctionPeriod 0.01
EcuMFlexGeneralEcuMFlexGeneralEcuMAlarmClockPresent FALSE, EcuMModeHandling TRUE, EcuMResetLoopDetection FALSE, EcuMSetProgrammableInterrupts FALSE
EcuMConfigurationEcuMConfigurationNone
EcuMConfiguration/EcuMCommonConfigurationEcuMCommonConfigurationEcuMDefaultAppMode Os/OSDEFAULTAPPMODE, EcuMOSResource Os/RES_AUTOSAR_ECUM
EcuMConfiguration/EcuMCommonConfiguration/EcuMDefaultShutdownTargetEcuMDefaultShutdownTargetEcuMDefaultShutdownTarget EcuMShutdownTargetOff, EcuMDefaultResetModeRef EcuM/EcuMConfiguration/EcuMFlexConfiguration/McuReset, EcuMDefaultSleepModeRef EcuM/EcuMConfiguration/EcuMCommonConfiguration/Halt
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListZeroEcuMDriverInitListZeroNone
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListZero/DetInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/Det
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOneEcuMDriverInitListOneNone
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/McuInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/Mcu
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/BswMPreInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/BswM
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/CanInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/Can
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/CanIfInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/CanIf
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/LSduRInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/LSduR
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/PduRInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/PduR
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/ComInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/Com
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/CanNmInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/CanNm
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/NmInitEcuMDriverInitItemEcuMModuleParameter NULL_PTR, EcuMModuleRef ECU/Nm
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/ComMInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/ComM
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverInitListOne/CanSMInitEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/CanSM
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverRestartListEcuMDriverRestartListNone
EcuMConfiguration/EcuMCommonConfiguration/EcuMDriverRestartList/DetRestartEcuMDriverInitItemEcuMModuleParameter POSTBUILD_PTR, EcuMModuleRef ECU/Det
EcuMConfiguration/EcuMCommonConfiguration/PowerEcuMPredefinedWakeupSourceEcuMPredefinedWakeupSource POWER, EcuMResetReasonRef Mcu/McuPublishedInformation/PowerOn
EcuMConfiguration/EcuMCommonConfiguration/ResetEcuMPredefinedWakeupSourceEcuMPredefinedWakeupSource RESET, EcuMResetReasonRef Mcu/McuPublishedInformation/Software
EcuMConfiguration/EcuMCommonConfiguration/WakeupTimerEcuMWakeupSourceEcuMWakeupSourceId 5, EcuMValidationTimeout 0.02, EcuMCheckWakeupTimeout 0.05, EcuMWakeupSourcePolling FALSE
EcuMConfiguration/EcuMCommonConfiguration/HaltEcuMSleepModeEcuMSleepModeId 0, EcuMSleepModeSuspend TRUE, EcuMSleepModeMcuModeRef Mcu/McuModuleConfiguration/Sleep, EcuMWakeupSourceMask EcuM/EcuMConfiguration/EcuMCommonConfiguration/WakeupTimer
EcuMConfiguration/EcuMCommonConfiguration/PollEcuMSleepModeEcuMSleepModeId 1, EcuMSleepModeSuspend FALSE, EcuMSleepModeMcuModeRef Mcu/McuModuleConfiguration/Normal, EcuMWakeupSourceMask EcuM/EcuMConfiguration/EcuMCommonConfiguration/WakeupTimer
EcuMConfiguration/EcuMFlexConfigurationEcuMFlexConfigurationEcuMNormalMcuModeRef Mcu/McuModuleConfiguration/Normal
EcuMConfiguration/EcuMFlexConfiguration/McuResetEcuMResetModeEcuMResetModeId 0
EcuMConfiguration/EcuMFlexConfiguration/VecuMasterEcuMFlexUserConfigEcuMFlexUser 0
EcuMConfiguration/EcuMFlexConfiguration/GoDownUsersEcuMGoDownAllowedUsersEcuMGoDownAllowedUserRef EcuM/EcuMConfiguration/EcuMFlexConfiguration/VecuMaster
EcuMConfiguration/EcuMFlexConfiguration/SupervisionFaultEcuMShutdownCauseEcuMShutdownCauseId 4

Setting Up BswM​

BswM starts the RTE once EcuM reports RUN: a mode request port watches the state of EcuM, a condition compares it with ECUM_STATE_RUN, and a rule runs the action list that starts the RTE.

  1. Click BswM in the list. Add BswMGeneral and enter its values from the table.

    The values of BswMGeneral

    Figure 6-9. ① BswMGeneral, ② to ⑯ its values. Click TRUE where the table says TRUE, type 0.01 in BswMMainFunctionPeriod and leave the others as they are.

  2. Add the containers of BswMConfig in the order of the table. A rule names its expression and its action list; the action list AlRteStart comes after the rule in the table, so type its path.

    The values of RuleRteStart

    Figure 6-10. ① RuleRteStart, ② Name, ③ BswMRuleInitState, ④ BswMNestedExecutionOnly, ⑤ BswMRuleExpressionRef, ⑥ BswMRuleTrueActionList.

  3. Save with Ctrl+S.

Container+ onValues
BswMGeneralBswMGeneralBswMDevErrorDetect TRUE, BswMVersionInfoApi TRUE, BswMMainFunctionPeriod 0.01, BswMEcuMEnabled TRUE, BswMGenericRequestEnabled TRUE, BswMCanSMEnabled TRUE, BswMComMEnabled TRUE, BswMNmEnabled TRUE
BswMGeneral/BswMUserIncludeFilesBswMUserIncludeFilesBswMUserIncludeFile EcuM.h
BswMConfigBswMConfigNone
BswMConfig/BswMArbitrationBswMArbitrationNone
BswMConfig/BswMArbitration/EcuMCurrentStateBswMModeRequestPortBswMRequestProcessing BSWM_IMMEDIATE
BswMConfig/BswMArbitration/EcuMCurrentState/BswMModeRequestSourceBswMModeRequestSourceNone
BswMConfig/BswMArbitration/EcuMCurrentState/BswMModeRequestSource/EcuMStateBswMEcuMIndicationNone
BswMConfig/BswMArbitration/CondEcuMStateRunBswMModeConditionBswMConditionType BSWM_EQUALS, BswMConditionMode BswM/BswMConfig/BswMArbitration/EcuMCurrentState
BswMConfig/BswMArbitration/CondEcuMStateRun/BswMConditionValueBswMConditionValueNone
BswMConfig/BswMArbitration/CondEcuMStateRun/BswMConditionValue/ValueBswMBswModeBswMBswRequestedMode ECUM_STATE_RUN
BswMConfig/BswMArbitration/ExprEcuMRunBswMLogicalExpressionBswMArgumentRef BswM/BswMConfig/BswMArbitration/CondEcuMStateRun
BswMConfig/BswMArbitration/RuleRteStartBswMRuleBswMRuleInitState BSWM_UNDEFINED, BswMRuleExpressionRef BswM/BswMConfig/BswMArbitration/ExprEcuMRun, BswMRuleTrueActionList BswM/BswMConfig/BswMModeControl/AlRteStart
BswMConfig/BswMModeControlBswMModeControlNone
BswMConfig/BswMModeControl/RteStartBswMActionNone
BswMConfig/BswMModeControl/RteStart/BswMAvailableActionsBswMAvailableActionsNone
BswMConfig/BswMModeControl/RteStart/BswMAvailableActions/KindBswMRteStartNone
BswMConfig/BswMModeControl/AlRteStartBswMActionListBswMActionListExecution BSWM_TRIGGER
BswMConfig/BswMModeControl/AlRteStart/Item0BswMActionListItemBswMActionListItemIndex 0, BswMAbortOnFail TRUE, BswMActionListItemRef BswM/BswMConfig/BswMModeControl/RteStart

Setting Up Mcu and Det​

  1. Click Mcu in the list and add its containers from the table. CoreClock is the clock the CAN driver refers to in chapter 9.

    The values of CoreClock

    Figure 6-11. ① CoreClock, ② Name, ③ McuClockReferencePointFrequency.

  2. Click Det in the list and add DetGeneral.

  3. Save with Ctrl+S.

Container+ onValues
McuGeneralConfigurationMcuGeneralConfigurationMcuDevErrorDetect TRUE, McuGetRamStateApi TRUE, McuNoPll FALSE, McuPerformResetApi TRUE, McuVersionInfoApi TRUE
McuModuleConfigurationMcuModuleConfigurationMcuClockSrcFailureNotification DISABLED, McuNumberOfMcuModes 2, McuRamSectors 1, McuResetSetting 1
McuModuleConfiguration/DefaultMcuClockSettingConfigMcuClockSettingId 0
McuModuleConfiguration/Default/CoreClockMcuClockReferencePointMcuClockReferencePointFrequency 100000000
McuModuleConfiguration/NormalMcuModeSettingConfMcuMode 0, McuLowPowerMode FALSE
McuModuleConfiguration/SleepMcuModeSettingConfMcuMode 1, McuLowPowerMode TRUE
McuModuleConfiguration/Sector0McuRamSectorSettingConfMcuRamDefaultValue 0, McuRamSectionBaseAddress 0, McuRamSectionSize 256
McuPublishedInformationMcuPublishedInformationNone
McuPublishedInformation/PowerOnMcuResetReasonConfMcuResetReason 0
McuPublishedInformation/SoftwareMcuResetReasonConfMcuResetReason 2
Container+ onValues
DetGeneralDetGeneralDetVersionInfoApi TRUE

Importing the Rte Values File​

Six references of Rte cannot be entered in the property panel yet: their lists do not offer the target, and a typed path is not kept.

ContainerReferenceTarget
BswMInstance/RteEventToTaskMapping_0RteEventRefThe BswM poll event BswMPollTiming
RteBswModuleInstance_0, _3, _4, _5, _6 (BswM, CanIf, CanSM, ComM, Com), each RteBswExclusiveAreaImpl_0RteBswExclusiveAreaRefThe module's BSW exclusive area

The Rte values file brings these containers with their references. Importing Rte replaces its configuration whole, so the file also carries the SW-C type and instance pairs that PRTE Platform Import created; otherwise the import would remove them.

  1. Click the Import icon in the DESIGN header of the EDITOR view.

    The Import icon in the DESIGN header

    Figure 6-12. ① Import.

  2. Choose the saved file VehicleDesign_Rte.arxml in the file dialog. The Conflict Resolution window opens with Rte, the one module of the file. The button at the bottom right reads Resolve 0/1. Click Module Definition on the left, then All → Use Imported. When the button reads Resolve 1/1, click it.

    The Conflict Resolution window

    Figure 6-13. ① Module Definition, ② All → Use Imported, ③ Resolve 1/1.

    The message Import complete appears at the bottom right, with 1 replaced under it. You complete the Rte containers in chapter 8.

Why Is It Designed This Way?​

  • No AUTO CONFIGURATION. Every BSW value comes from you, so each one is visible in the editor. Configured this way from an empty project, validation reports no issues and PRTE generates the code of 15 modules with no errors.
  • Platform Import is not configuration. It creates the module definitions, empty configurations and the BSW service components. It sets no BSW value.
  • The five modules PRTE requires. PRTE needs the configuration of Os, Rte, EcuM, BswM and Mcu to generate code. If any one is empty, generation stops with MANDATORY_MODULE_MISSING.
  • The Rte values file is temporary. It holds only the six references the property panel does not offer yet, and the SW-C pairs the import would otherwise remove. Once the panel offers those targets, you enter the references in chapter 8 like every other value.
  • Network management at start-up. BswMNmEnabled and the items CanNmInit and NmInit serve the start-up of network management at run time; PRTE does not require them to generate code. CanNm and Nm need no exclusive area reference: neither has a BSW exclusive area that PRTE requires.

Checklist​

  • The composition PRTE_ECU is inside the frame.
  • EcuM shows EcuMConfiguration, EcuMFlexGeneral and EcuMGeneral, and EcuMDriverInitListOne holds the eleven items from McuInit to CanSMInit.
  • BswM holds RuleRteStart and AlRteStart.
  • The message Import complete with 1 replaced appeared.
  • The tab VehicleDesign:Configuration carries no modified mark.

Next Step​

In Os Configuration you create the tasks, alarms and counter of Os by hand.