NvMProxy_MDD

Module -- NvM Proxy

High-Level Description

(Description must be within 8-10 lines.)

Figures

Diagram – Function Data Sharing

This diagram depicts the physical memory allocation for the various parts of the NvM Proxy system. 3 application RAM areas are shown for illustrative purposes, however, this module can handle any number of application RAM areas.

The memory stack components below the NvM are not shown in this diagram to promote clarity.

The NvMProxy_CmdQueue is required to be allocated to global shared memory to provide write access to the Proxy server function that is designed to be called from any application.

Diagram – NvM Data Initialization

Depiction of the Nv Data initialization sequence from the perspective of which application is active (i.e. MPU configuration at the time of operation execution)

Only pertinent initialization functions and steps are shown to promote clarity.

Diagram – NvM Runtime

Following is a depiction of the write Motor Position EOL calibrations via diagnostic service request. The MtrPos component is assumed to be running in the ASIL D application and its server runnable for processing an EOL motor cal write request is assumed to invoke the NvM_WriteBlock operation.

The lifelines in this diagram represent execution within the Os or an application. The details of the diagnostic service request are omitted from this diagram for clarity purposes.


Variable Data Dictionary

For details on module input / output variable, refer to the Data Dictionary for the application. Input / output variable names are listed here for reference.

Module InputsModule Outputs
Configured by NvMProxyCfgNone

Module Internal Variables

This section identifies the name, range and resolutions for module specific data created by this module. If there are no range restrictions on the variable, the term “FULL” is placed into the table for legal range.

Variable NameResolution

Legal Range

(min)

Legal Range

(max)

Software Segment
NvMPWriteRqst_Cnt_M_Str[D_NUMPRXYBLOCKS_CNT_U16]See NvMPWriteBuff_TypeSee NvMPWriteBuff_TypeSee NvMPWriteBuff_TypeNVMPROXY_START_SEC_VAR_CLEARED_UNSPECIFIED
NvMPSetRBSRqst_Cnt_M_Str[D_NUMPRXYBLOCKS_CNT_U16]See NvMPSetRBSBuff_TypeSee NvMPSetRBSBuff_TypeSee NvMPSetRBSBuff_TypeNVMPROXY_START_SEC_VAR_CLEARED_UNSPECIFIED

User defined typedef definition/declaration

This section documents any user types uniquely used for the module.

Typedef NameElement NameUser Defined Type

Legal Range

(min)

Legal Range

(max)

NvMProxyCfg_TypeNvMBlockNvM_BlockIdType0FULL
unsecurePtrconstant uint8* to variable dataNANA
securePtrconstant uint8* to variable dataNANA
secureSizeuint160FULL
initHandlingNvMProxy_InitHandlingSee DatatypeSee Datatype
failResponseNvMProxy_FailResponseSee DatatypeSee Datatype
failActDataNvMP_FailActionDataTypeSee DatatypeSee Datatype
failActFuncNvMP_FailActionFuncTypeSee DatatypeSee Datatype
NvMProxy_InitHandlingNVMPROXY_NONEuint800
NVMPROXY_CRC16uint811
NVMPROXY_REDUNDANTuint822
NVMPROXY_ZERODATAuint833
NvMProxy_FailResponseNVMPROXY_NOTAPPLICABLEuint800
NVMPROXY_NTC_0Auint811
NVMPROXY_NTC_08_ROMDEFuint822
NVMPROXY_NTC_08_NOTIFFUNCuint833
NVMPROXY_NTC_07_ROMDEFuint844
NVMPROXY_NTC_07_NOTIFFUNCuint855
NVMPROXY_NTC_06_ROMDEFuint866
NVMPROXY_NTC_06_NOTIFFUNCuint877
NvMP_FailActFuncTypePointer to void functionpointerN/AN/A
NvMP_FailActionDataTypePointer to uint8pointerN/AN/A
NvMPWriteBuff_TypePendboolean0FULL
BlkStatusNvM_RequestResultType0FULL
SrcPtruint8*NANA
NvMPSetRBSBuff_TypePendboolean0FULL
BlockChangedbooleanNANA

Constant Data Dictionary

Calibration Constants

This section lists the calibrations used by the module. For details on calibration constants, refer to the Data Dictionary for the application.

Constant Name
<None>

Configuration Constants

This section lists the configuration constants used by the module. For details on configuration constants, refer to the Module User Guide. The values are set by the integration project specific configuration files Cd_NvMProxy_Cfg.h and Cd_NvMProxy_PBcfg.c

Constant NameType
NvMProxyCfg [D_NUMPRXYBLOCKS_CNT_U16]NvMProxyCfg_Type

Program(fixed) Constants

Embedded Constants

All embedded constants whose values are provided in Eng units will be evaluated to the equivalent counts by using the FPM_InitFixedPoint_m() macro within the #define statement.

Local

Constant NameResolutionUnitsValue
D_NUMPRXYBLOCKS_CNT_U161CountConfigured in integration project
NVMPROXY_EXCLUSIVE_AREA_0NANAGenerated by SchM
D_CRC16SIZE_CNT_U161Count2

Global

This section lists the global constants used by the module. For details on global constants, refer to the Data Dictionary for the application.

Constant Name
<None>

Module specific Lookup Tables Constants

(This is for lookup tables (arrays) with fixed values, same name as other tables)

Constant NameResolutionValueSoftware Segment
None


Functions/Macros used by the Sub-Modules

Library Functions / Macros

The library and functions / Macros that are called by the various sub modules are identified below,

Data Hiding Functions

  1. NvM_WriteAll()

  2. NvM_WriteBlock()

  3. NvM_SetRamBlockStatus()

  4. NvM_GetErrorStatus()

  5. SchM_Enter_NvMProxy()

  6. SchM_Exit_NvMProxy()

Global Functions/Macros Defined by this Module

NvMProxy_WriteAll

Function NameNvMProxy_WriteAllTypeMinMaxUTP Tol.
Arguments PassedNone
Return ValueN one

Description

This function implements the AUTOSAR standard API for the NvM BSW WriteAll service. The interface must adhere to the AUTOSAR standard to allow mapping service port needs of SWC’s located in outside the QM application to this component’s service interface via the Rte.

NvMProxy_WriteBlock

Function NameNvMProxy_WriteBlockTypeMinMaxUTP Tol.
Arguments PassedBlockNvM_BlockIdType
SrcPtruint8
Return ValueresultStd_ReturnType

Description

This function implements the AUTOSAR standard API for the NvM BSW WriteBlock service. The interface must adhere to the AUTOSAR standard to allow mapping service port needs of SWC’s located in outside the QM application to this component’s service interface via the Rte.

NvMProxy_GetErrorStatus

Function NameNvMProxy_GetErrorStatusTypeMinMaxUTP Tol.
Arguments PassedBlockNvM_BlockIdType
RequestResultPtruint8*
Return ValueN one

Description

This function implements the AUTOSAR standard API for the NvM BSW GetErrorStatus service. The interface must adhere to the AUTOSAR standard to allow mapping service port needs of SWC’s located in outside the QM application to this component’s service interface via the Rte.

NvMProxy_SetRamBlockStatus

Function NameNvMProxy_SetRamBlockStatusTypeMinMaxUTP Tol.
Arguments PassedBlockNvM_BlockIdType
BlockChangedboolean
Return ValueN one

Description

This function implements the AUTOSAR standard API for the NvM BSW SetRamBlockStatus service. The interface must adhere to the AUTOSAR standard to allow mapping service port needs of SWC’s located in outside the QM application to this component’s service interface via the Rte.

Local Functions/Macros Used by this MDD only

Software Module Implementation

Runtime Environment (RTE) Initial Values

This section lists the initial values of data written by this module but controlled by the RTE. After RTE initialization, the data in this table will contain these values.

DataValue
<None>

Initialization Functions

Init: NvMProxy_Init

Design Rationale

Transfer the data from the unsecured Nv Data memory buffer to the secured Nv Data memory buffer and initialize the block status shadow to the values returned by the NvM API.

Module Outputs

Module Internal

NvMPWriteRqst_Cnt_M_Str = 0*

NvMPSetRBSRqst_Cnt_M_Str = 0*

* Cleared by memory clear function and not explicitly cleared in this init function


Periodic Functions

Per: NvMProxy_MainFunction

Design Rationale

This function is responsible for forwarding the queued NvM requests to the NvM driver in a SchM task running the NvM BSW.

This function copies the secured data area to the unsecured data area.

Program Flow Start

None

Store Module Inputs to Local copies

None

Processing of function

Store Local copy of outputs into Module Outputs

None

Program Flow End

None


Fault Recovery Functions

None

Shutdown Functions

None

Interrupt Functions

None

Serial Communication Functions

None


Execution Requirements

Execution Sequence of the Module

NvMProxy_Init must be scheduled after to NvM_ReadAll is completed. Additionaly NvMProxy_Init must be executed as a trusted function to grant rights for initializing the secured memory. This would typically be accomplished via an Os trusted function call API.

NvMProxy_MainFunction should be scheduled prior to NvM_MainFunction. This provides the minimal amount of lag in forwarding and processing NvM service requests.

Execution Rates for sub-modules called by the Scheduler

This table serves as reference for the Scheduler design

Function NameCalling FrequencySystem State(s) in which the function is called
NvMProxy_InitOnce during startupCOLD INIT
NvMProxy_MainFunctionSame as NvM_MainFunctionSame as NvM_MainFunction

Execution Requirements for Serial Communication Functions

Function NameSub-Module called by (Serial Comm Function Name)
<None>


Memory Map Definition Requirements

Sub Modules (Functions)

This table identifies the software segments for functions identified in this module.

Name of Sub ModuleSoftware Segment
NvMProxy_InitNVMPROXY_START_SEC_CODE
NvMProxy_MainFunctionNVMPROXY_START_SEC_CODE
NvMProxy_WriteAllNVMPROXY_START_SEC_CODE
NvMProxy_WriteBlockNVMPROXY_START_SEC_CODE
NvMProxy_SetRamBlockStatusNVMPROXY_START_SEC_CODE
NvMProxy_GetErrorStatusNVMPROXY_START_SEC_CODE

Local Functions

This table identifies the software segments for local functions identified in this module.

Name of Sub ModuleSoftware Segment
None


Known Issues / Limitations With Design


Revision Control Log

Item #Rev #Change DescriptionDateAuthor Initials
1Initial creation21-Mar-12JJW
2Corrected anomaly 4437 in NvMProxy init routine01-Mar-13KJS
330-May-13JJW
4Added CRC and Redundant block checking ability22-Nov-13LWW
Last modified October 12, 2025: Initial commit (0347a62)