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