在线时间2 小时
UID2081063
注册时间2018-6-21
NXP金币0
该用户从未签到
新手上路

- 积分
- 15
- 最后登录
- 2020-4-2
|
发表于 2018-7-10 15:27:46
|
显示全部楼层
您好!请教一个关于EEPROM的问题,我用的是NXP S32K144,应该也是Kinetis系列的.EEPROM的地址是从0x14000000开始,0x14000FFF结束是吧,现在出现一个问题,一次写1个字节没问题,一次写4个字节也没问题,但是一次写2个字节就有问题,直接跳到Hardfault,知道什么问题吗?
我的写EEPROM是直接memcpy实现的:
void eepromWrite( uint32_t flash_add,void* data,uint16_t len )
{
/* Make sure the EEE is ready. If not wait for the command to complete */
while(!(FTFC->FCNFG & FTFC_FCNFG_EEERDY_MASK));
memcpy((void*)flash_add,(const void*)data,len);
/* Make sure the EEE is ready. If not wait for the command to complete */
while(!(FTFC->FCNFG & FTFC_FCNFG_EEERDY_MASK));
}
将数据直接拷到指定的地址,理论上应该没问题才对啊. |
|