4 - CodingClassic_IntegrationManuals

Coding Classic Integration Manual
Project
BMW AUTOSAR 4 Core Rel. 3
Author
BMW AG
Release Date
2017-12-14
Version
5.2.1
Status
Release
Hotline
+49 89 382 - 32233
Contact
bac@bmw.de
https://asc.bmw.com/jira/browse/BSUP (extern)
https://asc.bmwgroup.net/jira/browse/BSUP (intern)
Revision History
VersionDateDescription5.2.1
2017-12-14
Version Update
5.2.0
2017-11-09
Version Update
5.1.0
2017-10-12
Version Update
5.0.1
2017-09-14
Version Update
5.0.0
2017-06-08
Initial version for SP2021
CompanyBayerische
Motoren Werke
Aktiengesellschaft
Postal addressBMW AG
80788 München
Office addressForschungs- und
Innovationszentrum
(FIZ)
Hufelandstr. 1
80937 München
TelephoneSwitchboard
+49 89 382-0
Internetwww.bmwgroup.com
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 1 of 23
 Table of Contents1 Introduction41.1General
Table of Contents1 Introduction41.1General4
1.2Functional overview4
2 Related documentation53 Limitations64 Software Architecture74.1Dependencies on AUTOSAR modules7
4.1.1NvM7
4.1.2Dem7
4.1.3Dcm7
4.1.4Com7
4.1.5Det7
4.1.6RTE7
4.1.7BswM7
4.2Dependencies to other modules8
4.2.1Dlog8
4.2.2Vin8
4.2.3Other SWC8
5 Integration95.1Configuration of other Modules9
5.1.1NvM9
5.1.2Dem9
5.1.3Dcm10
5.1.3.1DiagnosticSession10
5.1.3.2DiagnosticSessionControl10
5.1.3.3RoutineControl11
5.1.3.4ReadDataByIdentifier12
5.1.3.5DiagnosticSessionControl14
5.1.3.6Service Request Manufacturer Notification15
5.1.4Com15
5.1.5Det15
5.1.6BswM15
5.2Configuration of generic part16
5.2.1CodingCrypto16
5.2.1.1CryptoLib16
5.2.1.2Csm16
5.2.2CodingGeneral16
5.2.2.1CodingDevErrorDetect16
5.2.2.2CodingSignatureSize17
5.2.2.3CodingCryptoEnable17
5.2.2.4CodingProdErrorCEUDDetection17
5.2.2.5CodingConditionCheck17
5.2.2.6CodingReceiveBufferSize17
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 2 of 23
 5.2.2.7CodingSendBufferSize
5.2.2.7CodingSendBufferSize18
5.2.3CodingArea18
5.2.3.1CodingAreaDefVal18
5.3Configuration of adapter part20
5.3.1CodingClassicGeneral20
5.3.1.1CodingCycleTime20
5.3.1.2Other Application SWC20
5.3.2Event Mapping21
5.3.3Data Mapping21
5.3.4Exclusive Areas21
5.4Software Integration22
5.4.1Startup/Initialization22
5.4.2Normal Operation22
5.4.3Shutdown/Deactivation22
5.4.4SWCD22
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 3 of 23
 1Introduction
1IntroductionThe Coding system consists of a Coding module that is part of the ECU application and the Coder.
Almost in the same manner as the Bootloader programs the ROM of an ECU, the Coding module codes
the NV memory of an ECU with vehicle specific data derived from the vehicle description document e.g.
type key, extra equipment, country specifics, year of model/construction stage, additional comments or
service upgrade options.
GeneralFor a general introduction to the BAC4/aBAC Modules please refer to 
[1].This document only describes topics related to the Coding BAC4/aBAC Module.
This Integration Manual describes the basis functionality, API and the configuration of the BMW system
function Coding.
Functional overviewThe Coding module implements the coding process that is part of the vehicle programming process. It
provides functions to the application to read coded data stored in the NV memory. If the NV memory
contains no valid data default values are provided. The coded data in NV memory can only be changed via
a diagnostic coding session.
The Coding module provides the following functionalities:
Manages coding data stored in NV memory
Provides read/write access via a special UDS diagnostics Session to the Coder
Provides read only access via API to the ECU application
Informs the ECU application about its current status
Performs signature checks over the Coding data
Restores safe default values in case of errors
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 4 of 23
 2Related documentationReferences
2Related documentationReferences[1] BAC4 General Concept for the Module Integration
BAC4_General_Concepts_for_the_Module_Integration.pdf
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 5 of 23
 3Limitations
3LimitationsThe Coding module supports only one asymmetric key to calculate the signature for all Coding areas.
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 6 of 23
 4Software ArchitectureDependencies on AUTOSAR modules
4Software ArchitectureDependencies on AUTOSAR modulesThe current version of the Module Coding depends on the following BSW modules:
NvMThe Coding module uses the NVM to read Coding data from NV memory and to write it back.
DemThe Coding module uses the DEM API to report critical events and write error memory entries.
DcmThe Coding module uses the DCM to communicate with the Coder by sending and receiving diagnostic
UDS messages via CAN, FlexRay, etc.
ComThe Coding module use signals from COM to get the Vehicle Speed.
DetThe Coding module optionally reports development errors to the Det.
RTEAs a software component, the Coding module uses Rte client/server and sender/receiver communication
to communicate with other SWCs and BSW modules.
BswMThe Coding receives and requests mode switches from the BswM to switch the current Coding
operational mode. It further receives a mode switch from the BswM when the active diagnostic session
has changed and when the bus communication status has changed.
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 7 of 23
 Dependencies to other modulesDlog
Dependencies to other modulesDlogThe Dlog module is used to obtain the information during startup if the control unit has been coded after
flash programming.
VinThe Vin module is used to obtain the current bus VIN.
Other SWCThe Coding optionally calls another Application Software Component to perform a plausibility check of
the net coding data received during the coding data transaction if implausible net coding data can lead to
safety-critical states of the control unit.
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 8 of 23
 5IntegrationConfiguration of other Modules
5IntegrationConfiguration of other ModulesThe following modules shall be configured, before this module can be generated, compiled and linked.
NvMThe NVRAM Manager shall be configured to hold one NVRAM block. The following parameters have to
be configured:
a container "`NvMBlockDescriptor"' with
NvmNvBlockLength: "`see CODING_DATA_SIZE in generated Coding_Cfg.h"'
NvmBlockCRCType: e.g. NVM_CRC16
NvMBlockUseCrc: true
NvMCalcRamBlockCrc: false
NvmBlockManagementType: NVM_BLOCK_NATIVE
NvmRamBlockDataAddress: &Coding_CodingData
NvmRomBlockDataAddress: &Coding_CodingDataDefault
NvmSelectBlockForReadAll: true
NvmSelectBlockForWriteAll: false
This NVRAM block needs
Port and Port Interface for service ports
Port and Port Interface for single block job end notifications
This NVRAM block will be used to store Coding data and will be written on Coding process.
DemThe Coding module reports different errors to the DEM. The DEM shall be configured to provide the
following Errors (aging/healing is disabled for all DTCs):
CODING_EVENT_NOT_CODED
Description: No valid Coding data is available and default values are used.
Annotation: A Clear Event Allowed port shall be configured via Rte
DTC Class
∗ DemUdsDtc: 0x20000 + 0x100 * ECU_Address + 0x08
∗ DemDTCSeverity: DEM_DTC_SEV_NO_SEVERITY
Event
∗ DemEventKind: DEM_EVENT_KIND_SWC
∗ DemEventDestination: DEM_DTC_ORIGIN_PRIMARY_MEMORY
CODING_EVENT_WRONG_VEHICLE
Description: CPS and VIN do not match.
DTC Class
∗ DemUdsDtc: 0x20000 + 0x100 * ECU_Address + 0x09
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 9 of 23

∗ DemDTCSeverity: DEM_DTC_SEV_NO_SEVERITY
Event
∗ DemEventKind: DEM_EVENT_KIND_SWC
∗ DemEventDestination: DEM_DTC_ORIGIN_PRIMARY_MEMORY
CODING_EVENT_UNQUALIFIED_DATA
Description: CPS-VIN comparison has not been done.
Annotation: Error entry depends on configuration parameter "`CodingProdErrorCEUDDetection"'
DTC Class
∗ DemUdsDtc: 0x20000 + 0x100 * ECU_Address + 0x0A
∗ DemDTCSeverity: DEM_DTC_SEV_NO_SEVERITY
Event
∗ DemEventKind: DEM_EVENT_KIND_SWC
∗ DemEventDestination: DEM_DTC_ORIGIN_PRIMARY_MEMORY
DcmDiagnosticSessionThe writing of net coding data into a control unit must only be possible, if the control unit is in the
CodingSession.
The following parameters have to be configured:
a container "`DcmDspSessionRow"' with
DcmDspSessionForBoot: DCM_NO_BOOT
DcmDspSessionLevel: 65 (0x41)
DcmDspSessionP2ServerMax: 
[IM_CodingClassic_001] dc
(DK_T3_266)
DcmDspSessionP2StarServerMax: 5.0
DiagnosticSessionControl[IM_CodingClassic_002] dThe Diagnostic Session Control service is used for changing codable control
units into the Extended Diagnostic Session, the Coding Session and the Default Session. c
(COD_268)[IM_CodingClassic_003] dThe following parameters have to be configured: c
(COD_269, COD_272,
COD_276, COD_280)a container "`DcmDsdService"' with
DcmDsdSidTabServiceId: 0x10
∗ a container "`DcmDsdSubService"' with
· DcmDsdSubServiceId: 0x01
· DcmDsdSubServiceSessionLevelRef: DEFAULT_SESSION
· DcmDsdSubServiceSessionLevelRef: EXTENDED_SESSION
· DcmDsdSubServiceSessionLevelRef: CODING_SESSION
· DcmDsdSubServiceId: 0x03
· DcmDsdSubServiceSessionLevelRef: DEFAULT_SESSION
· DcmDsdSubServiceSessionLevelRef: EXTENDED_SESSION
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 10 of 23

· DcmDsdSubServiceId: 0x41
· DcmDsdSubServiceSessionLevelRef: EXTENDED_SESSION
· DcmDsdSubServiceSessionLevelRef: CODING_SESSION
RoutineControl[IM_CodingClassic_004] dThe Routine Control service is used for reading, writing and verifying net
coding data. c
(COD_289)Reading of net coding data from control unit (0x31 0x01 0x37 0xFC)[IM_CodingClassic_005] dThis request has a variable response length. The following parameters have
to be configured: c
(COD_292, COD_294)a container "`DcmDspRoutine"' with
DcmDspRoutineIdentifier: 0x37FC
DcmDspRoutineUsePort: TRUE
a container "`DcmDspRoutineInfo"' and "`DcmDspStartRoutineIn"' with
a "`StartRoutineInSignal"' with
∗ DcmDspRoutineSignalLength: 48 bits
∗ DcmDspRoutineSignalPos: 0
∗ DcmDspRoutineSignalType: UINT8
a "`StartRoutineOutSignal"' with
∗ DcmDspRoutineSignalLength: max. diagnostic buffer size (e.g. 8192 bits)
∗ DcmDspRoutineSignalPos: 0
∗ DcmDspRoutineSignalType: VARIABLE_LENGTH
Writing of net coding data from control unit (0x31 0x01 0x37 0xFD)[IM_CodingClassic_006] dThis request has a variable request length. The following parameters have
to be configured: c
(COD_297, COD_299)a container "`DcmDspRoutine"' with
DcmDspRoutineIdentifier: 0x37FD
DcmDspRoutineUsePort: TRUE
a container "`DcmDspRoutineInfo"' and "`DcmDspStartRoutineIn"' with
a "`StartRoutineInSignal"' with
∗ DcmDspRoutineSignalLength: max. diagnostic buffer size (e.g. 8192 bits)
∗ DcmDspRoutineSignalPos: 0
∗ DcmDspRoutineSignalType: VARIABLE_LENGTH
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 11 of 23
 Verification of net coding data from control unit (0x31 0x01 0x37 0xFE)[IM_CodingClassic_007]
Verification of net coding data from control unit (0x31 0x01 0x37 0xFE)[IM_CodingClassic_007] dThe following parameters have to be configured: c
(COD_302, COD_304)a container "`DcmDspRoutine"' with
DcmDspRoutineIdentifier: 0x37FE
DcmDspRoutineUsePort: TRUE
a container "`DcmDspRoutineInfo"' and "`DcmDspStartRoutineIn"' with
a "`StartRoutineInSignal"' with
∗ DcmDspRoutineSignalLength: 144 bits
∗ DcmDspRoutineSignalPos: 0
∗ DcmDspRoutineSignalType: UINT8
a "`StartRoutineOutSignal"' with
∗ DcmDspRoutineSignalLength: 8 bits
∗ DcmDspRoutineSignalPos: 0
∗ DcmDspRoutineSignalType: UINT8
ReadDataByIdentifier[IM_CodingClassic_008] dThe Read Data By Identifier service is used in conjunction with coding for
the following request to the control unit:
Determining the value of the coding proof stamp (CPS)
Determining the current session status (reading ActiveSessionState)
Determining the current session
Determining the protocol data (transport buffer sizes, coding area count and lengths)
c
(COD_289)Read coding proof stamp (CPS) (0x22 0x37 0xFE)Reading out the coding proof stamp (CPS) from the control unit.
[IM_CodingClassic_009] dThe following parameters have to be configured: c
(COD_314, COD_316)a container "`DcmDspDataInfo"' with
DcmDspDataFixedLength: TRUE
a container "`DcmDspData"' with
DcmDspDataConditionCheckReadFncUsed: TRUE
DcmDspDataInfoRef: reference to the "`DcmDspDataInfo"' container configured before.
DcmDspDataSize: 144 bits
DcmDspDataType: UINT8_N
DcmDspDataUsePort: USE_DATA_SYNCH_CLIENT_SERVER
a container "`DcmDspDidInfo"' with
only read-access
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 12 of 23

DcmDspDidReadSessionRef: CODING_SESSION, EXTENDED_SESSION, DEFAULT_SESSION
a container "`DcmDspDid"' with
DcmDspDidIdentifier: 0x37FE
one DID Signal "`DcmDspDidSignal"' with Data Position = 0 and a Data Reference to the
"`DcmDspData"' container configured before.
Read status of the active Session (0x22 0xF1 0x00)Reading out the status of the ActiveSessionState from the control unit.
[IM_CodingClassic_010] dThe following parameters have to be configured: c
(COD_319, COD_321)a container "`DcmDspDataInfo"' with
DcmDspDataFixedLength: TRUE
a container "`DcmDspData"' with
DcmDspDataConditionCheckReadFncUsed: TRUE
DcmDspDataInfoRef: reference to the "`DcmDspDataInfo"' container configured before.
DcmDspDataSize: 32 bits
DcmDspDataType: UINT8_N
DcmDspDataUsePort: USE_DATA_SYNCH_CLIENT_SERVER
a container "`DcmDspDidInfo"' with
only read-access
DcmDspDidReadSessionRef: CODING_SESSION, EXTENDED_SESSION, DEFAULT_SESSION
a container "`DcmDspDid"' with
DcmDspDidIdentifier: 0xF100
one DID Signal "`DcmDspDidSignal"' with Data Position = 0 and a Data Reference to the
"`DcmDspData"' container configured before.
Read active session (0x22 0xF1 0x86)Reading out of the ActiveSession from the control unit.
[IM_CodingClassic_011] dThe following parameters have to be configured: c
(COD_324, COD_326)a container "`DcmDspDataInfo"' with
DcmDspDataFixedLength: TRUE
a container "`DcmDspData"' with
DcmDspDataConditionCheckReadFncUsed: TRUE
DcmDspDataInfoRef: reference to the "`DcmDspDataInfo"' container configured before.
DcmDspDataSize: 8 bits
DcmDspDataType: UINT8_N
DcmDspDataUsePort: USE_DATA_SYNCH_FNC
a container "`DcmDspDidInfo"' with
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 13 of 23

only read-access
DcmDspDidReadSessionRef: CODING_SESSION, EXTENDED_SESSION, DEFAULT_SESSION
a container "`DcmDspDid"' with
DcmDspDidIdentifier: 0xF186
one DID Signal "`DcmDspDidSignal"' with Data Position = 0 and a Data Reference to the
"`DcmDspData"' container configured before.
Read protocol data (0x22 0x37 0xFF)Reading of the protocol data from the control unit.
[IM_CodingClassic_012] dThe following parameters have to be configured: c
(COD_329, COD_331)a container "`DcmDspDataInfo"' with
DcmDspDataFixedLength: TRUE
a container "`DcmDspData"' with
DcmDspDataConditionCheckReadFncUsed: TRUE
DcmDspDataInfoRef: reference to the "`DcmDspDataInfo"' container configured before.
DcmDspDataSize: 72 bits
DcmDspDataType: UINT8_N
DcmDspDataUsePort: USE_DATA_SYNCH_CLIENT_SERVER
a container "`DcmDspDidInfo"' with
only read-access
DcmDspDidReadSessionRef: CODING_SESSION, EXTENDED_SESSION, DEFAULT_SESSION
a container "`DcmDspDid"' with
DcmDspDidIdentifier: 0x37FF
one DID Signal "`DcmDspDidSignal"' with Data Position = 0 and a Data Reference to the
"`DcmDspData"' container configured before.
DiagnosticSessionControl[IM_CodingClassic_013] dThe ECUReset service is used in order to prompt a control unit to exit the
CodingSession following successfully completed coding. c
(COD_338)[IM_CodingClassic_014] dThe following parameters have to be configured: c
(COD_341, COD_343)a container "`DcmDsdService"' with
DcmDsdSidTabServiceId: 0x11
∗ a container "`DcmDsdSubService"' with
· DcmDsdSubServiceId: 0x01
· DcmDsdSubServiceSessionLevelRef: DEFAULT_SESSION
· DcmDsdSubServiceSessionLevelRef: EXTENDED_SESSION
· DcmDsdSubServiceSessionLevelRef: CODING_SESSION
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 14 of 23
 Service Request Manufacturer Notification
Service Request Manufacturer NotificationA Coding Service Request Manufacturer Notification shall be configured in the container
"DcmDslServiceRequestManufacturerNotification". The Mapping to the Coding module is done by
connecting the corresponding ports.
ComThe communication stack has to be configured for the reception and sending of bus messages. The
following PDUs/Signals are expected to be present in the Com stack after import of the BMW BNE export
(CodingSample):
Speed Signal (Rx) - CAN
Shortname: V_VEH
Length: 5 Bytes
Signal: V_VEH_COG
Signal Size: 16 Bits
Startbit Position: 16
Speed Signal (Rx) - Ethernet
Service Interface ID: 0x7533
Service: SpeedAcceleration
Ereignis/Field: VehicleSpeedAndDrivingCondition
Parameter/Strukturelement: speedVehicleCentreOfGravity
Important Note: For integration of the CodingSample module in an ECU, which is connected to Ethernet
as "`System Bus"' there is an adaption to make (S/R-interface and code). A new implementation data type
has to be created e.g. "`CodingSample_VehicleSpeedAndDrivingRecordType"' and the existing
S/R-interface "`Coding_VehicleSpeedInterface"' must refer this new data implementation type.
Furthermore the provided function "`CodingSample_VehicleSpeedReceiveHandler()"' must be modified
to access the desired parameter of the new structure.
DetThe DET shall be configured to provide development Errors. These errors are application programmer
specific.
BswMThe BswM has to provide:
BswMModeRequestPort "`LifeCycle"' to receive mode switch notifications of the
ModeDeclarationGroup "`Coding_LifeCycle"' from Coding
BswMRteModeRequestPort "`LifeCycleRequest"' to request modes of the ModeDeclarationGroup
"`Coding_LifeCycle"'
BswMRules to request the Coding life cycle mode
BswMRules to switch the Coding BusCom-Mode
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 15 of 23

BswMRules to switch the Coding Session-Mode
Configuration of generic partCodingCryptoThis container contains the configuration (parameters) of the crypto part of the Coding module.
CryptoLibChoose this container to use the BMW crypto library for crypto operations.
CsmChoose this container to use the AUTOSAR Csm for crypto operations.
CodingHashSizeThis parameter defines the size of the hash depending on the Hash Method.
The Coding module supports the following hash algorithm
SHA-256 - length 32 bytes
SHA-384 - length 43 bytes
SHA-512 - length 64 bytes
CodingGeneralThis container contains the configuration parameters of the generic part of the Coding module.
CodingDevErrorDetectThis parameter activates/deactivates the Development Error Detection and Notification.
If set to true: Development Error Detection and Notification is activated.
If set to false: Development Error Detection and Notification is deactivated.
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 16 of 23
 CodingSignatureSize[IM_Coding_001]
CodingSignatureSize[IM_Coding_001] dThis parameter defines the size of the net Coding Data Signature depending on the
Signature Method. c
(COD_147, COD_148)The Coding module supports the following asymmetric keys
RSA key length 2048 bit
RSA key length 3072 bit
RSA key length 4096 bit
ECC key length 256 bit
ECC key length 384 bit
ECC key length 521 bit
CodingCryptoEnableThis parameter activates/deactivates the Service to check net Coding Data Signature.
If set to true: Service to check net Coding Data Signature is activated.
If set to false: Service to check net Coding Data Signature is deactivated.
CodingProdErrorCEUDDetection[IM_Coding_002] dThis parameter activates/deactivates the Production Error "`Coding Event
Unqualified Data"' (CEUD) Detection and Reporting. c
(COD_114, COD_138)If set to true: Production Error CEUD Detection and Report is activated.
If set to false: Production Error CEUD Detection and Report is deactivated.
CodingConditionCheck[IM_Coding_003] dThis parameter activates/deactivates the Coding Ability due to Operating Conditions
Detection e.g. car is being driven or engine is running. c
(COD_060)If set to true: Operating Conditions Detection is activated.
If set to false: Operating Conditions Detection is deactivated.
CodingReceiveBufferSize[IM_Coding_004] dThis parameter defines the size of the Coding Receive Buffer (Rx) of Control Unit in
Bytes. c
(COD_171)CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 17 of 23
 CodingSendBufferSize[IM_Coding_005]
CodingSendBufferSize[IM_Coding_005] dThis parameter defines the size of the Coding Send Buffer (Tx) of Control Unit in
Bytes. c
(COD_171)CodingArea[IM_Coding_006] dThis container contains the default value for unused bits and all user configurable
functions of this Coding area. c
(COD_097)CodingAreaDefValThis parameter defines the Default Value for Unused Bits in the Coding Area.
The Coding module supports the following default values
AllBitsZero (0x00)
AllBitsOne (0xFF)
CodingFunctionThis container contains one or more Coding Functions.
CodingFunctionStartByteThis parameter contains the Startbyte of the Coding Function Value within the User Configurable Data.
CodingFunctionEndByteThis parameter contains the Endbyte of the Coding Function Value within the User Configurable Data.
CodingFunctionMaskThis parameter contains the Mask of the Coding Function Value within the User Configurable Data.
CodingFunctionApplTypeThis parameter defines the Function Type of the Coding Function Value towards the Application.
The Coding module supports the following types
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 18 of 23

boolean
bytearray
uint8
uint16
uint32
uint64
sint8
sint16
sint32
sint64
float32
float64
CodingFunctionDataCheck[IM_Coding_007] dThis parameter activates/deactivates the Coding Function Value Check. Control
Units must perform a Plausibility Check of the Net Coding Data received during the Coding Data
Transaction if implausible Net Coding Data can lead to safety-critical states of the Control Unit.
c
(COD_227)If set to true: Coding Function Value Check is activated.
If set to false: Coding Function Value Check is deactivated.
CodingFunctionTransformationRuleThis parameter defines the Transformation Rule for the Coding Function Value from Non Volatile Memory
to the User Interface (Application). This Rule shall be configured as a Simple C Operation e.g. "`+10"' or
"`*2"'.
CodingFunctionLowerLimitThis parameter defines the Lower Limit for the Coding Function Value passed to the User Interface
(Application).
CodingFunctionUpperLimitThis parameter defines the Upper Limit for the Coding Function Value passed to the User Interface
(Application).
CodingFunctionNvramTypeThis container defines the Function Type of the Coding Function Value in Non Volatile Memory.
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 19 of 23

The Coding module supports the following types
boolean
bytearray
uint8
uint16
uint32
uint64
sint8
sint16
sint32
sint64
float32
float64
Choose the desired container to defines the Function Type of the Coding Function Value in Non Volatile
Memory
CodingFunctionDefaultValue
This parameter contains the Default Value of the Coding Function within the User Configurable Data.
Configuration of adapter partCodingClassicGeneralThis container contains the configuration parameters of the classic adapter of the Coding module.
CodingCycleTimeThis parameter defines the Call Cycle of the Coding Timer Function in Seconds.
Other Application SWCApplication Connectors
CheckCodingFunction_<x>: Shall be connected with its corresponding CodingSample ports.
ConditionMode: Shall be connected with its corresponding CodingSample port.
Data: Shall be connected with its corresponding CodingSample and CodingTestClient port.
DataMode: Shall be connected with its corresponding CodingSample and CodingTestClient port.
LifeCycle: Shall be connected with its corresponding BswM and CodingTestClient port.
ProgId: Shall be connected with its corresponding Dlog port.
SVK: Shall be connected with its corresponding Dlog port.
Vin: Shall be connected with its corresponding Vin port.
Service Connectors
BusCom: Shall be connected with its corresponding BswM port.
CBClrEvt_EventNotCoded: Shall be connected with its corresponding Dem port.
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 20 of 23

CheckNCD: Shall be connected with its corresponding Dcm port.
DETService: Shall be connected with its corresponding Det port.
EventNotCoded: Shall be connected with its corresponding Dem port.
EventUnqualifiedData: Shall be connected with its corresponding Dem port.
EventWrongVehicle: Shall be connected with its corresponding Dem port.
LifeCycleRequest: Shall be connected with its corresponding BswM and CodingTestClient port.
Notification: Shall be connected with its corresponding Dcm port.
NvMNotifyJobFinished: Shall be connected with its corresponding NvM port.
NvMService: Shall be connected with its corresponding NvM port.
ReadCPS: Shall be connected with its corresponding Dcm port.
ReadNCD: Shall be connected with its corresponding Dcm port.
ReadProtocolData: Shall be connected with its corresponding Dcm port.
SessionChangeIndication: Shall be connected with its corresponding BswM port.
WriteNCD: Shall be connected with its corresponding Dcm port.
Event MappingCoding_DemClearEventAllowedNotCoded: Operation Invoked Event
Coding_TimerMain: Timing Event
DCMConfirmation: Operation Invoked Event
DCMIndication: Operation Invoked Event
GetCafIds: Operation Invoked Event
LifeCycleHandler: Data Receive Event
R_CheckNCD: Operation Invoked Event
R_ConditionCheckReadCPS: Operation Invoked Event
R_ConditionCheckReadProtocolData: Operation Invoked Event
R_GetCodingFunction_<x>: Operation Invoked Event
R_ReadCPS: Operation Invoked Event
R_ReadNCD: Operation Invoked Event
R_ReadProtocolData: Operation Invoked Event
R_WriteNCD: Operation Invoked Event
SessionChange: Mode Switch Event
VinReceiveHandler: Data Receive Event
WriteDataBlockNotification: Operation Invoked Event
Data MappingNo Data Mapping necessary for the Coding module.
Exclusive AreasThe exlusive areas CodingData and CodingState shall be configured.
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 21 of 23
 Software IntegrationStartup/Initialization
Software IntegrationStartup/InitializationBefore the Coding operation mode CODING_INITIALIZED is requested, the following preconditions shall
be satisfied:
The Coding module is in STOPPED-Mode
The NVRAM Manager is initialized
The NVRAM Manager has finished the job Nvm_ReadAll(). This implies that the NV block containing
the Coding data has also been loaded. If the block is corrupted, the NVRAM Manager automatically
loads the default ROM block containing the default values.
The Dlog is in RUNNING-Mode
The integrator has to assure, that the Coding operation mode CODING_INITIALIZED is requested, after
NvM_ReadAll() is finished and Dlog module switched to RUNNING-Mode.
Normal OperationBefore the Coding operation mode CODING_RUNNING is requested, the following preconditions shall be
satisfied:
The Coding module is in INITIALIZED-Mode
The Coding_TimerMain() will be scheduled cyclically via RTE (a good value for this is a 100ms cycle ).
After the Coding BusCom-Mode is set to CODING_BUSCOMON the Coding_TimerMain() may request
the Vin module to get the onboard electrical system VIN to validate net Coding data if no VIN has been
received until now. This qualification process is repeated 3 times at 1000 ms intervals, if a VIN has still not
been received from the onboard electrical system. After this, qualification of the net coding data is not
performed in this wake cycle, even if an onboard electrical system VIN is received at a later point.
Shutdown/DeactivationBefore the Coding operation mode CODING_STOPPED is requested, the following preconditions shall
be satisfied:
The Coding module is either in INITIALIZED- or RUNNING-Mode
Shutdown/Deactivation is requested
The integrator has to assure, that the Coding operation mode CODING_STOPPED is requested, after a
shutdown/deactivation request was received.
SWCDThe Coding module provides the following Mode:
ModeDeclarationGroup Coding_ConditionMode
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 22 of 23

{
{
CODING_ALLOWED
CODING_NOT_ALLLOWED
}
initialMode = CODING_ALLOWED
}
This mode is used to enable or disable the start of a Coding process. An implementation how to change
this Mode is done in CodingSample_VehicleSpeedReceiveHandler(). The user can add additional rules.
The Coding module provides the following Mode:
ModeDeclarationGroup Coding_BusComMode
{
{
CODING_BUSCOMOFF,
CODING_BUSCOMON
}
initialMode = CODING_BUSCOMOFF
}
The integrator has to assure, that this Mode is set to CODING_BUSCOMON, after the bus
communication has started. The Coding module requests the VIN from the Vin module after this Mode is
set to CODING_BUSCOMON.
No special callback functions have to be introduced by the application programmer for using the Coding
module. The following application callback functions are already implemented in CodingSample.c and can
be adapted by the application programmer:
CodingSample_VehicleSpeedReceiveHandler()
CodingSample_CheckCodingFunction_<x>()
CodingClassic_IntegrationManual, Version 5.2.1, Software Platforms
Page 23 of 23
Document Outline
7 - CodingClassic_ReleaseNotess

Release Notes CodingClassic
Project
BMW AUTOSAR 4 Core Rel. 3
Author
BMW AG
Release Date
2017-12-14
Version
5.2.1
Status
Release
Hotline
+49 89 382 - 32233
Contact
bac@bmw.de
https://asc.bmw.com/jira/browse/BSUP (extern)
https://asc.bmwgroup.net/jira/browse/BSUP (intern)
Revision History
VersionDateIssues5.2.1
2017-12-14
BAC-6660, BAC-6704, BAC-6561, BAC-6585
5.2.0
2017-11-09
BAC-6434, BAC-6350
5.1.0
2017-10-12
BAC-6402
5.0.1
2017-09-14
BAC-6250, BAC-6239, BAC-6224, BAC-5170
5.0.0
2017-06-29
CompanyBayerische
Motoren Werke
Aktiengesellschaft
Postal addressBMW AG
80788 München
Office addressForschungs- und
Innovationszentrum
(FIZ)
Hufelandstr. 1
80937 München
TelephoneSwitchboard
+49 89 382-0
Internetwww.bmwgroup.com
ReleaseNotes_CodingClassic, Version 5.2.1, Software Platforms
Page 1 of 5
 1Module Description
1Module DescriptionThe Coding system consists of a Coding module that is part of the ECU application and the Coder.
Almost in the same manner as the Bootloader programs the ROM of an ECU, the Coding module codes
the NV memory of an ECU with vehicle specific data derived from the vehicle description document e.g.
type key, extra equipment, country specifics, year of model/construction stage, additional comments or
service upgrade options.
2Revisions and ModificationsRevision 5.2.1 [Released]ItemDescriptionCR ID:
BAC-6660
CR Headline:
Correct Misra- and Metric-violations
Description of Issues:
Correct Misra- and Metric-violations and compiler warnings.
Description of Changes:
Correct Misra- and Metric-violations and compiler warnings.
Changed Files:
src/Coding_UDSAdapter.c
src/Coding_TimerAdapter.c
generate/include/CodingClassic_Cfg.h.pgen
template/include/Coding_MemMap.h.sample
generate/meta/Coding_internal.arxml.pgen
include/Coding_Assert.h
generate/meta/Coding_ext_interfaces.arxml.pgen
src/Coding_ErrMemAdapter.c
src/Coding_CryptoAdapter.c
doc/CodingClassic_RequirementsTable.pdf
generate/include/CodingClassic_Version.h.pgen
doc/CodingClassic_IntegrationManual.pdf
generate/meta/Coding_interfaces.arxml.pgen
doc/CodingClassic_UserManual.pdf
Compatibility:
ItemDescriptionCR ID:
BAC-6704
CR Headline:
Activation of signature verification (RSA)
Description of Issues:
Changed Coding adapter to fit to the provided Crypto-Lib (RSA).
Description of Changes:
Changed Coding adapter to fit to the provided Crypto-Lib (RSA).
Changed Files:
src/Coding_CryptoAdapter.c
Compatibility:
ItemDescriptionCR ID:
BAC-6561
ReleaseNotes_CodingClassic, Version 5.2.1, Software Platforms
Page 2 of 5

CR Headline:
Wrong description of event mapping "Coding_TimerMain" in
IntegrationManual
Description of Issues:
Fix description of event mapping "Coding_TimerMain" in
Integration Manual.
Description of Changes:
Changed description from "Mode Switch Event" to "Timing Event".
Changed Files:
doc/CodingClassic_IntegrationManual.pdf
Compatibility:
ItemDescriptionCR ID:
BAC-6585
CR Headline:
Rework Coding_paramdef.arxml
Description of Issues:
Add missing configuration parameters, provide human readable
Coding function value input field and support tool based
implementation type range check.
Description of Changes:
Added missing configuration parameters 'lowerlimit' and
'upperlimit'. Use choice container for supported implementation
data types. Updated PAGe include files to convert human readable
Coding function values to Coding internal machine code.
Changed Files:
doc/CodingClassic_IntegrationManual.pdf
Compatibility:
Revision 5.2.0 [Released]ItemDescriptionCR ID:
BAC-6434
CR Headline:
Schema of paramdefs, paramconfs and SWCDen should be
AUTOSAR_4-3-0_STRICT_COMPACT.xsd
Description of Issues:
Schema of parameter definition files and SWCDs should be
conform to AUTOSAR_4-3-0_STRICT_COMPACT.xsd.
Description of Changes:
Adapted parameter definition files and SWCDs to schema
AUTOSAR_4-3-0_STRICT_COMPACT.
Changed Files:
cfgdesc/CodingClassic_paramdef.arxml
Compatibility:
ItemDescriptionCR ID:
BAC-6350
CR Headline:
RoutineSignal Arrays must be configured with
VARIABLE_LENGTH
Description of Issues:
Routine signal arrays must be configured with
VARIABLE_LENGTH.
Description of Changes:
Coding generic has to support an additional function parameter
'dataLength' and Coding adapter has to support configuration with
VARIABLE_LENGTH.
Changed Files:
src/Coding_UDSAdapter.c
CMakeLists.txt
generate/meta/Coding_ext_interfaces.arxml.pgen
ReleaseNotes_CodingClassic, Version 5.2.1, Software Platforms
Page 3 of 5

Compatibility:
Revision 5.1.0 [Released]ItemDescriptionCR ID:
BAC-6402
CR Headline:
Activation of signature verification
Description of Issues:
Customize the function calls according to specification. Support
the provided Crypto-Lib.
Description of Changes:
Removed unnecessary function call from Coding module.
Changed Coding adapter to fit to the provided Crypto-Lib on one
side and to fullfill the specification requirements on the other side.
Changed Files:
generate/meta/Coding_ext_interfaces.arxml.pgen
generate/meta/Coding_internal.arxml.pgen
src/Coding_CryptoAdapter.c
Compatibility:
Revision 5.0.1 [Released]ItemDescriptionCR ID:
BAC-6250
CR Headline:
CodingClassic_MemMap.h.sample should be
Coding_MemMap.h.sample
Description of Issues:
Sample file has wrong file name.
Description of Changes:
Corrected file name.
Changed Files:
template/include/Coding_MemMap.h.sample
Compatibility:
ItemDescriptionCR ID:
BAC-6239
CR Headline:
Improve requirements traceability
Description of Issues:
Improve generation of documents.
Description of Changes:
Replace special character and add reference information.
Changed Files:
doc/Coding_RequirementsTable.pdf
Compatibility:
ItemDescriptionCR ID:
BAC-6224
CR Headline:
PublishedInformation of BMW modules is not modeled according
to ASR4.2.2
Description of Issues:
Removed depricated ImplementationConfigClass from
PublishedInformation and added ValueConfigClass instead.
Description of Changes:
File content was updated.
Changed Files:
cfgdesc/CodingClassic_paramdef.arxml
Compatibility:
ReleaseNotes_CodingClassic, Version 5.2.1, Software Platforms
Page 4 of 5
 ItemDescription
ItemDescriptionCR ID:
BAC-5170
CR Headline:
Modules paramdef violates TPS_ECUC_06004
Description of Issues:
AdminData filed in ECU configuration parameter definition is
required.
Description of Changes:
Added missing AdminData field.
Changed Files:
cfgdesc/CodingClassic_paramdef.arxml
Compatibility:
Revision 5.0.0 [Released]ItemDescriptionCR ID:
CR Headline:
Initial Release for SP2021
Description of Issues:
Initial Release for SP2021
Description of Changes:
Initial Release for SP2021
Changed Files:
Compatibility:
ReleaseNotes_CodingClassic, Version 5.2.1, Software Platforms
Page 5 of 5
Document Outline
13 - CodingGeneric_ReleaseNotess

Release Notes CodingGeneric
Project
BMW AUTOSAR Core 4 Rel. 3 and adaptive BMW AUTOSAR Core Rel. 1
Author
BMW AG
Release Date
2017-12-14
Version
5.2.1
Status
Release
Hotline
+49 89 382 - 32233 (classic) / +49 89 382 - 22522 (adaptive)
Contact
bac@bmw.de (classic) / abac@bmw.de (adaptive)
https://asc.bmw.com/jira/browse/BSUP (extern)
https://asc.bmwgroup.net/jira/browse/BSUP (intern)
Revision History
VersionDateIssues5.2.1
2017-12-14
BAC-6660, BAC-6704, BAC-6585, BAC-6736, BAC-6192
5.2.0
2017-11-09
BAC-6434, BAC-6350
5.1.0
2017-10-12
BAC-6402
5.0.1
2017-09-14
BAC-6302, BAC-6239, BAC-6224, BAC-6073, BAC-6003,
BAC-5170
5.0.0
2017-06-29
CompanyBayerische
Motoren Werke
Aktiengesellschaft
Postal addressBMW AG
80788 München
Office addressForschungs- und
Innovationszentrum
(FIZ)
Hufelandstr. 1
80937 München
TelephoneSwitchboard
+49 89 382-0
Internetwww.bmwgroup.com
ReleaseNotes_CodingGeneric, Version 5.2.1, Software Platforms
Page 1 of 6
 1Module Description
1Module DescriptionThe Coding system consists of a Coding module that is part of the ECU application and the Coder.
Almost in the same manner as the Bootloader programs the ROM of an ECU, the Coding module codes
the NV memory of an ECU with vehicle specific data derived from the vehicle description document e.g.
type key, extra equipment, country specifics, year of model/construction stage, additional comments or
service upgrade options.
2Revisions and ModificationsRevision 5.2.1 [Released]ItemDescriptionCR ID:
BAC-6660
CR Headline:
Correct Misra- and Metric-violations
Description of Issues:
Correct Misra- and Metric-violations and compiler warnings.
Description of Changes:
Correct Misra- and Metric-violations and compiler warnings.
Changed Files:
generate/include/Coding_Cfg.h.pgen
doc/CodingGeneric_RequirementsTable.pdf
template/include/Coding_MemMap.h.sample
generate/src/Coding_Function.c.pgen
generate/include/Coding_Version.h.pgen
generate/include/Coding_Function.h.pgen
generate/src/Coding_Cfg.c.pgen
include/Coding_CryptoAdapter.h
generate/pageinclude/Coding_Functions.pgen
generate/pageinclude/Coding_Function_Types.pgen
src/Coding.c
include/Coding.h
Compatibility:
ItemDescriptionCR ID:
BAC-6704
CR Headline:
Activation of signature verification (RSA)
Description of Issues:
Changed Coding adapter to fit to the provided Crypto-Lib (RSA).
Description of Changes:
Changed Coding adapter to fit to the provided Crypto-Lib (RSA).
Changed Files:
generate/pageinclude/Coding_Functions.pgen
generate/src/Coding_Function.c.pgen
Compatibility:
ItemDescriptionCR ID:
BAC-6585
CR Headline:
Rework Coding_paramdef.arxml
ReleaseNotes_CodingGeneric, Version 5.2.1, Software Platforms
Page 2 of 6

Description of Issues:
Add missing configuration parameters, provide human readable
Coding function value input field and support tool based
implementation type range check.
Description of Changes:
Added missing configuration parameters 'lowerlimit' and
'upperlimit'. Use choice container for supported implementation
data types. Updated PAGe include files to convert human readable
Coding function values to Coding internal machine code.
Changed Files:
generate/pageinclude/Coding_Function_Types.pgen
cfgdesc/Coding_paramdef.arxml
generate/pageinclude/Coding_Functions.pgen
Compatibility:
ItemDescriptionCR ID:
BAC-6736
CR Headline:
Fix optional production error CEUD compile error
Description of Issues:
Deactivation of optional production error leads to compile error.
Description of Changes:
Add missing preprocessor directives.
Changed Files:
src/Coding.c
Compatibility:
ItemDescriptionCR ID:
BAC-6192
CR Headline:
Identical function names in different coding areas lead to
generation of duplicate event names
Description of Issues:
Add Coding configuration plausibility check.
Description of Changes:
Check uniqueness of all Coding function names in Coding
configuration.
Changed Files:
generate/pageinclude/Coding_Functions.pgen
Compatibility:
Revision 5.2.0 [Released]ItemDescriptionCR ID:
BAC-6434
CR Headline:
Schema of paramdefs, paramconfs and SWCDen should be
AUTOSAR_4-3-0_STRICT_COMPACT.xsd
Description of Issues:
Schema of parameter definition files and SWCDs should be
conform to AUTOSAR_4-3-0_STRICT_COMPACT.xsd.
Description of Changes:
Adapted parameter definition files and SWCDs to schema
AUTOSAR_4-3-0_STRICT_COMPACT.
Changed Files:
cfgdesc/Coding_paramdef.arxml
Compatibility:
ItemDescriptionCR ID:
BAC-6350
ReleaseNotes_CodingGeneric, Version 5.2.1, Software Platforms
Page 3 of 6

CR Headline:
RoutineSignal Arrays must be configured with
VARIABLE_LENGTH
Description of Issues:
Routine signal arrays must be configured with
VARIABLE_LENGTH.
Description of Changes:
Coding generic has to support an additional function parameter
'dataLength' and Coding adapter has to support configuration with
VARIABLE_LENGTH.
Changed Files:
src/Coding.c
include/Coding.h
Compatibility:
Revision 5.1.0 [Released]ItemDescriptionCR ID:
BAC-6402
CR Headline:
Activation of signature verification
Description of Issues:
Customize the function calls according to specification. Support
the provided Crypto-Lib.
Description of Changes:
Removed unnecessary function call from Coding module.
Changed Coding adapter to fit to the provided Crypto-Lib on one
side and to fullfill the specification requirements on the other side.
Changed Files:
generate/include/Coding_Cfg.h.pgen
cfgdesc/Coding_paramdef.arxml
include/Coding_CryptoAdapter.h
generate/pageinclude/Coding_Functions.pgen
generate/pageinclude/Coding_Function_Types.pgen
src/Coding.c
Compatibility:
Revision 5.0.1 [Released]ItemDescriptionCR ID:
BAC-6302
CR Headline:
Add look up table for type conversion
Description of Issues:
Provide look up table (adaptive platform and ara implementation
data types) for PAGe.
Description of Changes:
Added look up table for adaptive platform and ara implementation
data types in page include file.
Changed Files:
generate/pageinclude/Coding_Functions.pgen
Compatibility:
ItemDescriptionCR ID:
BAC-6239
CR Headline:
Improve requirements traceability
Description of Issues:
Improve generation of documents.
Description of Changes:
Replace special character and add reference information.
ReleaseNotes_CodingGeneric, Version 5.2.1, Software Platforms
Page 4 of 6

Changed Files:
doc/Coding_RequirementsTable.pdf
Compatibility:
ItemDescriptionCR ID:
BAC-6224
CR Headline:
PublishedInformation of BMW modules is not modeled according
to ASR4.2.2
Description of Issues:
Removed depricated ImplementationConfigClass from
PublishedInformation and added ValueConfigClass instead.
Description of Changes:
File content was updated.
Changed Files:
cfgdesc/Coding_paramdef.arxml
Compatibility:
ItemDescriptionCR ID:
BAC-6073
CR Headline:
Stop timeout monitoring during module shutdown
Description of Issues:
Stop timeout monitoring (Coding data qualification) during
shutdown.
Description of Changes:
Added call: Coding_Timer_CancelTimer() in Coding_Shutdown()
(sync branch) and in
Coding_NvMFinishedCallbackWriteCodingData() (async branch).
Changed Files:
src/Coding.c
Compatibility:
ItemDescriptionCR ID:
BAC-6003
CR Headline:
Transformation rule must respect signedness of nvRam type
Description of Issues:
The Coding transformation rule mechanism does not consider that
the Coding data are stored in an uint8 array when the user
application requests an sint8 Coding value.
Description of Changes:
Add missing type cast when Coding data are extracted from uint8
array.
Changed Files:
generate/src/Coding_Function.c.pgen
Compatibility:
ItemDescriptionCR ID:
BAC-5170
CR Headline:
Modules paramdef violates TPS_ECUC_06004
Description of Issues:
AdminData filed in ECU configuration parameter definition is
required.
Description of Changes:
Added missing AdminData field.
Changed Files:
cfgdesc/Coding_paramdef.arxml
Compatibility:
Revision 5.0.0 [Released]ReleaseNotes_CodingGeneric, Version 5.2.1, Software Platforms
Page 5 of 6
 ItemDescription
ItemDescriptionCR ID:
CR Headline:
Initial Release for SP2021
Description of Issues:
Initial Release for SP2021
Description of Changes:
Initial Release for SP2021
Changed Files:
Compatibility:
ReleaseNotes_CodingGeneric, Version 5.2.1, Software Platforms
Page 6 of 6
Document Outline