ApXcp_Integration_Manual

1 Dependencies 2

1.1 SWCs 2

1.2 Functions to be provided to Integration Project 2

2 Configuration 3

2.1 Build Time Config 3

2.2 Configuration Files to be provided by Integration Project 3

2.2.1 Da Vinci Config generation 3

2.2.2 Manual Configuration Changes 3

3 Integration 4

3.1 Required Global Data Inputs 4

3.2 Optional Global Data Inputs 4

3.3 Specific Include Path present 4

4 Runnable Scheduling 5

5 Memory Mapping 6

5.1 Mapping 6

5.2 Usage 6

5.3 NvM Blocks 6

6 Compiler Settings 6

6.1 Preprocessor MACRO 6

6.2 Optimization Settings 6

7 Revision Control Log 7

Dependencies

GetSetIndexes() and GetPersIndexes()

Overview

The integration specific functions below, GetSetIndexes and GetPersIndexes, are used to return an array of tuning identifiers to the tune-on-the-fly (or online calibration as defined in the XCP specs) function. They are used to copy the active sets or personalities into RAM. The functions should be implemented in an integration specific component that determines the desired personality and desired set identifiers sent to tuning select authority SWC.

If tune-on-the-fly functionality is disabled, the functions below do not need to be defined.

If tune-on-the-fly is enabled and the lookup functions are disabled, the functions below do not need to be defined. When a copy cal page XCP command is called, the personalities are copied from 0 to a max limit based on the active tuning set that is currently being used. In the case of the tuning sets being copied, only the active tuning set is copied in to the RAM.

ModuleRequired API
<Integration Specific Module>Function outline defined below:

Function Prototypes

The actual implementation of the function will vary between programs. However, the function should be structured so the passed arguments are of the same time to provide a common interface to the XCP functions.

Function NameGetSetIndexes or GetPersndexesTypeDir.MinMaxUTP Tol.
Arguments PassedNumOfSets_Cnt_T_u8
or
NumOfPers_Cnt_T_u8
uint8I0255
datauint8*I/O0255
Return ValueN/A

Example 1 -- BMW

The following example illustrates a similar situation found in the BMW program. Active personalities are determined by coding bits. Using the GetPersIndexes function, the function will loop through the personalities to find the index of the personality that contains the matching coding ID. The indexes are returned and the active personalities are copied into RAM.

ProcessXCPPID()

Overview

This function must be available to this module to call by the integration manual. This should be provided by the CMS component which does the processing on XCP PIDs. This function is required to allow the CMS component to figure out when an XCP PID is finished being read or written.

ModuleRequired API
CMS CommonFunction outline defined below:

Function Prototypes

Function NameProcessXCPPIDTypeDir.MinMaxUTP Tol.
Arguments PassedSize_Cnt_T_u08uint8I18
Return ValueN/A

Configuration

Build Time Config

ModulesNotes
None

Configuration Files to be provided by Integration Project

Da Vinci Parameter Configuration Changes

ParameterNotesSWC
D_NUMOFVLDEEMEMRGNS_CNT_U08Generated in Ap_ApXcp.Cfg.h if external EEPROM access is set to STD_ON in Configurator. Value will be determined by the EEPROM memory access defined in the ECUC file.ApXcp
BC_XCP_EXTEEPACCESSSet to STD_ON in Configurator if XCP access to external EEPROM is required.ApXcp
BC_XCP_TUNEONFLYSet to STD_ON in Configuartor if tune-on-the-fly support is required.ApXcp
BC_XCP_PERSINDEXLOOKUPSet to STD_ON in Configurator if a function call to GetPersIndexes is required to return the indexes of active personalities. Note: BC_XCP_TUNEONFLY must be set to STD_ONApXcp
BC_XCP_SETINDEXLOOKUPSet to STD_ON in Configurator if a function call to GetSetIndexes is required to return the indexes of active sets. Note: BC_XCP_TUNEONFLY must be set to STD_ONApXcp
<Non Trusted Function Stack Size>This needs to be configured (to a non-zero value) for the task or ISR that handles the XCP commands. This is required to support application switching for XCP writes. Please note this is only required if a program has non-trusted applications configured.Os
<Trusted/Non Trusted functions for XCP writes>

If a program has multiple applications configured, non-trusted or trusted functions must be configured for each application. This is required to allow the XCP write commands to switch context before performing the write. These functions should end up calling ApXcpWriteCommon() to perform the write.

Ex:

NtWrapS_XcpWriteAp8()

NtWrapS_XcpWriteAp9()

TWrapS_XcpWriteAp0

Os
BC_XCP_TOTFRAMSIZE_UNT_32This should be set to the same size as the amount of RAM allocated to TOTF. Also used as the size of the buffer if Segment16 is enabled.ApXcp
BC_XCP_SEG[x]ENABLEThis should be set to STD_ON to enable the number segment, where [x] = Segment number.ApXcp
BC_XCP_MAXPERCOPY_CNT_U8Used with segment 0, the number represents the number of tuning personalities to copy into RAM. Must be set to at least 1.ApXcp
CalConstNumOfPerSymbolSet to the number of tuning personalties constant. Typically this is defined in CalConstants.h with the name D_NUMOFPERS_CNT_U16.ApXcp
BC_XCP_MAXSETCOPY_CNT_U8Used with segment 1, the number represents the number of tuning sets to copy into RAM. Must be set to at least 1.ApXcp
CalConstNumOfSetSymbolSet to the number of tuning sets constant. Typically this is defined in CalConstants.h with the name D_NUMOFTUNSETS_CNT_U16.ApAcp
BC_XCP_SEG16LNKSYMBUsed with segment 16. The linker symbol represents the start address of the custom memory range to copy into RAM.ApXcp
BC_XCP_SEG16LNKSYMBLEN_CNT_U8Used with segment 16. The linker symbol represents the size of the custom memory range to copy into RAM.ApXcp

DaVinci Interrupt Configuration Changes

ISR NameVIM #Priority DependencyNotes

Manual Configuration Changes

ConstantNotesSWC

GENy Configuration Changes

ParameterNotesSWC
User configuration file

ApXcp component functionality relies on a callout function for XCP memory writing from the XCP module as delivered by vector. To enable this callout function, a user configuration file typically needs to be included in the GENy configuration to enable the appropriate build constant. See attached file below

GENy XCP configuration
General Settings->Enable CalibrationThis should be enabled to allow download commandsGENy XCP configuration
General Settings->Memory Write ProtectionThis should be enabled to allow checking of XCP access on the addresses requested for writing.GENy XCP configuration
General Settings->Memory Read ProtectionThis should be enabled to allow checking of XCP access on the addresses requested for reading.GENy XCP configuration
EEPROM Access->Read AccessThis needs to be enabled if external EEPROM is available and needs to be read through XCPGENy XCP configuration
EEPROM Access->Write AccessThis needs to be enabled if external EEPROM is available and needs to be written through XCPGENy XCP configuration
Standard Commands->User Defined CommandThis needs to be enabled for CMS XCP supportGENy XCP configuration
Block Transfer->Block UploadNeeds to be enabled to support large XCP PID readsGENy XCP configuration
Block Transfer->Block DownloadNeeds to be enabled to support large XCP PID writesGENy XCP configuration
Page Switching->Page SwitchingNeeds to be enabled only if Tune On the Fly Support is turned onGENy XCP configuration
Page Switching->General Paging InfoNeeds to be enabled only if Tune On the Fly Support is turned onGENy XCP configuration
Page Switching->Copy PageNeeds to be enabled only if Tune On the Fly Support is turned onGENy XCP configuration

Integration

Required Global Data Inputs

<Mention any global variable that this component requires for other components>

Required Global Data Outputs

<Mention any global variable that this component requires for other components>

Specific Include Path present

Yes

Runnable Scheduling

This section specifies the required runnable scheduling.

InitScheduling RequirementsTrigger
ApXcp_InitShould be called prior to the start of the O/S (typically EcuStartup_Init1)Once At Init
RunnableScheduling RequirementsTrigger
ApXcp_Per1NoneRTE (10ms)
DAQ_2msTLRTE (2ms)
DAQ_1msTLThis function should only be scheduled if 1ms DAQ support is required. If not, it needs to be deleted from the integration project in the ApXcp Component.RTE (1ms)

.

Memory Mapping

Mapping

Memory SectionContentsNotes
< Memory mapping Info>

* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.

Usage

Table 1: ARM Cortex R4 Memory Usage

FeatureRAMROM
<Memmap usuage info>

Non RTE NvM Blocks

Block Name
<NVM block used Non RTE functions >

Note : Size of the NVM block if configured in developer

RTE NvM Blocks

Block Name
<NVM block used in RTE functions >

Note : Size of the NVM block if configured in developer

Compiler Settings

Preprocessor MACRO

<Define all the preprocessor Macros needed and conditions when needed>.

Optimization Settings

<Define Optimization levels that are needed and conditions when needed>.

Revision Control Log

Rev #Change DescriptionDateAuthor
1Initial version30-July-13KJS
2Updates for better description of configuration requirements29-Aug-13LWW
3Added updates for new configuration constants generated with tune on the fly.10-Oct-13KJS
Last modified October 12, 2025: Initial commit (0347a62)