⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8个帖子/ 0新
Last post
matthieuw
Offline
Last seen:4 months 1 day ago
加入:2015-11-20 14:55
erase flash data

我已经在带有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

Attachment:
设备:
MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi matthieuW,

Hi matthieuW,

使用您在PRO DEV套件上附加的MX25R3235F在POST上附加的.h文件进行了测试,i VE写在通用部分分区上(使用直接方案而不是VES,因为您无法在使用VE时擦除数据)10个字节数组,然后删除了标本地址,然后用其他数据重新编写,没有注意到任何损坏,程序都应该完成。

Thanks MT_dialog

matthieuw
Offline
Last seen:4 months 1 day ago
加入:2015-11-20 14:55
Dear 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

MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi matthieuW,

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:

  1. VES仅应用于特定分区,这是Generic_part,因为这是应该编写和删除的部分,所以我真的没有得到关于分区大小限制的问题,你可以更具体地对什么你的意思?VES标志将分区的大小划分为同样分隔的区域(8),因此闪光灯的可用空间将是分区大小除以8,您无法在与VES运行时默认擦除,您只需写入另一个定位的位置作为同一地址。
  2. Theoretically all the partitions can support this but as said, the VES is used only on the GENERIC_PART partition since this is the partition that is more oftenly being written and erased, using VES on the parameters partition, i am not sure how this will operate, most probably it would work, but if there is an issue with the erase when its time for performing an erase from the VES and an attempt to rewrite data i would expect the same effect.
  3. I dont see anything wrong with the partition table that you have attached.

谢谢mt_dialog.

matthieuw
Offline
Last seen:4 months 1 day ago
加入:2015-11-20 14:55
我正在使用SDK1.0.12,

我正在使用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

MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
嗨matthiew,

嗨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

matthieuw
Offline
Last seen:4 months 1 day ago
加入:2015-11-20 14:55
I disabled the MACRONIX

I disabled the MACRONIX_PERFORMANCE_MODE in the flash configuration file and everything is working fine.
谢谢你的帮助。
matthieu

MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi matthieuW,

Hi matthieuW,

Thanks for indicating that.

最好的问候mt_dialog.