打印
[汽车MCU – KEA]

KEA128 Flash Operation Sample Code(已解决)

[复制链接]
3559|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
ArmedAuto|  楼主 | 2014-6-18 17:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
FSL_FAE_STEVE| | 2014-6-19 10:58 | 只看该作者
KEXX_DRIVERS_V1.2.1_DEVD.zip (23.58 MB)
由于KEA的FLASH模块跟KE相同,楼主可以参考附件中的驱动代码,其中NVM文件夹包含了FLASH操作所需的api函数。

******************************************************************************
* Global functions
******************************************************************************/
uint16_t FLASH_Program1LongWord(uint32_t wNVMTargetAddress, uint32_t dwData);
uint16_t FLASH_Program2LongWords(uint32_t wNVMTargetAddress, uint32_t dwData0, uint32_t dwData1);
uint16_t FLASH_ProgramOnce(uint8_t bPhraseIndex, uint8_t *pData8Bytes);
uint16_t FLASH_ReadOnce(uint8_t bPhraseIndex, uint8_t *pData8Bytes);
uint16_t FLASH_EraseSector(uint32_t wNVMTargetAddress);
uint16_t FLASH_EraseVerifySection(uint32_t wNVMTargetAddress, uint16_t uiLongWordCount);
uint16_t FLASH_VerifyBackdoorKey(uint8_t *pbKey);
uint16_t FLASH_SetUserMarginLevel(uint32_t wNVMTargetAddress, uint16_t wMarginLevel, uint8_t bIsEEPROM);
uint16_t FLASH_Program(uint32_t wNVMTargetAddress, uint8_t *pData, uint16_t sizeBytes);

uint16_t FLASH_EraseBlock(uint32_t wNVMTargetAddress, uint8_t bIsEEPROM);
uint16_t FLASH_EraseVerifyBlock(uint32_t wNVMTargetAddress,uint8_t bIsEEPROM);
uint16_t FLASH_EraseAll(void);
uint16_t FLASH_EraseVerifyAll(void);
uint16_t FLASH_Unsecure(void);
uint16_t FLASH_EraseBlock_NoWait(uint32_t wNVMTargetAddress, uint8_t bIsEEPROM);
uint16_t FLASH_CheckErrStatus(void);

#if (defined(IAR))
__ramfunc void FLASH_LaunchCMD(uint8_t bWaitComplete);
#else
void FLASH_LaunchCMD(uint8_t bWaitComplete);
#endif

uint16_t EEPROM_Program1Byte(uint32_t wNVMTargetAddress, uint8_t bData);
uint16_t EEPROM_ProgramUpto4Bytes(uint32_t wNVMTargetAddress, uint8_t *pbData, uint8_t bByteCount);
uint16_t EEPROM_Program(uint32_t wNVMTargetAddress, uint8_t *pData, uint16_t sizeBytes);
uint16_t EEPROM_EraseVerifySection(uint32_t wNVMTargetAddress, uint16_t uiByteCount);
uint16_t EEPROM_Program1Byte_NoWait(uint32_t wNVMTargetAddress, uint8_t bData);
uint16_t EEPROM_ProgramUpto4Bytes_NoWait(uint32_t wNVMTargetAddress, uint8_t *pbData, uint8_t bByteCount);
uint16_t EEPROM_EraseSector_NoWait(uint32_t wNVMTargetAddress);
uint16_t EEPROM_EraseSector(uint32_t wNVMTargetAddress);

uint16_t FLASH_Init(uint32_t BusClock);

/*! @} End of nvm_api_list         

使用特权

评论回复
板凳
gxliu08| | 2014-6-25 20:11 | 只看该作者
可以用该FLASH存一些配置参数,不过需要注意FLASH的擦写寿命,不知道能擦多少次?最好做写均衡算法。

使用特权

评论回复
地板
lvyunhua| | 2014-7-3 21:52 | 只看该作者
:lol赞一个,老外在请教问题吗?

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝