我已经在带有Macronix MX25R3235F的自定义板上实现了DA14681。
我可以在没有问题的情况下在闪存中编程我的应用程序。
I can erase or rewrite flash data using the programmation scripts (program_nvparam, program_qspi, erase_qspi) without any problem.
但是,我正在使用NVMS Param和PareC零件来申请。
When i write data with my application, using ad_nvms_write everything is fine if the flash is blank at the address i want to write.
但是,当使用AD_NVMS_ERASE_REGION或AD_FLASH_ERASE_REGION或简单地编写“FF”以擦除数据时,擦除数据或将闪存写入新数据或写入新数据时,
the flash data is then corrupt with random data.
我怀疑闪存级别的一些配置问题,因为我在DA14680上尝试了使用Winbond闪存的应用程序代码,一切都很好。
You will find attached my flash config file.
谢谢你的帮助。
matthieu
设备:
Hi matthieuW,
使用您在PRO DEV套件上附加的MX25R3235F在POST上附加的.h文件进行了测试,i VE写在通用部分分区上(使用直接方案而不是VES,因为您无法在使用VE时擦除数据)10个字节数组,然后删除了标本地址,然后用其他数据重新编写,没有注意到任何损坏,程序都应该完成。
Thanks MT_dialog
Dear Dialog,
thus the problem root cause should not be the flash config file.
我已经执行ed multiple test :
- i have no problem to write data to the param or generic partition when the flash is blank.
- when data is already written, i got random data when writing a second time at the same address,
这是我使用的命令:
nvms_t nvms = ad_nvms_open(nvms_generic_part);
ad_nvms_write(nvms,addr,data,len);
这里是我使用的分区表:
Partition2(0x000000,0x025000,nvms_firmware_part,0)
PARTITION2( 0x025000 , 0x001000 , NVMS_PRODUCT_HEADER_PART , 0 )
partition2(0x026000,0x001000,nvms_image_header_part,0)
Partition2(0x027000,0x050000,nvms_fw_exec_part,0)
PARTITION2( 0x077000 , 0x006000 , NVMS_LOG_PART , 0 )
PARTITION2( 0x07D000 , 0x002000 , NVMS_PLATFORM_PARAMS_PART , PARTITION_FLAG_READ_ONLY )
PARTITION2( 0x07F000 , 0x001000 , NVMS_PARTITION_TABLE , PARTITION_FLAG_READ_ONLY )
Partition2(0x080000,0x010000,NVMS_PARAM_PART,0)
Partition2(0x090000,0x050000,nvms_fw_update_part,0)
PARTITION2( 0x0E0000 , 0x320000 , NVMS_GENERIC_PART , 0 )
- when i change the generic part to VES and reduce its size below 0x100000, everything is fine,the problem is that my application requires all the space of the flash.
is there partition size limitation when using ves partition?
can i use the ves for the param partition?
is there some configuration i am missing?
问候
matthieu
Hi matthieuW,
Can you check if the data are properly erased after you have execute the erase command and before you try writting anything else on that specific address ? And also can you please mention which version of SDK you are using (there is a bug on SDK 1.0.10 where the erase of the flash is canceled due to anykind interrupt, this is fixed on SDK 1.0.12).
Regarding your questions:
谢谢mt_dialog.
我正在使用SDK1.0.12,
I checked and the flash is well erased through the swd.
here is a simple log of what happen after erasing through jlink.
RDMEM 0 64.
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
wrmem 0 0x0001020304050607
RDMEM 0 64.
0x0001020304050607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
WRMEM 0 0xFFFFFFFFFFFFFFFF.
RDMEM 0 64.
0x0001020304050607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
第二次写入无效。
否则,我理解VES分区原则
However if i declare my partition as ves, i don't have this problem which is confusing me.
matthieu
嗨matthiew,
Sorry, but i am not able to replicate what you are mentioning, using the same flash, using the driver that you have mentioned and the snippet below, the uint8_t data_buf_1 & 2 are just arrays containing 40 bytes of data:
generic_part_hndl = ad_nvms_open(nvms_generic_part);
ad_nvms_write(generic_part_hndl,0x00,data_buf_1,sizeof(data_buf_1));
ad_nvms_write(generic_part_hndl,0x00,data_buf_2,sizeof(data_buf_2));
i was able to update the flash data, and verify it from the QSPI partition table tool, that the data were properly written, the only assumption that i can make is that either you are not using the adapters in order to interact with the partition, so something goes sideways, or in the above example you are reading the data not from the same task, but from a different one, therefore you are reading data before the flash is erased and updated with the new data from the previous task. Regarding the VES, as mentioned above, everytime you perform a new write, a different physical address of the flash is used which is allready empty.
Thanks MT_dialog
I disabled the MACRONIX_PERFORMANCE_MODE in the flash configuration file and everything is working fine.
谢谢你的帮助。
matthieu
Hi matthieuW,
Thanks for indicating that.
最好的问候mt_dialog.