AUTOSAR-Fee模块

AUTOSAR-Fee模块

0 前言

>>返回AUTOSAR系列文章目录<<

Fee模块全称Flash EEPROM Emulation Module,属于ECU抽象层

Fee模块本身是脱离硬件的,但是Fee模块可能会引用的Fls模块定制API,所以只能算半抽象

本文中,由于Fls模块提供的API都是Fls_17_Dmu打头的非标准API,所以Fee模块也必须使用英飞凌的定制版本

Fee模块最精简任务包括:

  • 提供一个常量配制指针,供EcuM模块对其进行初始化
  • 提供一个状态指针,供NvM模块了解其内部信息
  • 实现双扇区算法、立即写
  • 收到MemIf模块指令后,将32位地址空间解析为物理地址,传递给Fls模块执行
  • Fls模块完成一个操作后,通过回调函数自动向NvM模块报告

在这里插入图片描述

1 Fee模块的设计原理

1.1 逻辑扇区和双扇区算法

【AUTOSAR-Fls模块】2.1 Flash Emulation EEPROM已经介绍在Fls模块层面上的Flash Emulation EEPROM原理

Fee模块层面上,首先将所管辖的Flash分为分区(Partition),每个Fls模块的FlsSector为一个Partition(通常只有1个)

每个Partition分为2个逻辑扇区(FeeLogicalSector),也称为Virtual Sector,等价于Fls模块的FlsPhysicalSector

Fee模块以FeeLogicalSector为单位进行Erase操作

双扇区算法换扇区过程在英飞凌中称为GC(Garbage Collection)

GC过程:

  1. Fee模块会先获取两个FeeLogicalSector的状态,假设FeeLogicalSector0状态为Actived,FeeLogicalSector1状态为Not Actived
  2. 需要存储的数据写入FeeLogicalSector0
  3. 当FeeLogicalSector0存满后,把FeeLogicalSector0中的各个Block的最新数据copy到FeeLogicalSector1,同时将FeeLogicalSector1状态置为Actived
  4. 将FeeLogicalSector0里的数据全部Erase,同时将FeeLogicalSector0的状态置为Not Actived
  5. 新到的数据就依次存到FeeLogicalSector1
  6. 当FeeLogicalSector1存满后,再将FeeLogicalSector1中各个Block的最新数据copy到FeeLogicalSector0;同时将FeeLogicalSector0状态置为Actived
  7. 擦除FeeLogicalSector1里的数据,同时将FeeLogicalSector1的状态置为Not Actived
  8. 如此循环往复

1.2 逻辑块和地址空间

Fee模块向上层提供32位虚拟地址空间(Virtual Linear Address Space),其中

  • 前16位为Block Number,最多允许65536个逻辑块(Logical Block
  • 后16位为Block Offset,,即数据在Block中的偏移地址,每个Logical Block最大64K byte

Fee模块地址最小单位为Virtual Page,当前AUTOSAR下Virtual Page必须为8 byte

每个Logical Block首地址必须与一个VirtualPage首地址对齐,Logical Block尾地址如果不与一个Virtual Page对齐,则自动添加unused地址,对齐到最近的VirtualPage尾地址

Logical Block的Block Number是由NvM模块决定的,唯一但不连续


1.3 立即数据和阈值空间

包含即时数据(Immediate Data)的块必须即时写入,不允许出现Immediate Data写到一半,突然发现FeeLogicalSector0写不下,要等待换扇区的情况

为了避免这一情况,在FeeLogicalSector上设定阈值空间(Threshold Value),当FeeLogicalSector上剩余空间小于Threshold Value时,自动触发换扇区操作

显然Threshold Value必须大于所有包含Immediate Data的Logical Block的和

Immediate Write是最高优先级操作,NvM模块会取消正在进行的低优先级Read/Erase/Write或Compare作业

1.4 配置指针和状态指针

Fee模块作为ECU抽象层的模块,需要在Fls模块后初始化

Fee模块需要一个用const修饰的静态外部变量Fee_Config存放模块初始化时所需的配置参数,Fee_Config保存在数据段(.data)

Fee模块需要一个静态外部变量FeeStateVar存放模块状态参数,FeeStateVar保存在未初始化段(.bss)。Fee模块每一个操作中都需要读取或修改FeeStateVar


>>返回AUTOSAR系列文章目录<<


2 Fee模块的C语言实现

2.1 C文件架构

静态文件描述
Fee.h包含API所需的状态枚举常量、类定义、状态指针FeeStateVar声明
Fee.cAPI代码
Fee_Cbk.hCallback Function声明
动态文件描述
StartApplication_Fee_ecuc.arxmlConfigurator生成的本地配置文件
Fee_Bswmd.arxml
Fee_Cfg.h包含项目所需的常量宏定义、开关宏定义
Fee_PBcfg.h包含配制指针Fee_Config声明
Fee_PBcfg.c包含配制指针Fee_Config赋值

2.2 使用到的类定义和状态枚举

MemIf定义的类描述定义来源
MemIf_StatusType描述Fls模块的Module Status
1.MEMIF_UNINIT
模块未初始化
2.MEMIF_IDLE
没有需要处理的job
3.MEMIF_BUSY
模块正在处理job,不接受新job
MemIf_Types.h
MemIf_JobResultType描述Fls模块的Job Result
1.MEMIF_JOB_OK
job处理成功
2.MEMIF_JOB_FAILED
job处理以error结束
3.MEMIF_JOB_PENDING
job正在处理
4.MEMIF_JOB_CANCELLED
job已经取消
MemIf_Types.h
MemIf_ModeType描述Fls模块的Processing Mode
1.MEMIF_MODE_SLOW
Slow模式
2.MEMIF_MODE_FAST
Fast模式
MemIf_Types.h
Std定义的类描述定义来源
Std_ReturnType描述Job Request结果
1.E_OK
对同步指令,表示指令执行成功
对异步指令,表示指令被队列接受
2.E_NOT_OK
对同步指令,表示指令执行失败
对异步指令,表示指令被队列拒绝
Std_Type.h

2.3 配置指针和状态指针

  • 配置指针Fee_ConfigFee_PBcfg.c中赋值,示例如下:
const Fee_ConfigType Fee_Config =
{
  /* State结构体指针,未赋值 */
  .FeeStatePtr = &(Fee_StateDataType)FeeStateVar,
  /* Pointer to Logical Block configuration */
  .FeeBlockConfigPtr = &(Fee_BlockType)Fee_BlockConfig[0],
  
  /* Fee Job End Notification Api */
  .FeeNvMJobEndNotificationPtr = &(Fee_NotificationPtrType)NvM_JobEndNotification, 
  /* Fee Job Error Notification Api */
  .FeeNvMJobErrorNotificationPtr = &(Fee_NotificationPtrType)NvM_JobErrorNotification, 
  
  /* Fee threshold value */
  .FeeThresholdLimit = (uint32)1024U,
  /* Number of block configurated */
  .FeeBlkCnt = (uint16)81U,
  
  /* Fee settings for unconfigured blocks and GC restart */
  .FeeGCConfigSetting = 
  {
    /* Treatment to unconfigured blocks */
    .FeeUnconfigBlock = FEE_UNCONFIG_BLOCK_IGNORE, 
    /* when Garbage Collection restart */
    .FeeGcResertPoint = FEE_GC_RESTART_INIT, 
    /* Enable or disable Erase Suspend feature */
    .FeeUseEraseSuspend = FEE_ERASE_SUSPEND_DISABLE, 
    /* Reserved */
    .unused = 0U, 
  }, // Fee_GCConfigType
  
  /* Fee Illegal State Notification */
  .FeeNvMIllegalStateNotification = (Fee_NotificationPtrType)NULL_PTR,
  /* Fee QS Illegal State Notification */
  .FeeQsIllegalStateNotification = (Fee_NotificationPtrType)NULL_PTR,
  /* Fee Hardening Error Notification */
  .FeeQsHardenErrorNotification = (Fee_NotificationPtrType)NULL_PTR,
  
  /* Enable or disable Erase All feature */
  .FeeEraseAllEnable = (boolean)True
}
  • 状态指针FeeStateVarFee.h中定义类型,在Fee_PBcfg.c中声明
typedef struct
{
  /* Fee Sector Info */
  Fee_SectorInfoType FeeSectorInfo[FEE_SECTORS];
  /* Fee Cache Info */
  Fee_CacheType FeeBlockInfo[FEE_TOTAL_BLOCK_COUNT];
  /* Last Written Block Info */
  Fee_LastWrittenBlkInfoType FeeLastWrittenBlkInfo;
  /* Current Block Being Written during GC */
  Fee_GcBlkInfoType FeeGcCurrBlkInfo;
  
  //以下省略
}Fee_StateDataType;
Fee_StateDataType FeeStateVar;

2.4 Fee模块提供的API

在这里插入图片描述

Fee_Init

void Fee_Init(Fee_ConfigType* Fee_Config)
BrsMain EcuM EcuM_Callout_Stubs Os Fee EcuM_Init EcuM_AL_DriverInitOne Fee_Init Fee_Init EcuM_AL_DriverInitOne EcuM_StartOs StartOS StartOS EcuM_StartOs EcuM_Init BrsMain EcuM EcuM_Callout_Stubs Os Fee
  • EcuM模块调用Fee_Init完成对Fee模块的初始化
  • Fee_Init需要排在Fls_17_Dmu_Init的后面
  • 初始化所需参数在配置指针Fee_Config中,初始化包括对DMU寄存器的初始化和对状态指针FeeStateVar的初始化
  • 初始化后,Fee模块Module Status==MEMIF_IDLEJob Result=MEMIF_JOB_OK

Fee_MainFunction

void Fee_Mainfunction (void)
SchM Default_BSW_Async_Task_Core0 Fee ActivateTask Fee_MainFunction switch FeeMainJob Fee_MainFunction loop SchM Default_BSW_Async_Task_Core0 Fee
  • Fee_MainFunctionDefault_BSW_Async_Task_Core0中以10ms周期被调用,负责执行异步job
  • Fee_MainFunction根据FeeStateVar->FeeMainJob确定当前任务,FeeStateVar->FeeMainJob有以下状态:
FeeMainJob
FEE_MAIN_UNINIT
FEE_MAIN_INITGC
FEE_MAIN_CACHEUPDATE
FEE_MAIN_READ
FEE_MAIN_WRITE
FEE_MAIN_GC
  • Fee_MainFunction在一次周期中处理的数据量取决于配置的Processing Mode = Fast Mode / Slow Mode
  • Fee_MainFunction在处理完一个job后,将调用Job End Notification,或者如果发生错误,将执行Job Error Notification

Fee_Read

Std_ReturnType Fee_Read
(
uint16 BlockNumber,
uint16 BlockOffset,
uint8* DataBufferPtr,
uint16 Length
)
Default_BSW_Async_Task_Core0 MemIf Fee Fls Fee_Read FeeMainJob=FEE_MAIN_READ Fee_Read Fee_MainFunction Fls_17_Dmu_Read Fls_17_Dmu_Read Fee_MainFunction Default_BSW_Async_Task_Core0 MemIf Fee Fls
  1. Fee_Read设置状态FeeMainJob=FEE_MAIN_READ
  2. Fee_MainFunction执行后检测到FEE_MAIN_READ,开始处理
  3. BlockNumber转为BlockId,通过BlockOffsetLength获取数据的虚拟地址
  4. 虚拟地址转换为Block Instance在Flash中的实际地址
  5. 调用Fls_17_Dmu_Read,将实际地址上的数据存入DataBufferPtr指向的RAM区域
  • 异步Job,在Fee_MainFunction中执行
  • 此Job只有在Module Status==MEMIF_IDLE才能请求

Fee_Write

Std_ReturnType Fee_Write
(
uint16 BlockNumber,
uint8* DataBufferPtr
)
SchM Default_BSW_Async_Task_Core0 MemIf Fee Fls ActivateTask Fee_Write FeeMainJob=FEE_MAIN_WRITE Fee_Write Fee_MainFunction Fls_17_Dmu_Write Fls_17_Dmu_Write Fee_MainFunction SchM Default_BSW_Async_Task_Core0 MemIf Fee Fls
  1. Fee_Write设置状态FeeMainJob=FEE_MAIN_WRITE
  2. Fee_MainFunction执行后检测到FEE_MAIN_WRITE,开始处理
  3. BlockNumber转为BlockId,转换为Block Instance在Flash中的实际地址
  4. 调用Fls_17_Dmu_Write
  • 异步Job,在Fls_17_Dmu_MainFunction中执行
  • 此Job只有在Module Status==MEMIF_IDLE才能请求

Fee_Cancel

void Fee_Cancel (void)
MemIf Fee Fls Fee_Cancel Fls_17_Dmu_Cancel Fls_17_Dmu_Cancel Fee_Cancel MemIf Fee Fls
  • 取消当前Job
  • 同步Job,立即执行

Fee_GetStatus

MemIf_StatusType Fee_GetStatus (void)
  • 返回Fee模块Module Status
  • 同步job,立即执行

Fee_GetJobResult

MemIf_StatusType Fee_GetJobResult (void)
  • 返回最近或当前处理的Job Result
  • 同步job,立即执行

Fee_SetMode

void Fee_SetMode (MemIf_ModeType Mode)
MemIf Fee Fls Fee_SetMode Fls_17_Dmu_SetMode Fls_17_Dmu_SetMode Fee_SetMode MemIf Fee Fls
  • 调用Fls_SetMode
  • 同步job,立即执行
  • 此job只有在Module Status==MEMIF_IDLE才能请求
  • Set Mode supported决定是否启用API

2.5 Fee模块提供的Callback

Fee_JobEndNotification

void Fee_JobEndNotification (void)
Fee Fls Fee_JobEndNotification Fls_17_Dmu_GetNotifCaller Fls_17_Dmu_GetNotifCaller Fee_JobEndNotification Fee Fls
  • Fls模块成功处理一个Job时,向Fee模块返回此回调函数
  • Fee_JobEndNotification会调用Fls_17_Dmu_GetNotifCaller,获取状态&FlsStateVar->NotifCaller,从而知道哪个Job返回此Callback Function

Fee_JobErrorNotification

void Fee_JobErrorNotification (void)
Fee Fls Fee_JobErrorNotification Fls_17_Dmu_GetNotifCaller Fls_17_Dmu_GetNotifCaller Fee_JobErrorNotification Fee Fls
  • Fls模块处理一个Job失败时,向Fee模块返回此回调函数
  • Fee_JobErrorNotification会调用Fls_17_Dmu_GetNotifCaller,获取状态&FlsStateVar->NotifCaller,从而知道哪个Job返回此Callback Function

https://img-blog.csdnimg.cn/20210524211543967.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTEwNzk2MTM=,size_16,color_FFFFFF,t_70


2.6 Fee模块使用的外部API

Det_ReportError

Std_ReturnType Det_ReportError
(
uint16 ModuleId,
uint8 InstanceId,
uint8 ApiId,
uint8 ErrorId
)
  • 来自Det模块的API,检测并报告开发错误,由Dev Error Detect启用

  • ModuleId==FEE_MODULE_ID21

  • InstanceId=0

  • ApiId如下
    在这里插入图片描述

  • ErrorId有7个,示例如下
    FEE_E_UNINIT
    FEE_E_INVALID_BLOCK_NO


Mcal_ReportSafetyError

Std_ReturnType Mcal_ReportSafetyError
(
uint16 ModuleId,
uint8 InstanceId,
uint8 ApiId,
uint8 ErrorId
)
  • 来自MCAL的API,检测并报告安全错误,由Safety Enable启用
  • 安全错误是指DMU寄存器中记录的错误,由内联函数读取,其中部分错误和开发错误相同
  • ModuleIdInstanceIdApiIdDet_ReportError
  • ErrorId有8个,示例如下
    FEE_SE_UNINIT
    FEE_SE_INVALID_BLOCK_NO

2.7 Fee模块使用的外部Callback

NvM_JobEndNotification

void NvM_JobEndNotification (void)
NvM Fee Fls Fee_JobEndNotification Fls_17_Dmu_GetNotifCaller Fls_17_Dmu_GetNotifCaller NvM_JobEndNotification NvM_JobEndNotification Fee_JobEndNotification NvM Fee Fls
  • Fee模块接收到Fls模块发送的Fee_JobEndNotification后,向NvM模块返回此回调函数
  • NvM_JobEndNotification会在当前NVRAM块信息中写入NVM_REQ_OK

NvM_JobErrorNotification

void NvM_JobErrorNotification (void)
NvM Fee Fls Fee_JobErrorNotification Fls_17_Dmu_GetNotifCaller Fls_17_Dmu_GetNotifCaller NvM_JobErrorNotification NvM_JobErrorNotification Fee_JobErrorNotification NvM Fee Fls
  • Fee模块接收到Fls模块发送的Fee_JobErrorNotification后,向NvM模块返回此回调函数
  • NvM_JobErrorNotification会在当前NVRAM块信息中写入NVM_REQ_NOT_OKNVM_REQ_NV_INVALIDATENVM_REQ_INTEGRITY_FAILED

>>返回AUTOSAR系列文章目录<<


3 Fee模块的DaVinci Configurator配制

3.1 Fee\FeeBlockConfigurations

每个Logical Block都有一个FeeBlockConfiguration页面,配制Logical Block的基本属性


Device Index

配制Configurator选项Device Index -> referrence
  • 将当前Block关联到Fls\FlsGeneral

Blcok Number

配制Configurator选项Blcok Number -> [1, 65535]
影响Fee_PBcfg.cstatic const Fee_BlockType Fee_BlockConfig[]
{
.BlockNumber=
}
  • 根据根据NvM模块配制自动生成,无法修改

Blcok Size

配制Configurator选项Blcok Size -> [1, 65535]
影响Fee_PBcfg.cstatic const Fee_BlockType Fee_BlockConfig[]
{
.Size=
}
  • 自动生成,系统在NvM模块定义的Block Length基础上加CRC长度(32位CRC则加4byte)
  • CRC长度取决于NvM模块Crc Type

Immediate Data

配制Configurator选项Immediate Data -> True/False
影响Fee_PBcfg.cstatic const Fee_BlockType Fee_BlockConfig[]
{
.FeeImmdiateData=
}
  • Immediate Data开启表明Block包含Immediate Data
  • 依据NvM模块自动生成

Number Of Write Cycles

配制Configurator选项Number Of Write Cycles -> [1, :]
影响Fee_PBcfg.cstatic const Fee_BlockType Fee_BlockConfig[]
{
.CycleCountLimit=
}
  • Block的最大Write寿命
  • 选择1200000

Quasi Static Manager

配制Configurator选项Quasi Static Manager -> True/False
  • Block Type Configured选择FEE_SECTOR_AND_QUASI_STATIC_DATA或者FEE_QUASI_STATIC_DATA_ONLY才有意义

Qs Block Address

配制Configurator选项Qs Block Address -> [0, :]
  • Block Type Configured选择FEE_SECTOR_AND_QUASI_STATIC_DATA或者FEE_QUASI_STATIC_DATA_ONLY才有意义

Qs Block Instances

配制Configurator选项Qs Block Instances -> [0, 128]
  • Block Type Configured选择FEE_SECTOR_AND_QUASI_STATIC_DATA或者FEE_QUASI_STATIC_DATA_ONLY才有意义

4.2 Fee\FeeGeneral

FeeGeneral部分主要对应Fee_Cfg.h文件中的常量宏定义开关宏定义


Main Function Period [s]

配制Configurator选项Main Function Period [s] -> [0.001, 1]
  • Fee_MainFunction调用周期,要和NvM_MainFunction一致,通常为0.01

Virtual Page Size

配制Configurator选项Virtual Page Size -> [8]
影响Fee_Cfg.h#define FEE_VIRTUAL_PAGE_SIZE
  • Virtual Page Size必须是Flash Page的整数倍
  • 在AUTOSAR中已经被限制只能填8

Polling Mode

配制Configurator选项Polling Mode -> True/False
  • 开启则选择Polling Mode,关闭则选择Callback Mode
  • 选择False

Block Type Configured

配制Configurator选项Block Type Configured -> enum:
FEE_DOUBLE_SECTOR_DATA_ONLY
FEE_DOUBLE_SECTOR_AND_QUASI_STATIC_DATA
FEE_QUASI_STATIC_DATA_ONLY
影响Fee_Cfg.h#define FEE_DATA_BLOCK_SUPPORTED
  • 使用NvM模块则必须选择FEE_DOUBLE_SECTOR_DATA_ONLY

Nvm Job End Notification

配制Configurator选项Nvm Job End Notification -> NvM_JobEndNotification 或 不填
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{
.FeeNvMJobEndNotificationPtr =
}
  • NvM模块提供NvM_JobEndNotification回调函数
  • 不填则给Fee_Config.FeeNvMJobEndNotification 赋值NULL_PTR

Nvm Job Error Notification

配制Configurator选项Nvm Job Error Notification -> NvM_JobErrorNotification 或 不填
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{
.FeeNvMJobErrorNotificationPtr =
}
  • NvM模块提供NvM_JobErrorNotification回调函数
  • 不填则给Fee_Config.FeeNvMJobErrorNotification 赋值NULL_PTR

Qs Job End Notification

配制Configurator选项Qs Job End Notification -> Qs_JobEndNotification 或 不填
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{
.FeeQsJobEndNotificationPtr =
}
  • Block Type Configured选择FEE_SECTOR_AND_QUASI_STATIC_DATA或者FEE_QUASI_STATIC_DATA_ONLY才有意义

Qs Job Error Notification

配制Configurator选项Qs Job Error Notification -> Qs_JobErrorNotification 或 不填
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{
.FeeQaJobErrorNotificationPtr =
}
  • Block Type Configured选择FEE_SECTOR_AND_QUASI_STATIC_DATA或者FEE_QUASI_STATIC_DATA_ONLY才有意义

Dev Error Detect

配制Configurator选项Dev Error Detect -> True/False
影响Fee_Cfg.h#define FEE_DEV_ERROR_DETECT
  • 宏定义开关,是否启用Det模块检测开发错误
  • 如果启用Dev Error Detect,则添加#include Det.h并启用APIDet_ReportError
  • 选择False

Safety Enable

配制Configurator选项Safety Enable -> True/False
影响Fee_Cfg.h#define FEE_SAFETY_ENABLE
  • 宏定义开关,是否启用MCAL层检测安全错误
  • 如果使用Safety Enable,则模块添加#include Mcal_SafetyError.h,启用APIMcal_ReportSafetyError
  • 选择False

Init Check Api

配制Configurator选项Init Check Api -> True/False
影响Fee_Cfg.h#define FEE_INITCHECK_API
  • 宏定义开关,是否启用API Fee_InitCheck,返回Fee模块是否完成初始化
  • 选择False

Set Mode supported

配制Configurator选项Set Mode supported -> True/False
影响Fee_Cfg.h#define FEE_SET_MODE_SUPPORTED
  • 宏定义开关,是否启用API Fee_SetMode
  • 选择False

Version Info Api

配制Configurator选项Version Info Api -> True/False
影响Fee_Cfg.h#define FEE_VERSION_INFO_API
  • 宏定义开关,是否启用APIFee_GetVersionInfo
  • 选择False

3.3 Fee\FeeIfxSpecificConfig

此页操作英飞凌特有的配制信息


Cancel All Api

配制Configurator选项Cancel All Api -> True/False
影响Fee_Cfg.h#define FEE_CANCEL_ALL_API
  • 宏定义开关,是否启用API Fee_17_CancelAll
  • 开启则允许取消所有当前任务,优先Write high priority quasi static data
  • Block Type Configured选择FEE_SECTOR_AND_QUASI_STATIC_DATA才有意义
  • 选择False

Erase All Enable

配制Configurator选项Erase All Enable -> True/False
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{
.FeeEraseAllEnable=
}
  • Fee_Config->FeeEraseAllEnable赋值
  • True:当Sector处于illegal state时,将DF0_EEPROM格式化然后恢复之前的数据
  • False:当Sector处于illegal state时无法恢复,陷入死循环
  • 选择True

Gc Restart

配制Configurator选项Gc Restart -> enum:
FEE_GC_RESTART_INIT
FEE_GC_RESTART_WRITE
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{
.FeeGCConfigSetting
{
.FeeGcResertPoint=
}
}
  • Fee_Config->FeeGCConfigSetting->FeeGcResertPoint赋值
  • FEE_GC_RESTART_INIT:当Fee模块初始化后,restart GC
  • FEE_GC_RESTART_WRITE:当Fee模块初始化且第一个Read/Write/Invalidate请求后,restart GC
  • 选择FEE_GC_RESTART_INIT

Get Cycle Count Api

配制Configurator选项Get Cycle Count Api -> True/False
影响Fee_Cfg.h#define FEE_GET_CYCLE_COUNT_API
  • 宏定义开关,是否启用API Fee_17_GetCycleCount获取block cycle和erase cycle
  • 选择True

Get Prev Data Api

配制Configurator选项Get Cycle Count Api -> True/False
影响Fee_Cfg.h#define FEE_GET_PREV_DATA_API
  • 宏定义开关,是否启用API Fee_17_GetPrevData获取上一个Block Instance数据
  • 选择False

Max Block Count

配制Configurator选项Max Block Count -> [1, :]
影响Fee_Cfg.h#define FEE_MAX_BLOCK_COUNT
  • 配制的Block数量

Max Bytes Per Cycle

配制Configurator选项Max Bytes Per Cycle -> enum:
FEE_MAX_BYTES_64
FEE_MAX_BYTES_128
FEE_MAX_BYTES_256
FEE_MAX_BYTES_512
影响Fee_Cfg.h#define FEE_MAX_BYTES_PER_CYCLE
  • 一个Fee_MainFunction周期内最大数据处理量
  • 选择FEE_MAX_BYTES_512

Nvm Illegal State Notification

配制Configurator选项Nvm Illegal State Notification -> NvM_IllegalStateNotification 或 不填
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{

}
  • Fee模块提供Fee_NvMIllegalStateNotification回调函数
  • 不填则给Fee_Config.NvMIllegalStateNotification 赋值NULL_PTR
  • 一般不填

Qs Harden Error Notification

配制Configurator选项Qs Harden Error Notification -> 不填
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{

}
  • Block Type Configured选择FEE_SECTOR_AND_QUASI_STATIC_DATA或者FEE_QUASI_STATIC_DATA_ONLY才有意义

Qs Illegal State Notification

配制Configurator选项Qs Illegal State Notification -> 不填
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{

}
  • Block Type Configured选择FEE_SECTOR_AND_QUASI_STATIC_DATA或者FEE_QUASI_STATIC_DATA_ONLY才有意义

State Var Struct

配制Configurator选项State Var Struct -> FeeStateVar
影响Fee_PBcfg.cstatic Fee_StateDataType FeeStateVar
  • 定义Fee模块状态指针名称,默认的就够用了

Threshold Value

配制Configurator选项Threshold Value -> [0, :]
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{

}
  • Sector中剩余内存小于Threshold Value时触发garbage collect和sector change

Um Config Blk Overflow Handler

配制Configurator选项Um Config Blk Overflow Handler -> enum:
FEE_CONTINUE
FEE_STOP_AT_GC
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{

}
  • FEE_CONTINUE: GC时遇到unconfigurated block直接跳过
  • FEE_STOP_AT_GC: GC时遇到unconfigurated block短暂进入只读状态
  • FEE_CONTINUE

Um Config Block

配制Configurator选项Um Config Blk Overflow Handler -> enum:
FEE_UNCONFIG_BLOCK_IGNORE
FEE_UNCONFIG_BLOCK_KEEP
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{

}
  • FEE_UNCONFIG_BLOCK_IGNORE: GC时不复制unconfigurated block
  • FEE_UNCONFIG_BLOCK_KEEP: GC时赋值unconfigurated block
  • FEE_UNCONFIG_BLOCK_IGNORE

Use Erase Suspend

配制Configurator选项Use Erase Suspend -> True/False
影响Fee_PBcfg.cconst Fee_ConfigType Fee_Config
{

}
  • 启用时,Fee模块可以中断GC操作,优先进行Read/Write请求
  • 这是TC389的硬件功能
  • 选择False

Virgin Flash Illegal State

配制Configurator选项Virgin Flash Illegal State -> True/False
影响Fee_Cfg.h#define FEE_VIRGIN_FLASH_ILLEGAL_STATE
  • 选择False

3.4 Fee\FeeDemEventParamterRefs

本页是Error后Dem模块对应的Action,不填代表FEE_DISABLE_DEM_REPORT


E GC ERASE

配制Configurator选项E GC ERASE -> 不填
影响Fee_Cfg.h#define FEE_GC_ERASE_DEM_REPORT

E GC INIT

配制Configurator选项E GC INIT -> 不填
影响Fee_Cfg.h#define FEE_GC_INIT_DEM_REPORT

E GC READ

配制Configurator选项E GC READ -> 不填
影响Fee_Cfg.h#define FEE_GC_READ_DEM_REPORT

E GC TRIG

配制Configurator选项E GC TRIG -> 不填
影响Fee_Cfg.h#define FEE_GC_TRIG_DEM_REPORT

E GC WRITE

配制Configurator选项E GC WRITE -> 不填
影响Fee_Cfg.h#define FEE_GC_WRITE_DEM_REPORT

E INVALIDATE

配制Configurator选项E INVALIDATE -> 不填
影响Fee_Cfg.h#define FEE_INVALIDATE_DEM_REPORT

E READ

配制Configurator选项E READ -> 不填
影响Fee_Cfg.h#define FEE_READ_DEM_REPORT

E UNCONFIG BLK EXCEEDED

配制Configurator选项E UNCONFIG BLK EXCEEDED -> 不填
影响Fee_Cfg.h#define FEE_UNCFG_BLK_DEM_REPORT

E WRITE

配制Configurator选项E WRITE -> 不填
影响Fee_Cfg.h#define FEE_WRITE_DEM_REPORT

E WRITE CYCLES EXHAUSTED

配制Configurator选项E WRITE CUCLES EXHAUSTED -> 不填
影响Fee_Cfg.h#define FEE_WRITE_CYCLES_DEM_REPORT

>>返回AUTOSAR系列文章目录<<


  • 85
    点赞
  • 392
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值