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

⚠️
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.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8 posts / 0 new
Last post
rlaxogjs90
Offline
Last seen:1 year 1 month ago
加入: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)
"And trying to use the NVMS_GENERIC_PART not using 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文件。

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){
.....
do {
ad_flash_read(flash_addr, (uint8_t *) &entry, sizeof(partition_entry_t));
if (entry.type != 0xFF && entry.type != 0 && entry.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);
} while (entry.type != 0xFF);
#if CONFIG_PARTITION_TABLE_CREATE
if (partitions == NULL) {
printf("ad_nvms_init >> init_default_partitions\r\n");
init_default_partitions();
}else{
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, 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,条目.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.
但总是获得相同的日志,看起来闪光灯中剩下的分区信息。
当然,由于变量“分区”不是null,因此不会调用函数init_default_partitions()。

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

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
Offline
Last seen:1 day 14 hours ago
Staff
加入:2018-02-08 11:03
嗨rlaxogjs90,

嗨rlaxogjs90,

Thanks for creating a new forum post. The SDK handles the NVMS_GENERIC_PART partition as a VES partition. The reason is because this partition is used for writing data that are continuously reloaded, so this mechanism increases the lifetime of the flash. Although, you can bypass this partition and add you own partition without using the VES. Since you are using the NVMS_GENERIC_PART name, the partition should be configured as VES. Can you please follow the procedure described in the previous thread that you have posted for adding your custom partition? Then can you please upload the partition table with the NVMS_MY_CUSTOM_PAR partition?

Thanks, PM_Dialog

rlaxogjs90
Offline
Last seen:1 year 1 month ago
加入: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 ) <- Add custom partition table name.

partition_def.h
typedef enum {
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。

对于结果,我得到了同样的日志之前。和can find NVMS_GENERIC_PART(entry.type: 5) instead of NVMS_USER_PARAM_PART(entry.type: 6).

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,条目.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
Offline
Last seen:1 day 14 hours ago
Staff
加入:2018-02-08 11:03
嗨rlaxogjs90,

嗨rlaxogjs90,

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

Thanks, PM_Dialog

rlaxogjs90
Offline
Last seen:1 year 1 month ago
加入:2017-04-04 10:04
Hi PM_Dialog.

Hi PM_Dialog.

Since I got my devkit somewhere short, using my custom board is the only way to follow the tutorial(using jtag interface).
我跟着Proximity_reporter upota示例的教程,但是添加或更改分区表。
嗯,我的程序与教程之间的差异是Suota /非拟议示例和Devkit / Custom Board。

Does this make any problem using NVMS?

Thank you.

PM_Dialog
Offline
Last seen:1 day 14 hours ago
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?

Thanks, PM_Dialog

rlaxogjs90
Offline
Last seen:1 year 1 month ago
加入:2017-04-04 10:04
Hi PM_Dialog.

Hi PM_Dialog.

I'll paste my custom_config_qspi_suota.h file.

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 // disabled
#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
#if defined(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)

/ *************************************************************************************************
* Memory specific config
*/
#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)

/ *************************************************************************************************
* Peripheral specific config
*/
#define dg_configflash_adapter 1.
#define dg_configNVMS_ADAPTER 1
#define dg_configNVMS_VES 0
#define dg_configNVPARAM_ADAPTER 1

//#define 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 defaultBLE_PPCP_INTERVAL_MAX (BLE_CONN_INTERVAL_FROM_MS(750)) // 750 ms
#define defaultble_ppcp_slave_latency(0)// 0事件
#define defaultBLE_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 configuration:
* - To enable SUOTA over GATT only, set SUOTA_VERSION to any version >= SUOTA_VERSION_1_1
* and leave SUOTA_PSM undefined.
* - 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
* can use either of both according to its preference.
*/
#define SUOTA_VERSION SUOTA_VERSION_1_3
#define suota_psm 0x81

//#define USE_PARTITION_TABLE_1MB_WITH_SUOTA
#define USE_MY_PARTITION_TABLE

/ *************************************************************************************************
* freertos特定配置
*/
#define OS_FREERTOS /* Define this to use FreeRTOS */

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

#if (dg_configUSE_SOC)
#if defined(DEBUG_SOC)
#ifndef RELEASE_BUILD
/ *DEBUG SOC should not be used in release builds */
#define configtotal_heap_size(12900 + suota_heap_overhead)/ *这是freertos total堆大小* /
#别的
#error "DEBUG SOC and SUOTA over L2CAP cannot be used in release target together"
#万一
#别的
#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 device config
*/
#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"
#万一/ *CUSTOM_CONFIG_QSPI_SUOTA_H_ */

PM_Dialog
Offline
Last seen:1 day 14 hours ago
Staff
加入:2018-02-08 11:03
嗨rlaxogjs90。

嗨rlaxogjs90。

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

Thanks,

PM_Dialog