如何使用qspi flash的静止空间?

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
8 posts / 0 new
最后一篇
尼格利
离线
Last seen:2个月1周前
加入:2018-03-20 08:24
如何使用qspi flash的静止空间?

我现在在da1468x pro开发套件上使用qspi flash的1m-byte分区。如我所知,Pro开发套件中的Winbond Flash是8 MB,所以我想使用REST空间(7 MB)的闪存。我修改了partition_table.h如下所示(刚添加最后一行)
PARTITION2( 0x000000 , 0x07F000 , NVMS_FIRMWARE_PART , 0 )
partition2(0x07f000,0x001000,nvms_partition_table,partition_flag_read_only)
PARTITION2( 0x080000 , 0x010000 , NVMS_PARAM_PART , 0 )
PARTITION2( 0x090000 , 0x030000 , NVMS_BIN_PART , 0 )
Partition2(0x0c0000,0x020000,nvms_log_part,0)
Partition2(0x0e0000,0x020000,nvms_generic_part,partition_flag_ves)
partition2(0x100000,0x020000,nvms_test_part,0)// <=======添加了此行以使用闪存的REST空间

然后尝试在“nvms_test_part”分区中编写数据,但失败。在“nvms_log_part”中做同样的事情,结果还可以!
有设置我想念吗?和我怎么能使用the rest space of QSPI flash ? thansk for your help.

Device:
尼格利
离线
Last seen:2个月1周前
加入:2018-03-20 08:24
I mistook the size of

我误认为是Pro DK上的Winbond Flash的大小为8M字节,实际上是8 Mbits。现在,我仍然对QSPI闪存分区有一个问题。如果我想在Partition2中创建自己的部分,如下所示。(nvms_test_part = 21)结果是在此空间中写入的故障。Dose SDK允许用户在Partition2中创建自己的空间2?如果是,怎么办?
PARTITION2( 0x000000 , 0x07F000 , NVMS_FIRMWARE_PART , 0 )
partition2(0x07f000,0x001000,nvms_partition_table,partition_flag_read_only)
PARTITION2( 0x080000 , 0x010000 , NVMS_PARAM_PART , 0 )
PARTITION2( 0x090000 , 0x030000 , NVMS_BIN_PART , 0 )
Partition2(0x0c0000,0x020000,nvms_log_part,0)
PARTITION2( 0x0E0000 , 0x010000 , NVMS_GENERIC_PART , PARTITION_FLAG_VES ) // downsize to be 0x010000
NVMS_Test_PART x010000 x0f0000 PARTITION2 (0, 0,0 ) // <======= add this part space to use

PM_Dialog
离线
Last seen:13小时53分钟前
职员
加入:2018-02-08 11:03
Hi nigelyang,

Hi nigelyang,

我创建了一个简短的演示,以便用nvms_test_part分区复制您的问题,但我能够创建它,写入它并阅读它。对于分区表,我使用了已发布的代码片段。请检查附件中的示例代码。此示例演示了整个分区表的初始化,将内容写入NVMS_TEST_PART分区,并读回以前写的内容。请将AD_NVMS.h标头文件添加到MAIC.C中,并在Custom_Config_Qspi.h中执行以下配置:

#定义dg_configflash_adapter(1)

#定义dg_confignvms_adapter(1)

#定义dg_confignvms_ves(0)

In the partition_table.png file of the attachments, you could find a screenshot from SmartSnippets Toolobox . The NVMS_Test_PART partition is the UNKNOWN_PARTITION_ID, because the custom partition ID (21) is not matched with the tool.

此外,我强烈建议您阅读Adapters Concept - Flash adaptertutorial of DA14680 from our support port for more information.

Thanks, PM_Dialog

附件:
尼格利
离线
Last seen:2个月1周前
加入:2018-03-20 08:24
我使用了你的示例代码

我使用了你的示例代码DSPS project code, but got same failure result. I found the partition handle(nv) is null when I do "nv = ad_nvms_open(NVMS_Test_PART);" but other partition handles are not null if opening other partition, such as NVMS_FIRMWARE_PART ,NVMS_PARAM_PART ,NVMS_BIN_PART , NVMS_LOG_PART , NVMS_GENERIC_PART.
I am sure I have added PARTITION2( 0x0F0000 , 0x010000 , NVMS_Test_PART , 0 ) in partition_table.h, "NVMS_Test_PART = 21" in partition_def.h and "case NVMS_PIXELS_PART: " in the function ad_nvms_direct_bind(). Do I miss any setting else so that adapter cannot recognize my partition ? I have read Adapters Concept - Flash adapter tutorial of DA14680 but it doesn't mention how to create user own partition space. appreciate your help.

尼格利
离线
Last seen:2个月1周前
加入:2018-03-20 08:24
问题现在解决了

在我执行“erase_qspi_jtag_win”之后,现在解决了问题。顺便说一下,关于这个问题有三个问题。Q1除了更改partition_table,我们应该在编程项目代码之前使用“erase qpsi flash”命令效果是什么?Q2:NVMS分区ID枚举的规则是什么?默认值是“typedef枚举{
NVMS_FIRMWARE_PART = 1,
NVMS_PARAM_PART = 2,
NVMS_BIN_PART = 3,
NVMS_LOG_PART = 4,
nvms_generic_part = 5,
NVMS_PLATFORM_PARAMS_PART = 15,
nvms_partition_table = 16,
NVMS_FW_EXEC_PART = 17,
NVMS_FW_UPDATE_PART = 18,
NVMS_PRODUCT_HEADER_PART = 19,
NVMS_IMAGE_HEADER_PART = 20,
} nvms_partition_id_t;
我可以将自己的分区ID设置为6到14岁吗?这些数字已经占用了吗?
Q3. what's purpose of the partition, NVMS_BIN_PART ? the tutorial only mentions "for storing binaries"! what is the outcome if delete this partition?
谢谢你的答案。

PM_Dialog
离线
Last seen:13小时53分钟前
职员
加入:2018-02-08 11:03
Hi nigelyang,

Hi nigelyang,

Glad that your problem has been fixed.
Q1 : It is best practice to execute the "erase_qspi_jtag_win" before programming the chip. Especially when creating new partition table, it is mandatory to execute the "erase_qspi_jtag_win", because the chip will probably maintain the previous partition table. Our recommendation is to execute the "erase_qspi_jtag_win" first.

Q2:关于NVMS分区ID的枚举没有任何特定规则。是的,您能够使用6和14作为分区ID,因为它们是在我们推荐的枚举中保留的。此外,您可以使用您想要的每个数字作为分区ID,但不应重复。

Q3: The NVMS_BIN_PART is used during a non-SUOTA enabled application for storing binaries. This partition is not commonly used in our projects, so you are able to remove it or replace it with your own partition.

Regards, PM_Dialog

rlaxogjs90.
离线
Last seen:1年1个月前
加入:2017-04-04 10:04
你好。

你好。
Just can't find how to post a new question. Sorry.

我在这个问题上有一个类似的问题,但无法弄清楚。

I'm using the proximity_reporter example using suota with 8M-bit DA14680 chip.
And trying to use the NVMS_GENERIC_PART not using VES.
我读取了Flash适配器手册,并尝试更改分区,但同样的结果。nvms_generic_part - >条目.Flag:2(Ves)

下面是我在custom_config_qspi_suota.h中的项目定义。

#定义dg_configFLASH_ADAPTER 1
#define dg_confignvms_adapter 1.
#define dg_confignvms_ves 0.
#定义dg_configNVPARAM_ADAPTER 1

I erased all partition_table.h files except my_partition_table.h file just in case.

Below is my_partition_table.h file.
PARTITION2( 0x000000 , 0x01E000 , NVMS_FIRMWARE_PART , 0 )
Partition2(0x01e000,0x001000,nvms_product_header_part,0)
Partition2(0x01f000,0x001000,nvms_image_header_part,0)
PARTITION2( 0x020000 , 0x050000 , NVMS_FW_EXEC_PART , 0 )
Partition2(0x070000,0x00d000,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 , 0x051000 , NVMS_FW_UPDATE_PART , 0 )
Partition2(0x0e1000,0x01f000,nvms_generic_part,0)

I printed out some logs in ad_nvms_init() for some check.
void ad_nvms_init(void){
.....
做 {
ad_flash_read(flash_addr,(uint8_t *)&条目,sizeof(partition_entry_t));
if(条目.type!= 0xff &&条目.Type!= 0 &&条目.magic == partition_entry_magic &&
entry.valid == 0xFF) {
printf(“entry.type:%d,stry.flag:%d \ r \ n”,stry.type,stry.flags);
if (entry.flags == 2){
entry.flags = 0;
}

add_partition_entry(&条目);
}
flash_addr + = sizeof(partition_entry_t);
} while (entry.type != 0xFF);
#if config_partition_table_create.
if(partitions == null){
printf("ad_nvms_init >> init_default_partitions\r\n");
init_default_partitions();
}别的{
printf("ad_nvms_init >> partitions2: %d\r\n", partitions);
}
#endif
.....
}

After executing "erase_qspi_jtag_win" then "suota_initial_flash_jtag_win", I get this log.
entry.type: 1, entry.flag: 0
entry.type: 19, entry.flag: 0
entry.type: 20, entry.flag: 0
entry.type: 17, entry.flag: 0
entry.type: 4, entry.flag: 0
entry.type: 15, entry.flag: 1
entry.type: 16, entry.flag: 1
entry.type:2,entry.flag:0
entry.type: 18, entry.flag: 0
entry.type: 5, entry.flag: 2 <- expected to be entry.flag: 0(where entry.type: 5 is NVMS_GENERIC_PART)

I checked the whole flash was erased executing erase_qspi_jtag_win by smartsnippets toolbox.
But always get the same log that looks like there is a partition information left in the flash.
And of course function init_default_partitions() is not called since the variable "partitions" is not NULL.

Besides, I didn't call the ad_nvms_init() function. It seems like it is called by the BLE NVPARAM adapter.

所以,总之。我想使用NVMS_GENERIC_PART未使用VES。有没有其他方法可以解决这个问题?

谢谢你。

PM_Dialog
离线
Last seen:13小时53分钟前
职员
加入:2018-02-08 11:03
Hi rlaxogjs90,

Hi rlaxogjs90,

Could you please clarify which your issue is? Do you want to add a new partition? Also, I would highly suggest you to copy you issue into a new thread. This is the procedure that you should follow in order to create a new forum thread:

  1. Visit our forum page in this link:https://support.dialog-semiconductor.com/forum
  2. 请登录,展开“蓝牙”选项卡,您将看到对话框智能电动蓝牙低能量(H / W,S / W,Tools)论坛。
  3. Then, enter the Dialog “Smartbond Bluetooth Low Energy – Software” forum.
  4. Hit to the “New Topic” and finally create your post with the appropriate keywords.

Thanks, PM_Dialog