This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Nvm Manager

1 - Fee_Interface_MDD

Module --

High-Level Description

This module contains the specific interfacing functions that are needed for TI’s Fee Driver. This includes an initialization routine and configurable trusted function interfaces that allow compatibility with the NvM/MemIf BSW.

Figures

Diagram – Function Data Sharing

N/A

Diagram – Function (Name)

N/A


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

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

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)

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>

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
<None>

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,

  1. <None>

Data Hiding Functions

  1. <None>

Global Functions/Macros Defined by this Module

Global Functions Defined if BC_FEEIF_ECUSTARTUPTRUSTED == STD_OFF

TWrapC_FeeIf_Init

This is the client (non-trusted) side of the FeeIf_Init Trusted Function

Function NameTWrapC_FeeIf_InitTypeMinMaxUTP Tol.
Arguments PassedNone
Return ValueN/A
Description

TRUSTED_TWrapS_FeeIf_Init

This is the server (trusted) side of the FeeIf_Init Trusted Function

Function NameTRUSTED_TWrapS_FeeIf_InitTypeMinMaxUTP Tol.
Arguments PassedFunctionIndexTrustedFunctionIndexType
FunctionParamsTrustedFunctionParameterRefType
Return ValueN/A
Description

TWrapC_Fee_MainFunction

This is the client (non-trusted) side of the Fee_MainFunction Trusted Function

Function NameTWrapC_Fee_MainFunctionTypeMinMaxUTP Tol.
Arguments PassedNone
Return ValueN/A
Description

TRUSTED_TWrapS_Fee_MainFunction

This is the server (trusted) side of the Fee_MainFunction Trusted Function

Function NameTRUSTED_TWrapS_Fee_MainFunctionTypeMinMaxUTP Tol.
Arguments PassedFunctionIndexTrustedFunctionIndexType
FunctionParamsTrustedFunctionParameterRefType
Return ValueN/A
Description

Global Functions Defined if BC_FEEIF_NVMTRUSTED == STD_OFF

TWrapC_Fee_Read

This is the client (non-trusted) side of the Fee_Read Trusted Function

Function NameTWrapC_Fee_ReadTypeMinMaxUTP Tol.
Arguments PassedBlockNumberuint16
BlockOffsetuint16
DataBufferPtruint8*
Lengthuint16
Return Valuemyargs.TWrapS_Fee_Read_args.os_resultStd_ReturnType
Description

TRUSTED_TWrapS_Fee_Read

This is the server (trusted) side of the Fee_Read Trusted Function

Function NameTRUSTED_TWrapS_Fee_ReadTypeMinMaxUTP Tol.
Arguments PassedFunctionIndexTrustedFunctionIndexType
FunctionParamsTrustedFunctionParameterRefType
Return ValueN/A
Description

TWrapC_Fee_Write

This is the client (non-trusted) side of the Fee_Write Trusted Function

Function NameTWrapC_Fee_WriteTypeMinMaxUTP Tol.
Arguments PassedBlockNumberuint16
DataBufferPtruint8*
Return Valuemyargs.TWrapS_Fee_Write_args.os_resultStd_ReturnType
Description

TRUSTED_TWrapS_Fee_Write

This is the server (trusted) side of the Fee_Write Trusted Function

Function NameTRUSTED_TWrapS_Fee_WriteTypeMinMaxUTP Tol.
Arguments PassedFunctionIndexTrustedFunctionIndexType
FunctionParamsTrustedFunctionParameterRefType
Return ValueN/A
Description

TWrapC_Fee_EraseImmediateBlock

This is the client (non-trusted) side of the Fee_EraseImmediateBlock Trusted Function

Function NameTWrapC_Fee_EraseImmediateBlockTypeMinMaxUTP Tol.
Arguments PassedBlockNumberuint16
Return Valuemyargs.TWrapS_Fee_EraseImmediateBlock_args.os_resultStd_ReturnType
Description

TRUSTED_TWrapS_Fee_EraseImmediateBlock

This is the server (trusted) side of the Fee_EraseImmediateBlock Trusted Function

Function NameTRUSTED_TWrapS_Fee_EraseImmediateBlockTypeMinMaxUTP Tol.
Arguments PassedFunctionIndexTrustedFunctionIndexType
FunctionParamsTrustedFunctionParameterRefType
Return ValueN/A
Description

TWrapC_Fee_InvalidateBlock

This is the client (non-trusted) side of the Fee_InvalidateBlock Trusted Function

Function NameTWrapC_Fee_InvalidateBlockTypeMinMaxUTP Tol.
Arguments PassedBlockNumberuint16
Return Valuemyargs.TWrapS_Fee_InvalidateBlock_args_args.os_resultStd_ReturnType
Description

TRUSTED_TWrapS_Fee_InvalidateBlock

This is the server (trusted) side of the Fee_InvalidateBlock Trusted Function

Function NameTRUSTED_TWrapS_Fee_InvalidateBlockTypeMinMaxUTP Tol.
Arguments PassedFunctionIndexTrustedFunctionIndexType
FunctionParamsTrustedFunctionParameterRefType
Return ValueN/A
Description

TWrapC_Fee_Cancel

This is the client (non-trusted) side of the Fee_Cancel Trusted Function

Function NameTWrapC_Fee_CancelTypeMinMaxUTP Tol.
Arguments PassedNone
Return ValueN/A
Description

TRUSTED_TWrapS_Fee_Cancel

This is the server (trusted) side of the Fee_Cancel Trusted Function

Function NameTRUSTED_TWrapS_Fee_CancelTypeMinMaxUTP Tol.
Arguments PassedFunctionIndexTrustedFunctionIndexType
FunctionParamsTrustedFunctionParameterRefType
Return ValueN/A
Description

TWrapC_Fee_GetStatus

This is the client (non-trusted) side of the Fee_GetStatus Trusted Function

Function NameTWrapC_Fee_GetStatusTypeMinMaxUTP Tol.
Arguments PassedNone
Return Valuemyargs.TWrapS_Fee_GetStatus_args.os_resultuint8
Description

TRUSTED_TWrapS_Fee_GetStatus

This is the server (trusted) side of the Fee_GetStatus Trusted Function

Function NameTRUSTED_TWrapS_Fee_GetStatusTypeMinMaxUTP Tol.
Arguments PassedFunctionIndexTrustedFunctionIndexType
FunctionParamsTrustedFunctionParameterRefType
Return ValueN/A
Description

TWrapC_Fee_GetJobResult

This is the client (non-trusted) side of the Fee_GetJobResult Trusted Function

Function NameTWrapC_Fee_GetJobResultTypeMinMaxUTP Tol.
Arguments PassedNone
Return Valuemyargs.TWrapS_Fee_GetJobResult_args.os_resultuint8
Description

TRUSTED_TWrapS_Fee_GetJobResult

This is the server (trusted) side of the Fee_GetJobResult Trusted Function

Function NameTRUSTED_TWrapS_Fee_GetJobResultTypeMinMaxUTP Tol.
Arguments PassedFunctionIndexTrustedFunctionIndexType
FunctionParamsTrustedFunctionParameterRefType
Return ValueN/A
Description

TWrapC_TI_Fee_SuspendResumeErase

This is the client (non-trusted) side of the TI_Fee_SuspendResumeErase Trusted Function

Function NameTWrapC_TI_Fee_SuspendResumeEraseTypeMinMaxUTP Tol.
Arguments PassedCommanduint801
Return ValueN/A
Description

While the command type is a uint8, the actual type is TI_Fee_EraseCommandType.

TRUSTED_TWrapS_TI_Fee_SuspendResumeErase

This is the server (trusted) side of the TI_Fee_SuspendResumeErase Trusted Function

Function NameTRUSTED_TWrapS_TI_Fee_SuspendResumeEraseTypeMinMaxUTP Tol.
Arguments PassedFunctionIndexTrustedFunctionIndexType
FunctionParamsTrustedFunctionParameterRefType
Return ValueN/A
Description

Local Functions/Macros Used by this MDD only

Local Function #1

Function NameNoneTypeMinMaxUTP Tol.
Arguments Passed
Return Value

Description

N/A

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

(Note: For multiple init functions, insert new headers at the “Header 2” level – subset of “5.1 Initialization Functions” and follow the same sub-section design shown below)

Init: FeeIf_Init

Design Rationale

This function initializes the FEE driver. After the FEE BSW initialization, the Fee_MainFunction is required to be called until the FEE reports a status that is not busy. This is required because the NvM/MemIf BSWs currently make the assumption that the FEE driver will not be busy at initialization; however, the FEE driver may be busy if it has to finish any virtual sector swapping that may have been interrupted (i.e. the NvM currently can issue a new FEE command to the driver without first checking the FEE internal status the very first time after a new power cycle).

Module Outputs

None

Module Internal

None

Processing


Periodic Functions

None


Fault Recovery Functions

None


Shutdown Functions

None


Interrupt Functions

None


Serial Communication Functions

None


Execution Requirements

Execution Sequence of the Module

See Integration Manual

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
<None>

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

Local Functions

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

Name of Sub ModuleSoftware Segment


Known Issues / Limitations With Design

  1. FeeIf_Init currently does not implement any of the available error recovery mechanisms in the case of an issue with the FEE driver. Additionally, it doesn’t set any faults or report out any errors to the user if one of these FEE memory errors occur.

  2. For the provided trusted functions, there is currently neither checking on the passed parameters nor checking on the caller of the trusted function. It was unclear during the current design if either of these was necessary.

  3. This MDD is currently missing some datatype definition and ranges (specifically for the trusted function call wrappers). The assumption was that these would not need to be unit tested and were for design documentation only.


Revision Control Log

Item #Rev #Change DescriptionDateAuthor Initials
11Initial version07/15/13LWW
21.1.1Added suspend/resume erase functions11/04/14KJS
31.1.2Added FEE Single bit ECC correction12/15/14PS
43.1.1Updated FEE component and removed Nexteer FEE ECC workaround1/27/15PS

2 - NvMMgr_Integration_Manual

Integration Manual –NvMMgr

Table of Contents

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

SWCs

ModuleRequired Feature
NvMEntire BSW
MemIfEntire BSW

Note : Referencing the external components should be avoided in most cases. Only in unavoidable circumstance external components should be refered. Developer should track the references.

Global Functions(Non RTE) to be provided to Integration Project

FeeIf

There are differing functions provided by this module depending on how it is configured through configurator. These functions are listed below based on the generated configuration. The main idea is that if the configuration is going to require configuring trusted function calls through the O/S because of the requirement that the fee driver must execute in a privileged/trusted mode, the wrapper functions to implement the trusted functions will be provided by this module automatically. The notes indicate the intended caller of the function (be it the integrator, another BSW (O/S or MemIf), or if the function is strictly called internally by this module).

Functions provided if BC_FEEIF_ECUSTARTUPTRUSTED == STD_OFF

  • FeeIf_Init (for NvMMgr internal use only)

  • TWrapC_FeeIf_Init (for integrator scheduling)

  • TRUSTED_TWrapS_FeeIf_Init (for O/S)

  • TWrapC_Fee_MainFunction (for integrator scheduling)

  • TRUSTED_TWrapS_Fee_MainFunction (for O/S)

Functions provided if BC_FEEIF_ECUSTARTUPTRUSTED == STD_ON

  • FeeIf_Init (for integrator scheduling)

Functions provided if BC_FEEIF_NVMTRUSTED == STD_OFF

  • TWrapC_Fee_Read (for MemIf)

  • TRUSTED_TWrapS_Fee_Read (for O/S)

  • TWrapC_Fee_Write (for MemIf)

  • TRUSTED_TWrapS_Fee_Write (for O/S)

  • TWrapC_Fee_EraseImmediateBlock (for MemIf)

  • TRUSTED_TWrapS_Fee_EraseImmediateBlock (for O/S)

  • TWrapC_Fee_InvalidateBlock (for MemIf)

  • TRUSTED_TWrapS_Fee_InvalidateBlock (for O/S)

  • TWrapC_Fee_Cancel (for MemIf)

  • TRUSTED_TWrapS_Fee_Cancel (for O/S)

  • TWrapC_Fee_GetStatus (for MemIf)

  • TRUSTED_TWrapS_Fee_GetStatus( for O/S)

  • TWrapC_Fee_GetJobResult(for MemIf)

  • TRUSTED_TWrapS_Fee_GetJobResult (for O/S)

  • TWrapC_TI_Fee_SuspendResumeErase (for MemIf)

  • TRUSTED_TWrapS_TI_Fee_SuspendResumeErase (for O/S)

Fee Subproject

Please refer to BSW AUTOSAR specification. Integrator only responsible for scheduling Fee_MainFunction(). Other APIs are used by NvM/MemIf BSWs and FeeIf.

Fls Subproject

APIs not typically used in integration project except by Fee BSW. Please refer to TI documentation for API descriptions.

Configuration

Build Time Config

ModulesNotes
None

Configuration Files to be provided by Integration Project

<Configuration file that will generated from this components that will require Da Vinci Config generation or manual generation. Describe each parameter >

Da Vinci Parameter Configuration Changes

ParameterNotesSWC
/NvMMgr/NvMMrGeneral/EcuStartupAppIntegrator to choose the application that the EcuStartup Init2 routine will execute from. This will allow the generator to determine the value of BC_FEEIF_ECUSTARTUPTRUSTEDNvMMgr
/NvMMgr/NvMMrGeneral/NvMandMemIfAppIntegrator to choose the application that the NvM and MemIf functions will execute from (NvM_MainFunction). This will allow the generator to determine the value of BC_FEEIF_NVMTRUSTEDNvMMgr
/NvM/NvmCommon/NvmPollingModeMust be set to “True” since current Fee Driver only supports Polling ModeNvM
/NvM/Nvm_30_CommonVendorParams/NvmKillWriteAllApiMust be set to “False” if BC_FEEIF_NVMTRUSTED == STD_OFF for current Vector NvM delivered BSW. This is required since there is a critical section that wraps around the call to the FEE driver WriteBlock API in NvM if the KillWriteAllApi is turned on. The current strategy of using trusted function calls for the FEE APIs is not allowed by the O/S within a critical section that is disabling all interrupts. If the KillWriteAllApi is required in the future, a different critical section handling strategy may need to be investigated for the NvM driver.NvM
/Fee/FeeGeneral/FeeDevErrorDetectDetermines if Fee makes use of DET moduleFee
/Fee/FeeGeneral/FeeCRCEnableThis should be set to “False” for Nexteer use case. If set to “True” a Fletcher checksum will be used to determine if the data to be written to FEE is the same as the data currently in FEE memory. Because different data can result in the same checksum, this opens up an opportunity for writes to be lost. Setting this to “False” will cause Fee to do a direct byte-by-byte comparison of the data instead of using the checksum.Fee
/Fee/FeeGeneral/FeeWriteCounterSaveThis should be set to “False” for Nexteer use case. This enables writing a counter for each block to indicate how many times it was written. Currently, the Fee driver doesn’t use this data and it is not accessible through the API so overhead of writing provides no benefit currently.Fee
/Fee/FeeGeneral/FeeNumberOfUnconfiguredBlocksToCopyThis parameter is used to tell the Fee Driver how many blocks it should support copying during a virtual sector swap that are not part of the Fee configuration. There are two main uses of this parameter. One is to allow compatibility when flashing different version of application software with differing NvM maps. Another is to allow a bootloader to have a reduced Fee configuration compared to the application (and not having to update the bootloader every time the application NvM map changes). An application should have a large enough value to support compatibility with different application versions (so it depends on how close to a final production NvM map is integrated). The closer to the final NvM map, the smaller this number can be. A bootloader should have a large value in this parameter (larger than the number of blocks expected in the application at start of production).Fee
/Fee/FeeGeneral/FeeNumberOfEightByteWritesIndicates to the Fee Driver how many sets of 8 bytes are written per Fee mainfunction cycle. Typical Nexteer setting is 128 (allowing 1024 bytes of data per mainfunction loop). From timing analysis, writing this much data was still under the timing the mainfunction took when Fee was doing a virtual sector swap. It would be preferable that this parameter is at least as large as the largest size block configured.Fee
/Fee/FeeSectorConfiguration#

See the following picture for typical Nexteer usage:

SectorConfig.TIF

Fee
/Fee/FeeBlockConfiguration#Integration project specific. See notes in Integration section.Fee
/Fee/FeeGeneral/FeeNvmJobEndNotificationShould be set to NvM_JobEndNotification, however, unused currently since Fee Driver only supports NvM in polling modeFee
/Fee/FeeGeneral/FeeNvmJobErrorNotificationShould be set to NvM_JobErrorNotification, however, unused currently since Fee Driver only supports NvM in polling modeFee
/Fee/FeeGeneral/FeeFrequencySet to the clock frequency (in MHz) that the uController is running at. Typical value of 160Fee
/Fee/FeeGeneral/FeePollingModeMust be set to “True” since current Fee Driver only supports Polling ModeFee
/Fee/FeeGeneral/FeeEnableErrorCorrectionTypically set to “False” for Nexteer use – not currently used at all by the Fee Driver. Please note that single bit ECC data correction will still occur even if this setting is false.Fee
/Fee/FeeTypes/FeeFlashErrCorrHandlingTypeTypically set to “None” for Nexteer use since critical NvM data is validated by other mechanisms. Please note that single bit ECC data correction will still occur even if this setting is false.Fee
/Fee/FeeGeneral/FeeNumberofEEPSTypically set to 2 for Nexteer use to enable support of two independent EEPROMs. In a bootloader it may be desired to only setup one so the bootloader doesn’t have access to the other.Fee
/Fee/FeeGeneral/FeeNumberOfVirtualSectorsEEP1Typically set to 2 for Nexteer use to enable support of two independent EEPROMs. Note this is only required if there is more than one EEPROM configured (see above).Fee
/Fee/FeeGeneral/FeeVersionInfoApiTypically set to “False” for Nexteer usage since currently the Version number is not usedFee

DaVinci Interrupt Configuration Changes

ISR NameVIM #Priority DependencyNotes
None

Manual Configuration Changes

ConstantNotesSWC
None

Integration

General Notes and O/S Configuration for Trusted Functions:

Please note that this module currently only contains the Fee related files of the AUTOSAR memory stack. It is assumed that NvM and MemIf components are already integrated. The entire Fee and Fls modules must be configured to be run in a privileged/trusted mode on the uController. Because of this and depending on the configuration of the project being integrated into, trusted functions may be required to be setup in the O/S. The following tables show which trusted functions need to be configured in the O/S in the application that Fee and Fls will reside in. The Cd_NvMMgr_Cfg.h file that is generated by configurator will show the integration project build constant settings (BC_FEEIF_ECUSTARTUPTRUSTED, BC_FEEIF_NVMTRUSTED) that are referenced below.

Trusted Function NamePassed ParametersReturn Type
Trusted Functions to Setup In O/S if BC_FEEIF_ECUSTARTUPTRUSTED == STD_OFF
TWrapS_FeeIf_Initvoidvoid
TWrapS_Fee_MainFunctionvoidvoid
Trusted Functions to Setup In O/S if BC_FEEIF_NVMTRUSTED == STD_OFF
TWrapS_Fee_Readuint16 BlockNumber,uint16 BlockOffset,uint8* DataBufferPtr,uint16 LengthStd_ReturnType
TWrapS_Fee_Writeuint16 BlockNumber,uint8* DataBufferPtrStd_ReturnType
TWrapS_Fee_EraseImmediateBlockuint16 BlockNumberStd_ReturnType
TWrapS_Fee_InvalidateBlockuint16 BlockNumberStd_ReturnType
TWrapS_Fee_Cancelvoidvoid
TWrapS_Fee_GetStatusvoiduint8Note1
TWrapS_Fee_GetJobResultvoiduint8Note1
TWrapS_TI_Fee_SuspendResumeEraseuint8 Note2void

Note1 - Please note that the actual return type of Fee_GetStatus is an enumeration of type MemIf_StatusType and the actual return type of Fee_GetJobResult is an enumeration of type MemIf_JobResultType. Due to a current limitation of the include path control of trusted functions in the O/S, the trusted functions are setup with standard uint8 return types and appropriate typecasting is used where needed. This is acceptable under the assumption that the enumerations will resolve into an underlying uint8 type on the target. This workaround can be removed from the component if in the future the O/S provides a better mechanism for header inclusion in the trusted functions.

Note2 – Similar to Note1, the data type passed into the SuspendResumeErase function is an enumerated value TI_Fee_EraseCommandType. The input is type casted in the Cd_FeeIf.c function call to the correct type.


TI_Fee_SuspendResumeErase:

Please see the TI documentation for details on when and how to use this feature.

--- IMPORTANT ---

The files for Configurator do not currently support the latest Fee driver. The integrator will need to modify the generated Fee_Cfg.h file and create a definition for FEE_TOTAL_BLOCKS_DATASETS.

This value is calculated by summing the number of data sets for each NvM block. For example, if a configuration contained three NvM entries, one entry was a native block (Number of data sets = 1), one entry was a redundant block (Number of data sets = 2), and the final block was a data set with the number of sets set to 10. The value for FEE_TOTAL_BLOCKS_DATASETS would be (1) + (2) + (10) or 13.

This value should be added as a #define at the end of the Fee_Cfg.h.

Once the updated Configurator files have been delivered and integrated into the component baseline, this table can be removed.

Fapi_UserDefinedFunctions.c:

This file provides a function that is required for the TI flash library (FLS subproject). It is technically supposed to be user-configurable based on if special watchdog servicing code is required during the execution of the flash library functions; however, Nexteer’s typical use case does not need special handling, so an empty stub function is provided in the NvMMgr component for integration.

NvM BSW Configuration:

Please note that the current Fee driver REQUIRES NvM to be placed into “Polling Mode”. Please see NvM configuration parameter (/NvM/NvmCommon/NvmPollingMode).

Special MemMap MemIf Settings if BC_FEEIF_NVMTRUSTED == STD_OFF:

Since the Fee driver requires to be run in a privileged/trusted mode, the calls into Fee must be intercepted by the O/S and replaced by trusted function calls to put the uController into a privileged mode before executing any Fee functions. Unfortunately, the current MemIf BSW does not allow user-configurable Fee API function calls to allow this. A workaround has been developed by macro-replacing the Fee APIs with the trusted function APIs in the MemMap statement around the MemIf Fee API function pointer table. The following is a reference that can be used to apply this workaround in the integration project MemMap.h file:

#ifdef MEMIF_START_SEC_CONST_32BIT

#undef MEMIF_START_SEC_CONST_32BIT

#include "Cd_FeeIf.h"

#define START_SEC_CONST_32BIT

#define Fee_Read TWrapC_Fee_Read

#define Fee_Write TWrapC_Fee_Write

#define Fee_EraseImmediateBlock TWrapC_Fee_EraseImmediateBlock

#define Fee_InvalidateBlock TWrapC_Fee_InvalidateBlock

#define Fee_Cancel TWrapC_Fee_Cancel

#define Fee_GetStatus (MemIf_ApiGetJobResultType)TWrapC_Fee_GetStatus

#define Fee_GetJobResult (MemIf_ApiGetJobResultType)TWrapC_Fee_GetJobResult

#endif

#ifdef MEMIF_STOP_SEC_CONST_32BIT

#undef MEMIF_STOP_SEC_CONST_32BIT

#define STOP_SEC_CONST

#undef Fee_Read

#undef Fee_Write

#undef Fee_EraseImmediateBlock

#undef Fee_InvalidateBlock

#undef Fee_Cancel

#undef Fee_GetStatus

#undef Fee_GetJobResult

#endif

Fee EEPROM strategy and Block Configuration Notes:

The Fee Driver allows configuration of two independent EEPROMs. Nexteer’s strategy for usage of these two EEPROMs is to use one (FEE0) for data that is written once or very infrequently and to use one (FEE1) for data written frequently. The following shows some general guidelines for what data should fall into each FEE:

  • FEE0:

    • Most data written during Nexteer or Customer Manufacturing process (cals, partnumbers)

    • Bootloader and bootloader/application shared data

  • FEE1:

    • TypeH Data

    • Learned algorithmic data

    • DTC/NTC Fault Information

    • Data updated every ignition cycle (e.g. Ignition Counter, EEPROM close check)

    • Nexteer/Customer MEC

In FEE0, all of the bootloader required NvM blocks should be configured starting at block number 1 and be continuously sequentially incrementing. This forces the requirement that all bootloader data must be defined correctly for the first bootloader release with Fee integrated (or else compatibility issues will have to be considered).

Additionally, once a Fee block is defined in an application, it should never be removed. If the block becomes removed and is no longer needed, it should become a deprecated block. This strategy will ensure compatibility between software versions. Removal of configured blocks should be done only if software compatibility is not a concern as determined by program consensus!!

CCS Global Settings:

Code Composer Studio automatically searches all project folders for .c files to be included in a build. The Fee subproject has some vector template files in the “generate” folder that have an extension of .c and .h that are encrypted and should not be part of this build. To work around this, it is suggested to globally apply a filter to exclude all folders called “generate” from the build in code composer project settings (note this approach assumes ALL generate folders do not contain files required as part of the build). This can be done in the CCS project properties “Resource Filters”.

Required Global Data Inputs

None

Required Global Data Outputs

None

Specific Include Path present

Yes (including for Fee and Fls sub-projects)

Runnable Scheduling

This section specifies the required runnable scheduling. It is divided showing the requirements based on the configuration of the module.

Integrator Common Scheduling in all configurations

RunnableScheduling RequirementsTrigger
Fee_MainFunctionScheduled in SchM task periodically. Must be run from a trusted application. Note it is highly recommended that this function run in the lowest priority task (just above the background task) since it can take a long time to execute during virtual sector swapping.SchM 100ms typical

Integrator Scheduling if BC_FEEIF_ECUSTARTUPTRUSTED == STD_OFF

InitScheduling RequirementsTrigger
TWrapC_FeeIf_InitExecuted in EcuStartup Init2 (after O/S starts but before RTE start) prior to NvM UploadOnce prior to RTE Start
RunnableScheduling RequirementsTrigger
TWrapC_Fee_MainFunctionIn a tight loop during NvM upload process after the NvM_MainFunction (typically in Appl_WaitNvMReady())N/A

Integrator Scheduling if BC_FEEIF_ECUSTARTUPTRUSTED == STD_ON

InitScheduling RequirementsTrigger
FeeIf_InitExecuted in EcuStartup_Init2 (after O/S starts but before RTE start) prior to NvM UploadOnce prior to RTE Start
RunnableScheduling RequirementsTrigger
Fee_MainFunctionIn a tight loop during NvM upload process after the NvM_MainFunction (typically in Appl_WaitNvMReady())N/A

.

Memory Mapping

Mapping

Memory SectionContentsNotes
FEE_START_SEC_CODEPlease note that a VAR section must be opened and closed for this section for placement of function level static variables. The VAR section must be mapped to a trusted application.
FEE_START_SEC_CONST_UNSPECIFIED
FEE_START_SEC_VAR_INIT_UNSPECIFIEDMust be mapped to a trusted application.
F021_API_CortexR4_BE_V3D16.libAll RAM for this library must be mapped to a trusted application.

* 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
N/A

Non RTE NvM Blocks

Block Name
N/A

Note : Size of the NVM block if configured in developer

RTE NvM Blocks

Block Name
N/A

Note : Size of the NVM block if configured in developer

Compiler Settings

Preprocessor MACRO

None

Optimization Settings

None

Revision Control Log

Rev #Change DescriptionDateAuthor
1Initial version07/11/13LWW
2Added note about running Fee_MainFunction in a very low priority task07/25/13LWW
3Added note about KillWriteAllApi configuration setting requirement in NvM driver08/02/13LWW
4Added information about Suspend/Resume erase APIs and also the patch that is required for Fee_Cfg.h until the new Configurator generator is integrated.11/04/14KJS
5Added FEE Single bit ECC correction12/15/14PS
6Updated FEE component and removed Nexteer FEE ECC workaround1/27/15PS
7Updated FEE component to version 03.01.00_01.23.0010/15/2015PS
8Updated FEE component to version 03.01.00_01.23.01 for anomaly EA3#3993 correction02/10/2016KJS