This is the multi-page printable view of this section. Click here to print.
Component Implementation
1 - FlsMem Integration Manual
Integration Manual
For
FlsMem
VERSION: 5
DATE: 08/26/16
Prepared By:
Software Group,
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 |
1 | Initial version | Lucas Wendling | 1 | 10/07/15 |
2 | Updated with changes for DTS configuration for Flash CRC check | Avinash James | 2 | 03/18/16 |
3 | Removed FlsMemCodFlsSngBit handling | Avinash James | 3 | 03/31/16 |
4 | Added Trusted function for DTS clean up | Avinash James | 4 | 04/18/16 |
5 | Added Single bit ECC error handler and name correction for trusted funcions | Avinash James | 5 | 08/26/2016 |
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
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 |
FDD | Functional Design Document |
CCT | Common Checksum Tool |
References
This section lists the title & version of all the documents that are referred for development of this document
Sr. No. | Title | Version |
1 | FDD – CM102A FlsMem | See Synergy subproject version |
2 | Software Naming Conventions | Process 04.02.00 |
3 | Software Coding Standards | Process 04.02.00 |
Dependencies
SWCs
Module | Required Feature |
AR202A MicroCtrlrSuprt | NxtrMcuSuprtLib functions and register definitions |
CM800A SyncCrc | CRC HW Module Configuration and Allocation |
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
DtsInin - To be defined as a trusted function as the DTS Channel master registers need to be configured in the supervisor mode.
DtsClnUp - To be defined as a trusted function as the DTS registers are being re-configured in the supervisor mode to avoid access protection violation
CodFlsSngBitEcc – Single bit code flash ECC error handler call back function provided to the MCAL driver
Configuration REQUIREMeNTS
Build Time Config
Modules | Notes | |
None |
Configuration Files to be provided by Integration Project
CDD_FlsMem_Cfg.c
CDD_FlsMem_Cfg_private.h
Da Vinci Parameter Configuration Changes
Parameter | Notes | SWC |
/Nexteer/FlsMem/FlashCRCRegnConfig/ StartAddress | Configured with “FlashCRCRegnConfig” Each Flash region(for eg:- Boot, App, Cal1) has a start address where the code resides on the flash | FlsMem |
/Nexteer/FlsMem/FlashCRCRegnConfig/Length | Configured with “FlashCRCRegnConfig” Each Flash region has a length defined for the region | FlsMem |
/Nexteer/FlsMem/FlashCRCRegnConfig/PredefinedCrcAddress | Configured with “FlashCRCRegnConfig” Each Flash region has a PredefinedCrcAddress defined for the region which is used by the CCT tool for storing the checksum on the flash and serves as the reference location to retrieve the pre calculated CRC and do a comparison with calculated CRC | FlsMem |
/Renesas/EcucDefs_Mcu/Mcu/McuModuleConfiguration /McuEcmErrorSourcesCfg/McuEcmErrorSource36 | Call back function name is “CodFlsSngBitEcc”. Refer the CM104A Integration manual for the configuration of the error source. (Type of the error, classification of the error eg FENMI or EI information) . |
DaVinci Interrupt Configuration Changes
ISR Name | VIM # | Priority Dependency | Notes |
Manual Configuration Changes
Constant | Notes | SWC |
None |
Integration DATAFLOW REQUIREMENTS
Required Global Data Inputs
None
Required Global Data Outputs
None
Specific Include Path present
Yes
Runnable Scheduling
This section specifies the required runnable scheduling.
Init | Scheduling Requirements | Trigger |
FlsMemInit1 | None | Once At Init (RTE) |
FlsMemInit2 | Non-RTE Init, Called in Startup Sequence* | Function call in Startup Sequence |
Runnable | Scheduling Requirements | Trigger |
FlsMemPer2 | None | 100ms(RTE) |
*“FlsMemInit2” shall schedule after OS Start – Refer CM100A Start up sequence.
PEG shall be configured before “FlsMemInit2”.
CrcHw Init shall be scheduled before “FlsMemInit2”.
Memory Map REQUIREMENTS
Mapping
Memory Section | Contents | Notes |
CDD_FlsMem_START_SEC_CODE | ||
* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.
Usage
Feature | RAM | ROM |
Table 1: ARM Cortex R4 Memory Usage
NvM Blocks
*See DataDict.m
Compiler Settings
Preprocessor MACRO
None
Optimization Settings
None
Appendix
The current implementation of the Flash Config Blocks in the configurator accepts values for all the parameters. Future implementation shall be targeted with parameters being able to also accept linker symbols
2 - FlsMem Module Design Document
Module Design Document
For
FlsMem
Aug 25 , 2016
Prepared For:
Software Engineering
Nexteer Automotive,
Saginaw, MI, USA
Prepared By:
Software Group,
Nexteer Automotive,
Saginaw, MI, USA
Change History
Description | Author | Version | Date |
Initial Version | Lucas Wendling | 1.0 | 10/06/15 |
Updated with changes for DTS configuration for Flash CRC check | Avinash James | 2.0 | 03/18/16 |
Updates for DTS Transfer Clear | Avinash James | 3.0 | 3/29/16 |
Updated for removing the flash ECC single bit error handling and disabling the DTS channels after calculation | Avinash James | 4.0 | 3/31/16 |
Trusted function call for the DTS clean up updates | Avinash James | 5.0 | 04/18/16 |
Function name changes and added CodFlsSngBitEcc handler for single bit code flash ecc | Avinash James | 6.0 | 08/25/16 |
Table of Contents1 Introduction 5
2 FlsMem & High-Level Description 6
3 Design details of software module 7
3.1 Graphical representation of FlsMem 7
4.1 Program (fixed) Constants 8
5.1 User defined typedef definition/declaration 9
5.2 Variable definition for enumerated types 9
6 Software Component Implementation 10
6.1.3.2 Store Module Inputs to Local copies 10
6.1.3.3 (Processing of function)……… 10
6.1.3.4 Store Local copy of outputs into Module Outputs 10
6.4 Module Internal (Local) Functions 11
6.5 GLOBAL Function/Macro Definitions 11
7 Known Limitations with Design 15
Appendix A Abbreviations and Acronyms 17
Introduction
Purpose
Scope
The following definitions are used throughout this document:
Shall: indicates a mandatory requirement without exception in compliance.
Should: indicates a mandatory requirement; exceptions allowed only with documented justification.
May: indicates an optional action.
FlsMem & High-Level Description
See FDD
Design details of software module
Graphical representation of FlsMem
Data Flow Diagram
Component level DFD
See FDD
Function level DFD
See FDD
Constant Data Dictionary
Program (fixed) Constants
Embedded Constants
Local Constants
Constant Name | Resolution | Units | Value |
---|---|---|---|
CPU1PEID_CNT_U32 | 1 | uint32 | 0x01U |
CODFLSTOCRCSPID_CNT_U32 | 1 | uint32 | 0x02U |
CRCTOLCLRAMSPID_CNT_U32 | 1 | uint32 | 0x00U |
USRMODDIS_CNT_U32 | 1 | uint32 | 0x00U |
FLSBLKLEN_CNT_U32 | 1 | uint32 | 0x0003FFFCU |
DTSDATALEN_CNT_U32 | 1 | uint32 | 4U |
CRCCHKMAXALLWDTI_CNT_U32 | 1 | uint32 | 2000 |
MAXNROFDTSCH_CNT_U32 | 1 | uint32 | 32 |
DUMMYREADADDR1_CNT_U32 | 1 | uint32 | (0xFFFFFE1FU) |
DUMMYREADADDR2_CNT_U32 | 1 | uint32 | (0xFFFFFE2FU) |
DUMMYREADADDR3_CNT_U32 | 1 | uint32 | (0xFFFFFE4FU) |
DUMMYREADADDR4_CNT_U32 | 1 | uint32 | (0xFFFFFE8FU) |
Variable Data Dictionary
User defined typedef definition/declaration
<This section documents any user types uniquely used for the module.>
Typedef Name | Element Name | User Defined Type | Legal Range (min) | Legal Range (max) |
---|---|---|---|---|
FlsCrcCfgBlkRec | CrcFlsBlkStrtAdr | uint32 | 0 | 0xFFFFFFFFH |
CrcFlsBlkLen | uint32 | 0 | 0xFFFFFFFFH | |
PreCalcnCrcFlsAdr | uint32* | 0 | 0xFFFFFFFFH |
Variable definition for enumerated types
Enum Name | Element Name | Value |
---|---|---|
<(Name given for the user defined typdef of type struct/union) (Variable name qualified in refer[2])> | <(Variable name qualified Refer[2])> | <Define the value > |
Software Component Implementation
Sub-Module Functions
Init: FlsMemInit1
Design Rationale
Empty function for purposes of memory mapping
Module Outputs
None
Init: FlsMemInit2
Design Rationale
The FlsMemInit2 function is a non RTE function which shall be called to set up the DTS configuration for the Flash CRC check. The DTS channel configuration has to be applied only when the system is waking up from a Power On Reset or after a flash programming reset. In such a scenario a Hardware CRC unit is allocated by function call to the CRC module and once a hardware assignment is successful, the DTS channels are configured for chaining for the entire definition of the flash blocks (Boot, App, Cal1, Cal2 etc.). Record the time when the DTS transfer is initiated so that a check on a timeout can be made in the periodic function where a maximum timeout of 200 ms is checked for
This function shall be called in the startup sequence. Hence it is a non RTE function
See FDD for more.
Module Outputs
None
None
Per: FlsMemPer2
Design Rationale
See FDD
Store Module Inputs to Local copies
Refer to FDD
(Processing of function)………
Refer to FDD
Store Local copy of outputs into Module Outputs
Refer to FDD
Server Runnables - CodFlsSngBitEcc
Design Rationale
See FDD
Store Module Inputs to Local copies
Refer to FDD
(Processing of function)………
Refer to FDD
Store Local copy of outputs into Module Outputs
Refer to FDD
Interrupt Functions
None
Module Internal (Local) Functions
Local Function #1
Function Name | (Exact name used) | Type | Min | Max |
Arguments Passed | None | <Refer MDD guidelines[1]> | <Refer MDD guidelines[1]> | <Refer MDD guidelines[1]> |
Return Value |
Design Rationale
Processing
GLOBAL Function/Macro Definitions
DtsInin
Function Name | DTSInit | Type | Min | Max |
Arguments Passed | CrcHwIdxInReg | uint32 | 0 | 0xFFFFFFFF |
CrcHwIdxOutReg | uint32 | 0 | 0xFFFFFFFF | |
Return Value | None |
Design Rationale
Trusted function that performs all register initialization from the CM102A_FlsMem_DTSPeripheralCfg.xlsx spreadsheet in the FDD. The DTSMstrCfg channel master registers can be written only in supervisor mode. After the Channel master register for a given channel has been written, the selected Processor Element can write to that channel’s registers. However, for simplicity, all DTS register initialization and chaining is being done in one trusted function.
The chaining is done in the following manner
Consider the first flash region to have the CRC calculated
Calculate the number of DTS chains required for the length of the CRC region. Each DTS channel can address up to a maximum of 0x3FFFC bytes of data (0xFFFF maximum transfer count multiplied by 4 bytes of data in each transfer).
Hence number of channel is equal to Region length/0x3FFFC + {1} if (Region length % 0x3FFFC is non zero)
Clear the DTS Transfer flag to make sure no pending requests are present for all the used channels
Configure the DTS channels starting from 0 using the configuration defined as per CM102A_FlsMem_DTSPeripheralCfg.xlsx for the above calculated number of chains
Configure the next DTS channel to transfer the CRC result from CRC HW output register to Per Instance Memory
Configure the next DTS channel to transfer zero value to the CRC HW output register to clear the output register to continue with next flash region operation
Repeat Step 1 thru 5 for all the flash regions(Boot, App, Cal1, Cal2 etc) The definition of the flash region is in the generated file CDD_FlsMem_Cfg.c which takes inputs defined in the Vector configurator Tool
Disable chaining on the last channel
Enable the Interrupt on the second last channel
Clear the interrupt status register which shall be monitored in the periodic
Start the DTS transfer
Processing
DtsClnUp
Function Name | DTSClnUp | Type | Min | Max |
Arguments Passed | None | |||
Return Value | None |
Design Rationale
None
Processing
None
Known Limitations with Design
We have made use of a static constant global variable (static const uint32 CrcClrData_M = 0U) for the purpose of clearing the CRC hardware
Also the result array (HwCrcCalcdRes_C[8]) has been also declared as a global array for the purpose of DTS write access in the MotCtrlMgr_MemMap memory map section
In the CodFlsSngBitEcc function in FDD the reads are done to the same variable. In the implementation we have used 4 different variables for the purpose that compiler wont optimize those reads. Any optimization settings change in the compiler would need a reevaluation of the use of volatile temporary variables
UNIT TEST CONSIDERATION
None
Abbreviations and Acronyms
Abbreviation or Acronym | Description |
---|---|
Glossary
Note: Terms and definitions from the source “Nexteer Automotive” take precedence over all other definitions of the same term. Terms and definitions from the source “Nexteer Automotive” are formulated from multiple sources, including the following:
ISO 9000
ISO/IEC 12207
ISO/IEC 15504
Automotive SPICE® Process Reference Model (PRM)
Automotive SPICE® Process Assessment Model (PAM)
ISO/IEC 15288
ISO 26262
IEEE Standards
SWEBOK
PMBOK
Existing Nexteer Automotive documentation
Term | Definition | Source |
---|---|---|
MDD | Module Design Document | |
DFD | Data Flow Diagram |
References
Ref. # | Title | Version |
---|---|---|
1 | AUTOSAR Specification of Memory Mapping (Link:AUTOSAR_SWS_MemoryMapping.pdf) | v1.3.0 R4.0 Rev 2 |
2 | MDD Guideline | EA4 01.00.00 |
3 | Software Naming Conventions.doc | 1.0 |
4 | Software Design and Coding Standards.doc | 2.0 |
3 - FlsMem Peer Review Checklists
Overview
Summary SheetSynergy Project
Source Code-CDD_FlsMemNonRte.c
PolySpace
Sheet 1: Summary Sheet

Sheet 2: Synergy Project
Sheet 3: Source Code-CDD_FlsMemNonRte.c
Rev 1.2 | 8-Jun-15 | |||||||||||||||||||||||
Peer Review Meeting Log (Source Code Review) | ||||||||||||||||||||||||
Source File Name: | CDD_FlsMemNonRte.c | Source File Revision: | 8 | |||||||||||||||||||||
Header File Name: | CDD_FlsMem.h | Header File Revision: | ||||||||||||||||||||||
MDD Name: | FlsMem Module Design Document | Revision: | 6 | |||||||||||||||||||||
FDD/SCIR/DSR/FDR/CM Name: | CM102A_FlsMem_Design | Revision: | 5.1.0 | |||||||||||||||||||||
Quality Check Items: | ||||||||||||||||||||||||
Rationale is required for all answers of No | ||||||||||||||||||||||||
Working EA4 Software Naming Convention followed: | ||||||||||||||||||||||||
for variable names | N/A | Comments: | ||||||||||||||||||||||
for constant names | N/A | Comments: | ||||||||||||||||||||||
for function names | N/A | Comments: | ||||||||||||||||||||||
for other names (component, memory | N/A | Comments: | ||||||||||||||||||||||
mapping handles, typedefs, etc.) | ||||||||||||||||||||||||
All paths assign a value to outputs, ensuring | N/A | Comments: | ||||||||||||||||||||||
all outputs are initialized prior to being written | ||||||||||||||||||||||||
Requirements Tracability tags in code match the requirements tracability in the FDD | N/A | Comments: | ||||||||||||||||||||||
requirements tracability in the FDD | No links in FDD | |||||||||||||||||||||||
All variables are declared at the function level. | No | Comments: | Constant moved to module level so that compiler | |||||||||||||||||||||
generates the const in flash | ||||||||||||||||||||||||
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) | Yes | Comments: | ||||||||||||||||||||||
Verified no Compiler Errors or Warnings | Yes | Comments: | ||||||||||||||||||||||
Component.h is included | Yes | Comments: | ||||||||||||||||||||||
All other includes are actually needed. (System includes | N/A | Comments: | ||||||||||||||||||||||
only allowed in Nexteer library components) | ||||||||||||||||||||||||
Software Design and Coding Standards followed: | Version: 2.1 | |||||||||||||||||||||||
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 | N/A | Comments: | ||||||||||||||||||||||
"magic numbers": [N12] | ||||||||||||||||||||||||
Memory mapping for non-RTE code | N/A | Comments: | ||||||||||||||||||||||
is per standard | ||||||||||||||||||||||||
All execution-order-dependent code can be | N/A | Comments: | ||||||||||||||||||||||
recognized by the compiler: [N80] | ||||||||||||||||||||||||
All loops have termination conditions that ensure | N/A | Comments: | ||||||||||||||||||||||
finite loop iterations: [N63] | ||||||||||||||||||||||||
All divides protect against divide by zero | N/A | Comments: | ||||||||||||||||||||||
if needed: [N65] | ||||||||||||||||||||||||
All integer division and modulus operations | N/A | Comments: | ||||||||||||||||||||||
handle negative numbers correctly: [N76] | ||||||||||||||||||||||||
All typecasting and fixed point arithmetic, | N/A | 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. | N/A | Comments: | ||||||||||||||||||||||
float value is non-negative: [N67] | ||||||||||||||||||||||||
All conversions between signed and unsigned | N/A | Comments: | ||||||||||||||||||||||
types handle msb==1 as intended: [N78] | ||||||||||||||||||||||||
All pointer dereferencing protects against | N/A | Comments: | ||||||||||||||||||||||
null pointer if needed: [N70] | ||||||||||||||||||||||||
Component outputs are limited to the legal range | N/A | 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 | N/A | Comments: List Anomaly or CR numbers | ||||||||||||||||||||||
for any FDD corrections needed | ||||||||||||||||||||||||
General Notes / Comments: | ||||||||||||||||||||||||
Reviewed changes only | ||||||||||||||||||||||||
Change Owner: | Avinash James | Review Date : | 09/01/16 | |||||||||||||||||||||
Lead Peer Reviewer: | Selva Sengottaiyan | Approved by Reviewer(s): | Yes | |||||||||||||||||||||
Other Reviewer(s): | ||||||||||||||||||||||||