AUTOSAR-Fee模块
- 0 前言
- 1 Fee模块的设计原理
- 2 Fee模块的C语言实现
- 3 Fee模块的DaVinci Configurator配制
- 3.1 Fee\FeeBlockConfigurations
- 4.2 Fee\FeeGeneral
- 3.3 Fee\FeeIfxSpecificConfig
- Cancel All Api
- Erase All Enable
- Gc Restart
- Get Cycle Count Api
- Get Prev Data Api
- Max Block Count
- Max Bytes Per Cycle
- Nvm Illegal State Notification
- Qs Harden Error Notification
- Qs Illegal State Notification
- State Var Struct
- Threshold Value
- Um Config Blk Overflow Handler
- Um Config Block
- Use Erase Suspend
- Virgin Flash Illegal State
- 3.4 Fee\FeeDemEventParamterRefs
0 前言
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过程:
- Fee模块会先获取两个FeeLogicalSector的状态,假设FeeLogicalSector0状态为
Actived
,FeeLogicalSector1状态为Not Actived
- 需要存储的数据写入FeeLogicalSector0
- 当FeeLogicalSector0存满后,把FeeLogicalSector0中的各个Block的最新数据copy到FeeLogicalSector1,同时将FeeLogicalSector1状态置为
Actived
- 将FeeLogicalSector0里的数据全部Erase,同时将FeeLogicalSector0的状态置为
Not Actived
- 新到的数据就依次存到FeeLogicalSector1
- 当FeeLogicalSector1存满后,再将FeeLogicalSector1中各个Block的最新数据copy到FeeLogicalSector0;同时将FeeLogicalSector0状态置为
Actived
- 擦除FeeLogicalSector1里的数据,同时将FeeLogicalSector1的状态置为
Not Actived
- 如此循环往复
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
2 Fee模块的C语言实现
2.1 C文件架构
静态文件 | 描述 |
---|---|
Fee.h | 包含API所需的状态枚举常量、类定义、状态指针FeeStateVar 声明 |
Fee.c | API代码 |
Fee_Cbk.h | Callback Function声明 |
动态文件 | 描述 |
---|---|
StartApplication_Fee_ecuc.arxml | Configurator生成的本地配置文件 |
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_Config
在Fee_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
}
- 状态指针
FeeStateVar
在Fee.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 ) |
---|
- 由EcuM模块调用
Fee_Init
完成对Fee模块的初始化 Fee_Init
需要排在Fls_17_Dmu_Init
的后面- 初始化所需参数在配置指针
Fee_Config
中,初始化包括对DMU寄存器的初始化和对状态指针FeeStateVar
的初始化 - 初始化后,Fee模块的Module Status==
MEMIF_IDLE
,Job Result=MEMIF_JOB_OK
Fee_MainFunction
void Fee_Mainfunction (void) |
---|
Fee_MainFunction
在Default_BSW_Async_Task_Core0
中以10ms周期被调用,负责执行异步jobFee_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 ModeFee_MainFunction
在处理完一个job后,将调用Job End Notification,或者如果发生错误,将执行Job Error Notification
Fee_Read
Std_ReturnType Fee_Read ( uint16 BlockNumber ,uint16 BlockOffset ,uint8* DataBufferPtr ,uint16 Length ) |
---|
Fee_Read
设置状态FeeMainJob=FEE_MAIN_READ
Fee_MainFunction
执行后检测到FEE_MAIN_READ
,开始处理- 将
BlockNumber
转为BlockId
,通过BlockOffset
、Length
获取数据的虚拟地址 - 虚拟地址转换为Block Instance在Flash中的实际地址
- 调用
Fls_17_Dmu_Read
,将实际地址上的数据存入DataBufferPtr
指向的RAM区域
- 异步Job,在
Fee_MainFunction
中执行 - 此Job只有在Module Status==
MEMIF_IDLE
才能请求
Fee_Write
Std_ReturnType Fee_Write ( uint16 BlockNumber ,uint8* DataBufferPtr ) |
---|
Fee_Write
设置状态FeeMainJob=FEE_MAIN_WRITE
Fee_MainFunction
执行后检测到FEE_MAIN_WRITE
,开始处理- 将
BlockNumber
转为BlockId
,转换为Block Instance在Flash中的实际地址 - 调用
Fls_17_Dmu_Write
- 异步Job,在
Fls_17_Dmu_MainFunction
中执行 - 此Job只有在Module Status==
MEMIF_IDLE
才能请求
Fee_Cancel
void Fee_Cancel (void) |
---|
- 取消当前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 ) |
---|
- 调用
Fls_SetMode
- 同步job,立即执行
- 此job只有在Module Status==
MEMIF_IDLE
才能请求 - Set Mode supported决定是否启用API
2.5 Fee模块提供的Callback
Fee_JobEndNotification
void Fee_JobEndNotification (void) |
---|
- 当Fls模块成功处理一个Job时,向Fee模块返回此回调函数
Fee_JobEndNotification
会调用Fls_17_Dmu_GetNotifCaller
,获取状态&FlsStateVar->NotifCaller
,从而知道哪个Job返回此Callback Function
Fee_JobErrorNotification
void Fee_JobErrorNotification (void) |
---|
- 当Fls模块处理一个Job失败时,向Fee模块返回此回调函数
Fee_JobErrorNotification
会调用Fls_17_Dmu_GetNotifCaller
,获取状态&FlsStateVar->NotifCaller
,从而知道哪个Job返回此Callback Function
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_ID
或21
-
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寄存器中记录的错误,由内联函数读取,其中部分错误和开发错误相同
ModuleId
,InstanceId
,ApiId
同Det_ReportError
ErrorId
有8个,示例如下
FEE_SE_UNINIT
FEE_SE_INVALID_BLOCK_NO
2.7 Fee模块使用的外部Callback
NvM_JobEndNotification
void NvM_JobEndNotification (void) |
---|
- Fee模块接收到Fls模块发送的
Fee_JobEndNotification
后,向NvM模块返回此回调函数 NvM_JobEndNotification
会在当前NVRAM块信息中写入NVM_REQ_OK
NvM_JobErrorNotification
void NvM_JobErrorNotification (void) |
---|
- Fee模块接收到Fls模块发送的
Fee_JobErrorNotification
后,向NvM模块返回此回调函数 NvM_JobErrorNotification
会在当前NVRAM块信息中写入NVM_REQ_NOT_OK
、NVM_REQ_NV_INVALIDATE
或NVM_REQ_INTEGRITY_FAILED
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.c | static const Fee_BlockType Fee_BlockConfig []{ .BlockNumber= } |
- 根据根据NvM模块配制自动生成,无法修改
Blcok Size
配制 | Configurator选项 | Blcok Size -> [1, 65535] |
---|---|---|
影响 | Fee_PBcfg.c | static 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.c | static const Fee_BlockType Fee_BlockConfig []{ .FeeImmdiateData= } |
- Immediate Data开启表明Block包含Immediate Data
- 依据NvM模块自动生成
Number Of Write Cycles
配制 | Configurator选项 | Number Of Write Cycles -> [1, :] |
---|---|---|
影响 | Fee_PBcfg.c | static 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.c | const 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.c | const 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.c | const 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.c | const 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 |
- 宏定义开关,是否启用API
Fee_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.c | const 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.c | const Fee_ConfigType Fee_Config { .FeeGCConfigSetting { .FeeGcResertPoint= } } |
- 给
Fee_Config->FeeGCConfigSetting->FeeGcResertPoint
赋值 FEE_GC_RESTART_INIT
:当Fee模块初始化后,restart GCFEE_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.c | const Fee_ConfigType Fee_Config { … } |
- Fee模块提供
Fee_NvMIllegalStateNotification
回调函数 - 不填则给
Fee_Config.NvMIllegalStateNotification
赋值NULL_PTR
- 一般不填
Qs Harden Error Notification
配制 | Configurator选项 | Qs Harden Error Notification -> 不填 |
---|---|---|
影响 | Fee_PBcfg.c | const 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.c | const 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.c | static Fee_StateDataType FeeStateVar |
- 定义Fee模块状态指针名称,默认的就够用了
Threshold Value
配制 | Configurator选项 | Threshold Value -> [0, :] |
---|---|---|
影响 | Fee_PBcfg.c | const 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.c | const 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.c | const Fee_ConfigType Fee_Config { … } |
FEE_UNCONFIG_BLOCK_IGNORE
: GC时不复制unconfigurated blockFEE_UNCONFIG_BLOCK_KEEP
: GC时赋值unconfigurated block- 选
FEE_UNCONFIG_BLOCK_IGNORE
Use Erase Suspend
配制 | Configurator选项 | Use Erase Suspend -> True/False |
---|---|---|
影响 | Fee_PBcfg.c | const 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 |