This is the multi-page printable view of this section. Click here to print.
Component Implementation
1 - XcpIf Integration Manual
Integration Manual
For
XCP Interface (XcpIf)
VERSION: 2.0
DATE: 09-Oct-2015
Prepared By:
Kevin Smith
ESG Software,
Nexteer Automotive,
Saginaw, MI, USA
Location: The official version of this document is stored in the Nexteer Configuration Management System.
Revision History
Sl. No. | Description | Author | Version | Date | Approved By |
1 | Initial version | K. Smith | 1.0 | 6-Jun-15 | |
2 | Updates for intial online calibration support | K. Smith | 2.0 | 9-Oct-15 |
Table of Contents
3.2 Global Functions(Non RTE) to be provided to Integration Project 6
4 Configuration REQUIREMeNTS 7
4.2 Configuration Files to be provided by Integration Project 7
4.3 Da Vinci Parameter Configuration Changes 7
4.4 DaVinci Interrupt Configuration Changes 7
4.5 Manual Configuration Changes 7
4.6 OS Configuration Changes 7
5 Integration DATAFLOW REQUIREMENTS 8
5.1 Required Global Data Inputs 8
5.2 Required Global Data Outputs 8
5.3 Specific Include Path present 8
Abbrevations And Acronyms
Abbreviation | Description |
---|---|
DFD | Design functional diagram |
MDD | Module design Document |
References
This section lists the title & version of all the documents that are referred for development of this document
Sr. No. | Title | Version |
---|---|---|
1 | MDD Guidelines | Process 04.02.00 |
2 | Software Naming Conventions | Process 04.02.00 |
3 | Coding standards | Process 04.02.00 |
4 | FDD | Not available |
<Add if more available> |
Dependencies
SWCs
Module | Required Feature |
---|---|
None |
Note : Referencing the external components should be avoided in most cases. Only in unavoidable circumstance external components should be referred. Developer should track the references.
Global Functions(Non RTE) to be provided to Integration Project
None
Configuration REQUIREMeNTS
Build Time Config
Modules | Notes | |
---|---|---|
None |
Configuration Files to be provided by Integration Project
Da Vinci Parameter Configuration Changes
Parameter | Notes | SWC |
---|---|---|
None |
DaVinci Interrupt Configuration Changes
ISR Name | VIM # | Priority Dependency | Notes |
---|---|---|---|
None |
Manual Configuration Changes
Constant | Notes | SWC |
---|---|---|
None |
OS Configuration Changes
Trusted Function | Parameters | Notes |
---|---|---|
ApplXcpWrCmn | MTABYTEPTR addr vuint8 size const BYTEPTR data | This function should be defined as trusted. |
Rte_Call_SetCalPageReq_Oper | This function shall be defined as a non-trusted function call to the application that TunSelnMngt is integrated. | |
Rte_Call_CopyCalPageReq_Oper | This function shall be defined as a non-trusted function call to the application that TunSelnMngt is integrated. |
Integration DATAFLOW REQUIREMENTS
Required Global Data Inputs
None
Required Global Data Outputs
None
Specific Include Path present
Yes
Other Header Changes
File | Change | Reason |
---|---|---|
usrostyp.h | Add include statement for CDD_XcpIf.h | The include is needed since for the OS has the function prototypes and datatypes required for the trusted function call. |
Runnable Scheduling
This section specifies the required runnable scheduling.
Init | Scheduling Requirements | Trigger |
---|---|---|
CDD_XcpIfInit | None | Rte |
Runnable | Scheduling Requirements | Trigger |
---|---|---|
Xcp2msDaq | 2ms | RTE |
Memory Map REQUIREMENTS
Mapping
Memory Section | Contents | Notes |
---|---|---|
None |
* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.
Usage
Feature | RAM | ROM |
---|---|---|
None |
NvM Blocks
None
Compiler Settings
Preprocessor MACRO
The file xcp.cfg needs to have “#define XCP_ENABLE_CALIBRATION_MEM_ACCESS_BY_APPL” added. When the XCP component is generated in GENy, this will enable the application read/write calls.
The #defile XCPIF_MAXCALSEG_CNT_U08 points to a generated value by the Xcp component. Vector currently only allows one segment to be defined. This will have to be manually changed in the xcp.cfg file by the following:
#undef kXcpMaxSegment
#define kXcpMaxSegment XX
XX is the number of tuning groups that are defined in your program.
Optimization Settings
None
Appendix
N/A
2 - XcpIf Peer Review Checklists
Overview
Summary SheetSynergy Project
Source Code
MDD
PolySpace
Sheet 1: Summary Sheet

Sheet 2: Synergy Project
Sheet 3: Source Code
Rev 1.2 | 8-Jun-15 | |||||||||||||||||||||||
Peer Review Meeting Log (Source Code Review) | ||||||||||||||||||||||||
Source File Name: | CDD_XcpIf.c | Source File Revision: | 4 | |||||||||||||||||||||
Header File Name: | CDD_XcpIf.h | Header File Revision: | ||||||||||||||||||||||
MDD Name: | XcpIf_MDD.docx | Revision: | 4 | |||||||||||||||||||||
FDD/SCIR/DSR/FDR/CM Name: | N/A | Revision: | N/A | |||||||||||||||||||||
Quality Check Items: | ||||||||||||||||||||||||
Rationale is required for all answers of No | ||||||||||||||||||||||||
Working EA4 Software Naming Convention followed: | ||||||||||||||||||||||||
for variable names | Yes | Comments: | For all non-vector related names. Some | |||||||||||||||||||||
names were based from Vector's implementation and do not follow our standards. | ||||||||||||||||||||||||
for constant names | Yes | Comments: | ||||||||||||||||||||||
for function names | Yes | Comments: | See comment for variable names | |||||||||||||||||||||
for other names (component, memory | Yes | Comments: | ||||||||||||||||||||||
mapping handles, typedefs, etc.) | ||||||||||||||||||||||||
All paths assign a value to outputs, ensuring | Yes | Comments: | ||||||||||||||||||||||
all outputs are initialized prior to being written | ||||||||||||||||||||||||
Requirements Tracability tags in code match the requirements tracability in the FDD | Yes | Comments: | ||||||||||||||||||||||
requirements tracability in the FDD | ||||||||||||||||||||||||
All variables are declared at the function level. | Yes | Comments: | ||||||||||||||||||||||
Synergy version matches change history | Yes | Comments: | ||||||||||||||||||||||
and Version Control version in file comment block | ||||||||||||||||||||||||
Change log contains detailed description of changes | Yes | Comments: | ||||||||||||||||||||||
and Work CR number | ||||||||||||||||||||||||
Code accurately implements FDD (Document or Model) | N/A | Comments: | No design document yet | |||||||||||||||||||||
Verified no Compiler Errors or Warnings | Yes | Comments: | ||||||||||||||||||||||
Component.h is included | Yes | Comments: | ||||||||||||||||||||||
All other includes are actually needed. (System includes | Yes | Comments: | ||||||||||||||||||||||
only allowed in Nexteer library components) | ||||||||||||||||||||||||
Software Design and Coding Standards followed: | Version: | |||||||||||||||||||||||
Code comments are clear, correct, and adequate | Yes | Comments: | ||||||||||||||||||||||
and have been updated for the change: [N40] and | ||||||||||||||||||||||||
all other rules in the same section as rule [N40], | ||||||||||||||||||||||||
plus [N75], [N12], [N23], [N33], [N37], [N38], | ||||||||||||||||||||||||
[N48], [N54], [N77], [N79], [N72] | ||||||||||||||||||||||||
Source file (.c and .h) comment blocks are per | Yes | Comments: | ||||||||||||||||||||||
standards and contain correct information: [N41], [N42] | ||||||||||||||||||||||||
Function comment blocks are per standards and | Yes | Comments: | ||||||||||||||||||||||
contain correct information: [N43] | ||||||||||||||||||||||||
Code formatting (indentation, placement of | Yes | Comments: | ||||||||||||||||||||||
braces, etc.) is per standards: [N5], [N55], [N56], | ||||||||||||||||||||||||
[N57], [N58], [N59] | ||||||||||||||||||||||||
Embedded constants used per standards; no | Yes | Comments: | ||||||||||||||||||||||
"magic numbers": [N12] | ||||||||||||||||||||||||
Memory mapping for non-RTE code | Yes | Comments: | ||||||||||||||||||||||
is per standard | ||||||||||||||||||||||||
All execution-order-dependent code can be | Yes | Comments: | ||||||||||||||||||||||
recognized by the compiler: [N80] | ||||||||||||||||||||||||
All loops have termination conditions that ensure | Yes | Comments: | ||||||||||||||||||||||
finite loop iterations: [N63] | ||||||||||||||||||||||||
All divides protect against divide by zero | Yes | Comments: | ||||||||||||||||||||||
if needed: [N65] | ||||||||||||||||||||||||
All integer division and modulus operations | Yes | Comments: | ||||||||||||||||||||||
handle negative numbers correctly: [N76] | ||||||||||||||||||||||||
All typecasting and fixed point arithmetic, | Yes | Comments: | ||||||||||||||||||||||
including all use of fixed point macros and | ||||||||||||||||||||||||
timer functions, is correct and has no possibility | ||||||||||||||||||||||||
of unintended overflow or underflow: [N66] | ||||||||||||||||||||||||
All float-to-unsiged conversions ensure the. | Yes | Comments: | ||||||||||||||||||||||
float value is non-negative: [N67] | ||||||||||||||||||||||||
All conversions between signed and unsigned | Yes | Comments: | ||||||||||||||||||||||
types handle msb==1 as intended: [N78] | ||||||||||||||||||||||||
All pointer dereferencing protects against | Yes | Comments: | ||||||||||||||||||||||
null pointer if needed: [N70] | ||||||||||||||||||||||||
Component outputs are limited to the legal range | Yes | Comments: | ||||||||||||||||||||||
defined in the FDD DataDict.m file : [N53] | ||||||||||||||||||||||||
All code is mapped with FDD (all FDD | Yes | Comments: | ||||||||||||||||||||||
subfunctions and/or model blocks identified | ||||||||||||||||||||||||
with code comments; all code corresponds to | ||||||||||||||||||||||||
some FDD subfunction and/or model block): [N40] | ||||||||||||||||||||||||
Review did not identify violations of other | Yes | Comments: | ||||||||||||||||||||||
coding standard rules | ||||||||||||||||||||||||
Anomaly or Design Work CR created | Yes | Comments: List Anomaly or CR numbers | ||||||||||||||||||||||
for any FDD corrections needed | ||||||||||||||||||||||||
General Notes / Comments: | ||||||||||||||||||||||||
Change Owner: | K. Smith | Review Date : | 08/30/16 | |||||||||||||||||||||
Lead Peer Reviewer: | Kathleen C. | Approved by Reviewer(s): | Yes | |||||||||||||||||||||
Other Reviewer(s): | ||||||||||||||||||||||||
Sheet 4: MDD
Sheet 5: PolySpace
3 - XcpIf_MDD
Module Design Document
For
XCP Interface (XcpIf)
VERSION: 2.0
DATE: 29-Aug-2016
Prepared By:
Kevin Smith
EPS Software,
Nexteer Automotive,
Saginaw, MI, USA
Location: The official version of this document is stored in the Nexteer Configuration Management System.
Revision History
Sl. No. | Description | Author | Version | Date | Approved By |
1 | Initial Version | K. Smith | 1.0 | 16-Jun-15 | |
2 | Updates for anomaly EA4#6672 | K. Smith | 2.0 | 29-Aug-16 |
Table of Contents
3 XCP Interface & High-Level Description 7
4 Design details of software module 8
4.1 Graphical representation of XCP Interface 8
5.1 User defined typedef definition/declaration 9
5.2 Variable definition for enumerated types 9
6.1 Program(fixed) Constants 10
6.1.2 Module specific Lookup Tables Constants 10
7 Software Module Implementation 11
7.2 Initialization Functions 11
7.3.1.2 Store Module Inputs to Local copies 11
7.3.1.3 (Processing of function)……… 11
7.3.1.4 Store Local copy of outputs into Module Outputs 11
7.6 Serial Communication Functions 11
7.7 Local Function/Macro Definitions 11
7.8 GLObAL Function/Macro Definitions 11
7.8.3 ApplXcpCalibrationWrite 12
7.8.5 ApplXcpCalibrationRead 13
9 Known Limitations With Design 15
Abbrevations And Acronyms
Abbreviation | Description |
---|---|
DFD | Design functional diagram |
MDD | Module design Document |
<ADD more to the table if applicable> | |
References
This section lists the title & version of all the documents that are referred for development of this document
Sr. No. | Title | Version |
---|---|---|
<1> | <MDD Guidelines> | 4.0.0 |
<2> | <Software Naming Conventions> | 4.0.0 |
<3> | <Coding standards> | 4.0.0 |
<4> | <FDD > | Not available |
<Add if more available> |
XCP Interface & High-Level Description
XCP Interface provides multiple functions that allow XCP end users and tools to interface with software components contained in the application.
Design details of software module
Graphical representation of XCP Interface
None
Data Flow Diagram
None
Module level DFD
None
Sub-Module level DFD
None
COMPONENT FLOW DIAGRAM
None
Variable Data Dictionary
User defined typedef definition/declaration
Typedef Name | Element Name | User Defined Type | Legal Range (min) | Legal Range (max) |
---|---|---|---|---|
Variable definition for enumerated types
Enum Name | Element Name | Value |
---|---|---|
Constant Data Dictionary
Program(fixed) Constants
Embedded Constants
Local
Constant Name | Resolution | Units | Value |
---|---|---|---|
Global
Constant Name |
---|
XcpEventChannel_2ms_DAQ_2 |
Module specific Lookup Tables Constants
Constant Name | Resolution | Value | Software Segment |
---|---|---|---|
Software Module Implementation
Sub-Module Functions
None
Initialization Functions
None
PERIODIC FUNCTIONS
Xcp2msDaq
Design Rationale
This function is called every 2ms for executing the XcpEvent functions for the 2ms DAQ.
Store Module Inputs to Local copies
None
(Processing of function)………
Store Local copy of outputs into Module Outputs
None
Non PERIODIC FUNCTIONS
None
Interrupt Functions
None
Serial Communication Functions
None
Local Function/Macro Definitions
None
GLObAL Function/Macro Definitions
ApplXcpGetTimestamp
Function Name | ApplXcpGetTimestamp | Type | Min | Max |
Arguments Passed | None | |||
Return Value | Timestamp_Cnt_T_u32 | XcpDaqTimestampType | See description | See description |
Description
This function returns the timestamp that is based on a reference timer. The range of return values vary depending on the configuration of the Xcp Component. The data type can range from a full range of a uint8 to a uint32 value.
ApplXcpGetPointer
Function Name | ApplXcpGetPointer | Type | Min | Max |
Arguments Passed | addr_ext | vuint8 | 0 | 255 |
addr | vuint32 | 1 | 4294967295 | |
Return Value | RtnAddr_Cnt_T_u32 | MTABYTEPTR | 1 | 4294967295 |
Description
This function takes the extension and address of and returns the physical address of the item.
ApplXcpCalibrationWrite
Function Name | ApplXcpCalibrationWrite | Type | Min | Max |
Arguments Passed | addr | MTABYTEPTR | 1 | 4294967295 |
size | Vuint8 | 0 | 255 | |
data | BYTEPTR | 1 | 4294967295 | |
Return Value | XCP_CMD_OK | Uint8 | 0 | 0 |
Description
This function calls the common XCP writing function. For this deisgn, the function call will be translated into a trusted function call.
ApplXcpWrCmn
Function Name | ApplXcpWrCmn | Type | Min | Max |
Arguments Passed | addr | MTABYTEPTR | 1 | 4294967295 |
size | Vuint8 | 0 | 255 | |
data | BYTEPTR | 1 | 4294967295 | |
Return Value | XCP_CMD_OK | Uint8 | 0 | 0 |
Description
This function writes the data passed in by the XCP user to the designated address.
ApplXcpCalibrationRead
Function Name | ApplXcpCalibrationRead | Type | Min | Max |
Arguments Passed | addr | MTABYTEPTR | 1 | 4294967295 |
size | Vuint8 | 0 | 255 | |
data | BYTEPTR | 1 | 4294967295 | |
Return Value | XCP_CMD_OK | Uint8 | 0 | 0 |
Description
This function reads the data in the designated address and returns it to the XCP user.
ApplXcpCheckWriteAccess
Function Name | ApplXcpCheckWriteAccess | Type | Min | Max |
Arguments Passed | addr | MTABYTEPTR | 1 | 4294967295 |
Size_Cnt_T_u08 | Vuint8 | 0 | 255 | |
Return Value | XCP_CMD_OK | Uint8 | 0 | 0 |
Description
This function checks access for XCP writes. Since the functions in tuning selection management handle the presmissions for writes, this function shall always return a positive response.
ApplXcpCheckReadAccess
Function Name | ApplXcpCheckReadAccess | Type | Min | Max |
Arguments Passed | addr | MTABYTEPTR | 1 | 4294967295 |
Size_Cnt_T_u08 | Vuint8 | 0 | 255 | |
Return Value | XCP_CMD_OK | Uint8 | 0 | 0 |
Description
This function checks access for XCP reads. Since the functions in tuning selection management handle the presmissions for reads, this function shall always return a positive response.
ApplXcpCheckDAQAccess
Function Name | ApplXcpCheckDAQAccess | Type | Min | Max |
Arguments Passed | addr | MTABYTEPTR | 1 | 4294967295 |
Size_Cnt_T_u08 | Vuint8 | 0 | 255 | |
Return Value | XCP_CMD_OK | Uint8 | 0 | 0 |
Description
This function checks access for XCP DAQ access. Since all reads are allowed, this function will also always return a positive response.
ApplXcpSetCalPage
Function Name | ApplXcpSetCalPage | Type | Min | Max |
Arguments Passed | Seg_Cnt_T_u08 | Vuint8 | 0 | 255 |
Page_Cnt_T_u08 | Vuint8 | 0 | 255 | |
Mod_Cnt_T_u08 | Vuint8 | 0 | 255 | |
Return Value | Rtn_Cnt_T_u08 | Uint8 | 0 | 0x28 |
Description
This function sets the calibration page access. It directly calls the functions used in tuning selection management.
ApplXcpGetCalPage
Function Name | ApplXcpGetCalPage | Type | Min | Max |
Arguments Passed | Seg_Cnt_T_u08 | Vuint8 | 0 | 255 |
Mod_Cnt_T_u08 | Vuint8 | 0 | 255 | |
Return Value | Rtn_Cnt_T_u08 | Uint8 | 0 | 0x28 |
Description
This function sets the calibration page access. It directly calls the functions used in tuning selection management.
ApplXcpCopyCalPage
Function Name | ApplXcpCopyCalPage | Type | Min | Max |
Arguments Passed | SrcSeg_Cnt_T_u08 | Vuint8 | 0 | 255 |
SrcPage_Cnt_T_u08 | Vuint8 | 0 | 255 | |
DestSeg_Cnt_T_u08 | Vuint8 | 0 | 255 | |
DestPage_Cnt_T_u08 | Vuint8 | 0 | 255 | |
Return Value | XCP_CMD_OK | Uint8 | 0 | 0x28 |
Description
This function sets the calibration page access. It directly calls the functions used in tuning selection management.
ApplXcpUserService
Function Name | ApplXcpUserService | Type | Min | Max |
Arguments Passed | pCmd | BYTEPTR | 0 | 4294967295 |
Return Value | XCP_CMD_OK | Uint8 | 0 | 0x3 |
Description
This function handles user service requests.
ApplXcpOpenCmdIf
Function Name | ApplXcpOpenCmdIf | Type | Min | Max |
Arguments Passed | pCmd | BYTEPTR | 0 | 4294967295 |
pRes | BYTEPTR | 0 | 4294967295 | |
pLength | BYTEPTR | 0 | 4294967295 | |
Return Value | XCP_CMD_OK | Uint8 | 0 | 0x3 |
Description
This function handles XCP service requests that are not supported by the driver but defined by the XCP protocol specification.
NONTRUSTED_NtWrapS_Rte_Call_CopyCalPageReq_Oper
Function Name | NONTRUSTED_NtWrapS_Rte_Call_CopyCalPageReq_Oper | Type | Min | Max |
Arguments Passed | FunctionIndex | NonTrustedFunctionIndexType | 0 | 65535 |
FunctionParams | NonTrustedFunctionParameterRefType | N/A | N/A | |
Return Value | N/A | N/A | N/A | N/A |
Description
NONTRUSTED_NtWrapS_Rte_Call_SetCalPageReq_Oper
Function Name | NONTRUSTED_NtWrapS_Rte_Call_SetCalPageReq_Oper | Type | Min | Max |
Arguments Passed | FunctionIndex | NonTrustedFunctionIndexType | 0 | 65535 |
FunctionParams | NonTrustedFunctionParameterRefType | N/A | N/A | |
Return Value | N/A | N/A | N/A | N/A |
Description
TRANSIENT FUNCTIONS
None
Unit Test Considerations
The value datatype of XcpDaqTimestampType can be uint8, uint16, or uint32 depending on the configuration of XCP. Unit testing shall test full ranges for all three types to ensure proper functionality.
Known Limitations With Design
There are no protections in this design for executing on NULL_PTRs
Appendix
None