This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UCD3138: ucd3138的flash读写

Part Number: UCD3138

情况如下:

目前我的通信是485通信,希望将部分通信的数据写入到FLASH保存,后续在需要时取出来使用;

现在就是保存数据和读取数据的FLASH操作问题,

比如写入,接收到通信命令后,写入一个数据,操作如下:

u32DestAddr = &g_u16WriteValue1;
u16WriteValue = 0x1568;
status = update_data_flash((void*)u32DestAddr, &u16WriteValue, sizeof(u16WriteValue));

如果该变量地址无数据时如0xffff时,写入正常,当此地址有数据里,需要先将此地址内容擦除再写入,擦除操作为:

start_erase_task((void*)g_u16WriteValue1, sizeof(g_u16WriteValue1));

但是通信操作后,通过UCD3xxx & UCD9xxx Device GUI查看,此变量数据没有被擦除,而且此命令也执行过,

是什么原因导致擦除不成功?怎么解决?