如何将NVMS_GENERIC_PART的条目更改为零(不使用VES .AD_NVMS_DIRECT _...)。

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8 posts / 0 new
Last post
rlaxogjs90
离线
Last seen:3周前1年
加入:2017-04-04 10:04
如何将NVMS_GENERIC_PART的条目更改为零(不使用VES .AD_NVMS_DIRECT _...)。

相关问题
https://support.dialog-semicondiondiondum/forums/post/dialog-smartbond-bl ...

Hi, I'm having a problem with nvms adapter, and can not figure it out.

我正在使用Proximity_reporter示例,使用Suota使用8M位DA14680芯片。(SDK Ver1.0.12.1078)
“并尝试使用NVMS_GENERIC_PART未使用VES。”
I read the flash adapter manual and tried to change the partition but got the same result. NVMS_GENERIC_PART -> entry.flag: 2(VES)

Below is my project definition in custom_config_qspi_suota.h.

#define dg_configflash_adapter 1.
#define dg_configNVMS_ADAPTER 1
#define dg_configNVMS_VES 0
#define dg_configNVPARAM_ADAPTER 1

我删除了除my_partition_table.h文件之外的所有partition_table.h文件。

下面是my_partition_table.h文件。
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)

我在ad_nvms_init()中打印出一些日志以进行一些检查。
void ad_nvms_init(void){
.....
do {
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, entry.flag: %d\r\n", entry.type, entry.flags);
if(条目.flags == 2){
entry.flags = 0;
}

add_partition_entry(&entry);
}
flash_addr + = sizeof(partition_entry_t);
} whiled(rest.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);
}
#万一
.....
}

执行“erase_qspi_jtag_win”之后,然后“suota_initial_flash_jtag_win”,我收到此日志。
entry.type:1,entry.flag:0
entry.type: 19, entry.flag: 0
entry.type:20,条目.flag:0
entry.type: 17, entry.flag: 0
entry.type: 4, entry.flag: 0
entry.type:15,entry.flag:1
entry.type:16,条目.flag:1
entry.type:2,entry.flag:0
entry.type:18,条目.Flag:0
entry.type:5,条目.Flag:2 < - 预期为条目.FLAG:0(其中条目.Type:5是NVMS_GENERIC_PART)

我检查了整个Flash被SmartSnippets Toolbox删除了执行erase_qspi_jtag_win。
但总是获得相同的日志,看起来闪光灯中剩下的分区信息。
当然,由于变量“分区”不是null,因此不会调用函数init_default_partitions()。

此外,我没有调用ad_nvms_init()函数。它似乎是由BLE NVPARAM适配器调用的。

So, in summary. I want to use the NVMS_GENERIC_PART not using VES("entry.flag = 0").
If it's possible, I want to change the whole NVMS_GENERIC_PART to my own partition. Such as, NVMS_MY_CUSTOM_PART.(Actually, I tried to change the partition name and flag value. But failed. Didn't miss executing "erase_qspi_jtag_win".)
但如果它是不可能的,那么也许我应该将NVMS_GENERIC_PART扇区大小更改为0x01000并使用其余扇区到NVMS_MY_CUSTOM_PART。

Is there any other way to solve this problem?

Thank you.

Device:
PM_Dialog
离线
Last seen:4小时28分钟前
Staff
加入:2018-02-08 11:03
嗨rlaxogjs90,

嗨rlaxogjs90,

感谢您创建一个新的论坛帖子。SDK将NVMS_GENERIC_PART分区处理为VES分区。原因是因为该分区用于写入持续重新加载的数据,因此该机制增加了闪光灯的寿命。虽然,您可以绕过此分区,并在不使用VES的情况下添加您自己的分区。由于您使用的是nvms_generic_part名称,因此应将分区配置为VES。您可以请遵循您发布的上一个线程中描述的过程,以添加您的自定义分区吗?那么你可以用nvms_my_custom_par分区上传分区表吗?

谢谢,PM_Dialog

rlaxogjs90
离线
Last seen:3周前1年
加入:2017-04-04 10:04
Hi PM_Dialog. Do you mean

Hi PM_Dialog. Do you mean that I should change the PARTITION NAME of my_partition_table.h file?

如果是对的话,我只是遵循我之前完成的程序,没有任何改变。

my_partition_table.h.
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_user_param_part,0)< - 添加自定义分区表名。

partition_def.h.
typedef枚举{
NVMS_FIRMWARE_PART = 1,
nvms_param_part = 2,
NVMS_BIN_PART = 3,
nvms_log_part = 4,
// nvms_generic_part = 5,< - 阻止此行以防万一。
nvms_user_param_part = 6,
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;

并随后下面的程序。
Project - > Clean,Build DA14681-01-Refoy_qspi_suota,运行erase_qspi_jtag_win,运行suota_initial_flash_jtag_win。

对于结果,我以前喜欢相同的日志。可以找到nvms_generic_part(条目rype:5)而不是nvms_user_param_part(条目.type:6)。

日志
entry.type:1,entry.flag:0
entry.type: 19, entry.flag: 0
entry.type:20,条目.flag:0
entry.type: 17, entry.flag: 0
entry.type: 4, entry.flag: 0
entry.type:15,entry.flag:1
entry.type:16,条目.flag:1
entry.type:2,entry.flag:0
entry.type:18,条目.Flag:0
entry.type: 5, entry.flag: 2

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

我也试过这个。通过SmartSnippets Toolbox读取分区表,并导出NVMS_Partition_Table数据。
Change the exported file(entry.type: 5, entry.flag: 2 to entry.type: 5, entry.flag: 0) and then save.
(Address: 0x7F090, EA 05 FF "02" E1 00 1F 00 change to EA 05 FF "00" E1 00 1F 00)
删除nvms_partition_table部分,然后刻录更改的导出文件。

By this procedure everything seems ok, but by running suota_initial_flash_jtag_win, the entry.type: 5 returns to entry.flag: 2.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

有更多的建议......?

Thanks for your quick reply!

PM_Dialog
离线
Last seen:4小时28分钟前
Staff
加入:2018-02-08 11:03
嗨rlaxogjs90,

嗨rlaxogjs90,

请您按照3.1.1验证使用SmartSnippets Toolbox中描述的步骤Flash适配器概念(HTML)tutorial in order to add a custom partition table? Please try that and let me know.

谢谢,PM_Dialog

rlaxogjs90
离线
Last seen:3周前1年
加入:2017-04-04 10:04
Hi PM_Dialog.

Hi PM_Dialog.

由于我在短时间内获得了我的devkit,因此使用我的自定义板是遵循教程的唯一方法(使用JTAG接口)。
我跟着Proximity_reporter upota示例的教程,但是添加或更改分区表。
嗯,我的程序与教程之间的差异是Suota /非拟议示例和Devkit / Custom Board。

这是否会产生任何问题使用NVMS?

Thank you.

PM_Dialog
离线
Last seen:4小时28分钟前
Staff
加入:2018-02-08 11:03
嗨Laxogjs90,

嗨Laxogjs90,

The tutorial demonstrates the partitioning for non-SUOTA applications. Could you please send me all your configurations that you are using into your project?

谢谢,PM_Dialog

rlaxogjs90
离线
Last seen:3周前1年
加入:2017-04-04 10:04
Hi PM_Dialog.

Hi PM_Dialog.

我会粘贴我的custom_config_qspi_suota.h文件。

Thank you.

/ **
****************************************************************************************
*
* @file custom_config_qspi_suota.h.
*
* @brief Board Support Package. User Configuration file for cached QSPI mode.
*
* Copyright (C) 2015 Dialog Semiconductor.
* This computer program includes Confidential, Proprietary Information
*对话框半雷竞技电竞平台导体。版权所有。
*
****************************************************************************************
* /

#ifndef CUSTOM_CONFIG_QSPI_SUOTA_H_
#define CUSTOM_CONFIG_QSPI_SUOTA_H_

#include "bsp_definitions.h"

#define config_use_ble.
#undef config_use_ftdf.
#define CONFIG_RETARGET

#define dg_configuse_lp_clk lp_clk_rcx // lp_clk_32768
#define dg_configEXEC_MODE MODE_IS_CACHED
#define dg_configcode_location non_volatile_is_flash.
#define dg_configEXT_CRYSTAL_FREQ EXT_CRYSTAL_IS_16M

#define dg_configimage_setup development_mode.
#define dg_configEMULATE_OTP_COPY (0)

#define dg_configimage_flash_offset(0x20000)
#define dg_configsuota_support(1)

#define dg_configuser_can_use_timer1(0)

#define dg_configoptimal_retram(1)

#if(dg_configoptimal_retram == 1)
#if(dg_configblack_orca_ic_rev == black_orca_ic_rev_a)
#define dg_configmem_retention_mode(0x1b)
#define dg_configSHUFFLING_MODE (0x0)
#别的
#define dg_configMEM_RETENTION_MODE (0x07)
#define dg_configSHUFFLING_MODE (0x0)
#万一
#万一

#define dg_configuse_wdog(1)

#define dg_configflash_connected_to(flash_connected_to_1v8)
#define dg_configflash_power_down(0)

#define dg_configPOWER_1V8_ACTIVE (1)
#define dg_configpower_1v8_sleep(1)

#define dg_configbattery_type(battery_type_custom)
#定义dg_configBATTERY_CHARGE_VOLTAGE 0 xA // 4.2V
#define dg_configbattery_type_custom_adc_voltage(3475)//(3439)
//#定义dg_configbattery_low_level(2457)// 3V
#define dg_configPRECHARGING_THRESHOLD (2462) // 3.006V
#define dg_configcharging_threshold(2498)// 3.05V
#define dg_configbattery_charge_current 13 // 60mA
#define dg_configbattery_precharge_current 29 // 2.1ma
#define dg_configbattery_charge_ntc 1 //禁用
#define dg_configprocharging_timeout(30 * 60 * 100)// n x 10毫秒

#define dg_configuse_soc 1
/ *Uncomment the following line to enable State-of-Charge debugging or performance test */
//#define DEBUG_SOC
#f定义(debug_soc)
#define CONFIG_RETARGET
#万一

#define dg_configuse_usb 1
#define dg_configuse_usb_charger 1.
#define dg_configALLOW_CHARGING_NOT_ENUM 1
#define dg_configUSE_NOT_ENUM_CHARGING_TIMEOUT 0

#define dg_configuse_prodk(1)

#define dg_configUSE_SW_CURSOR (1)

#define dg_configcacheable_qspi_area_len(nvms_param_part_start - memory_qspif_base)

/ *************************************************************************************************
*内存特定配置
* /
#define dg_configQSPI_CACHED_OPTIMAL_RETRAM_0_SIZE_AE ( 64 * 1024)
#define dg_configQSPI_CACHED_RAM_SIZE_AE ( 32 * 1024)
#define dg_configqspi_cached_retram_0_size_ae(96 * 1024)

/ *************************************************************************************************
*外围特定配置
* /
#define dg_configflash_adapter 1.
#define dg_configNVMS_ADAPTER 1
#define dg_configNVMS_VES 0
#define dg_configNVPARAM_ADAPTER 1

//#定义dg_configdisable_background_flash_ops 1

#define dg_configgpadc_adapter 1.

#define dg_configuse_hw_i2c 1
#define dg_configUSE_HW_QUAD 1
#define dg_configuse_hw_spi 1
#define dg_configuse_hw_timer0 1
#define dg_configUSE_HW_TIMER2 1

#define dg_configI2C_ADAPTER 1
#define dg_configSPI_ADAPTER 1

#define defaultBLE_ATT_DB_CONFIGURATION (0x10) // with "Peripheral Preferred Connection Parameters"
#define defaultble_ppcp_interval_min(ble_conn_interval_from_ms(500))// 500 ms
#define defaulble_ppcp_interval_max(ble_conn_interval_from_ms(750))// 750 ms
#define defaultble_ppcp_slave_latency(0)// 0事件
#define defaulble_ppcp_sup_timeout(ble_supervision_tmo_from_ms(6000))// 6000 ms

#define ble_max_misses_allowed(3)
#define BLE_MAX_DELAYS_ALLOWED (3)

/ *使用动态列表BLE事件而不是Freertos队列* /
#define ble_mgr_use_evt_list(1)

/ *
* Suota Loader配置:
* - 仅在GATT上启用Suota,将Suota_version设置为任何版本> = suota_version_1_1
*并留下upota_psm未定义。
* - To enable SUOTA over GATT and L2CAP CoC, set SUOTA_VERSION to any version >= SUOTA_VERSION_1_2
* and also define SUOTA_PSM to match the desired PSM. In this case the central device
*可以根据其偏好使用两者中的任何一种。
* /
#define SUOTA_VERSION SUOTA_VERSION_1_3
#define suota_psm 0x81

//#定义USE_PARTITION_TABLE_1MB_WITH_SUOTA
#define USE_MY_PARTITION_TABLE

/ *************************************************************************************************
* freertos特定配置
* /
#define os_freertos / *定义它以使用freertos * /

#if SUOTA_PSM
#define SUOTA_HEAP_OVERHEAD (3200)
#别的
#define SUOTA_HEAP_OVERHEAD (0)
#万一

#if (dg_configUSE_SOC)
#f定义(debug_soc)
#ifndef RELEASE_BUILD
/ *调试SOC不应在发布构建中使用* /
#define configtotal_heap_size(12900 + suota_heap_overhead)/ *这是freertos total堆大小* /
#别的
#Error“Debug SoC和Suota Over L2CAP不能在发布目标中一起使用”
#万一
#别的
#define configtotal_heap_size(11100 + suota_heap_overhead)/ *这是freertos total堆大小* /
#万一
#别的
#define configTOTAL_HEAP_SIZE (11000 + SUOTA_HEAP_OVERHEAD) /* This is the FreeRTOS Total Heap Size */
#万一

/ *************************************************************************************************
* BLE设备配置
* /
#define dg_configBLE_CENTRAL (0)
#define dg_configble_gatt_client(0)
#define dg_configble_observer(0)
#define dg_configble_broadcaster(0)
#ifndef suota_psm.
#define dg_configBLE_L2CAP_COC (0)
#万一

/ *Include bsp default values */
#include "bsp_defaults.h"
/ *包括内存布局* /
#include“bsp_memory_layout.h”
#endif / * custom_config_qspi_suota_h_ * /

PM_Dialog
离线
Last seen:4小时28分钟前
Staff
加入:2018-02-08 11:03
嗨rlaxogjs90。

嗨rlaxogjs90。

谢谢您提供配置。让我检查一下,我会尽快回复你。

谢谢,

PM_Dialog