擦除闪存数据

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
8 posts / 0 new
最后一篇
Matthieu.W
离线
最后一次露面:3 months 2 weeks ago
加入:2015-11-20 14:55
擦除闪存数据

我实现了一个自定义董事会DA14681智慧h a macronix MX25R3235F.
I can program my application in the flash without problem.
我可以使用程序脚本(program_nvparam,program_qspi,erase_qspi)擦除或重写闪存数据,而没有任何问题。

However i am using the nvms param and generic parts for my application.
当我用我的应用程序写入数据时,如果闪光灯在我想要写入的地址空白,则使用AD_NVMS_WRITE一切正常。

however when erasing data or writing new data the flash using ad_nvms_erase_region or ad_flash_erase_region or simply writing 'FF' to erase data,
然后将闪存数据损坏随机数据。

i suspect some configuration problem at the flash level, as i tried the same application code on a DA14680 with a winbond flash and everything is fine.
您将找到附加的我的Flash Config文件。

Thanks for your help.

Matthieu.

附件:
Device:
mt_dialog.
离线
最后一次露面:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
嗨matthieuw,

嗨matthieuw,

Tested with the .h file that you have attached on the post with an MX25R3235F on the pro dev kit, i ve written on the GENERIC PART partition (using the direct scheme and not VES, since you cannot actually erase data when using VES) an array of 10 bytes, then erased that speciifc address and then re-written with additional data, didn't noticed any corruption and the procedure was completed as it should.

谢谢mt_dialog.

Matthieu.W
离线
最后一次露面:3 months 2 weeks ago
加入:2015-11-20 14:55
亲爱的对话框,

亲爱的对话框,
因此,问题根本原因不应该是Flash Config文件。
我已经进行了多次测试:
- 当闪光灯为空白时,我没有问题将数据写入Param或通用分区。
- 当数据已经写入时,我在同一地址编写第二次时,我会随机数据,
这是我使用的命令:

nvms_t nvms= ad_nvms_open(NVMS_GENERIC_PART);
ad_nvms_write(nvms, addr, data, len);
and here is the partition table i use :

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(0x00000,0x320000,NVMS_GENERIC_PART,0)

- 当我将通用部分更改为VES并降低其大小0x100000时,一切都很好,问题是我的应用程序需要闪存的所有空间。
使用VES分区时是否有分区大小限制?
我可以使用参数分区的VES吗?
有一些配置我缺少吗?

regards
Matthieu.

mt_dialog.
离线
最后一次露面:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
嗨matthieuw,

嗨matthieuw,

在执行erase命令之前,您可以检查数据是否正确擦除了,然后在您尝试在该特定地址上写入其他任何地址?此外,还可以提及您使用的SDK版本(SDK 1.0.10上有一个错误,其中闪存的擦除由于AnySkind中断而取消,这是在SDK 1.0.12上固定的。

关于你的问题:

  1. The VES is applied only to a specific partition and this is the GENERIC_PART, since this is the part that should be written and erased more often, so i dont really get the question regarding the partition size limitation, can you be more specific on what is that you mean ? The VES flag will divide the size of the partition into equally seperated regions (8) and so the usable space of the flash will be the partition size divided by 8, you cannot explictly erase when operate with VES, you just write to another location treated as the same address.
  2. 理论上,所有分区都可以支持这一点,但如上所述,VES仅在generic_part分区上使用,因为这是在参数分区上使用VES更常写和删除的分区,我不确定如何运行,大多数可能是工作,但如果擦除擦除的问题是从VES执行擦除和尝试重写数据时,我会期望相同的效果。
  3. 我没有看到您附加的分区表的任何错误。

Thanks MT_Dialog

Matthieu.W
离线
最后一次露面:3 months 2 weeks ago
加入:2015-11-20 14:55
I am working with SDk1.0.12,

I am working with SDk1.0.12,

我检查了,闪光灯通过SWD充分擦除。
这是通过jlink删除后发生的事情的简单日志。
rdmem 0 64
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ..
WRMEM 0 0x0001020304050607.
rdmem 0 64
0x000101020304050606FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
wrmem 0 0xFFFFFFFFFFFFFFFF
rdmem 0 64
0x000101020304050606FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
the second write is ineffective.

otherwise, i understand the ves partition principle
但是,如果我将我的分区声明为VES,我就没有这个问题让我困惑。
Matthieu.

mt_dialog.
离线
最后一次露面:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
Hi matthieW,

Hi matthieW,

对不起,但我无法使用相同的闪存来复制您所提到的内容,使用您所提到的驱动程序和下面的片段,uint8_t data_buf_1和2只是包含40个字节的数据的阵列:

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));

我能够更新Flash数据,并从QSPI分区表工具验证,数据正确编写了数据,我可以制作的唯一假设是您不使用适配器才能与分区进行交互,所以某些东西侧向,或者在上面的例子中,您正在阅读没有同一任务的数据,而是从不同的任务读取数据,因此您正在删除闪存之前读取数据并使用上一个任务的新数据更新数据。关于VES,如上所述,每次执行新写入时,使用闪存的不同物理地址,它是空的。

谢谢mt_dialog.

Matthieu.W
离线
最后一次露面:3 months 2 weeks ago
加入:2015-11-20 14:55
我禁用了macronix

我禁用了Flash配置文件中的Macronix_Performance_Mode,一切正常工作正常。
thanks for your help.
Matthieu.

mt_dialog.
离线
最后一次露面:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
嗨matthieuw,

嗨matthieuw,

谢谢你表明。

Best Regards MT_dialog