跳转至

通信与调试 NV 配置

NAS

模块说明

参数

说明

模块ID

24

模块名

NAS

模块描述

非接入层模块(Non-Access Stratum)

模块类型

Custom

模块Key

NV_ID_NAS_SIM_PRESENCE_ENABLE

Key ID

0x7107

Key状态

alive

Key描述

SIM卡在位检查使能。

结构类型

bool

默认值

true

备注

-

NV_ID_NAS_SIM_POWER_SAVING_ENABLE

Key ID

0x7108

Key状态

alive

Key描述

SIM卡节能模式使能开关。

结构类型

bool

默认值

true

备注

打开后,SIM卡仅在按需使用时(如进行NAS鉴权或Pin码校验)或轮询在位检查时激活,且业务完成后马上会去激活。

NV_ID_NAS_NAS_CONFIG

Key ID

0x7109

Key状态

alive

Key描述

当SIM卡EF文件的NAS配置不存在时所使用的NAS配置。

结构类型

typedef struct {
    bool  nslpi_configured;                /*!< Whether NAS signalling low priority configured */
    bool  nslpi_override_configured;       /*!< Whether UE can override the NAS signalling low priority indicator */
    bool  fast_first_hpplmn_configured;    /*!< Whether the UE can perform Fast First HPPLMN Search upon selecting a VPLMN */
    bool  min_periodic_search_time_available; /*!< Whether the minimum HPPLMN search time present on SIM */
    uint8_t  min_periodic_search_time;     /*!< a minimum value in minutes for the HPPLMN search timer */
    bool  t3245_behaviour;                 /*!< T3245 used/not used */
    bool  attach_with_imsi;                /*!< Attach with IMSI on change to non-EPLMN */
    bool  eab_configured;                  /*!< Whether Extended access barring configured */
    bool  eab_override_configured;         /*!< Whether UE can override the Extended access barring indicator */
} nas_kv_nas_config_t;

默认值

nslpi_configured                   = false;
nslpi_override_configured          = false;
fast_first_hpplmn_configured       = false;
min_periodic_search_time_available = false;
min_periodic_search_time           = 0;
t3245_behaviour                    = false;
attach_with_imsi                   = false;
eab_configured                     = false;
eab_override_configured            = false;

备注

-

NV_ID_NAS_CONTEXT_CONFIG

Key ID

0x710A

Key状态

alive

Key描述

NAS默认PDP上下文信息。

结构类型

#define NAS_NV_PDN_CONTEXT_NUM  3
typedef nas_kv_context_config_t nas_kv_context_config_nv_t[NAS_NV_PDN_CONTEXT_NUM];

typedef struct {

    uint8_t      pdn_type;            /*!< IPv4, IPv6, non-IP  */
    uint8_t      request_type;        /*!< 0:normal, 1:emergency */
    uint8_t      apn_len;             /*!< >0 if optional APN defined */
    uint8_t      apn[KV_MAX_APN_LEN]; /*!< up to 100  bytes, in length/label format as 23.003 section 9 */
    uint8_t      auth_port;           /*!< 0 none 1 pap 2 chap */
    uint8_t      auth_username_len;   /*!< >0 if optional autch username defined */
    uint8_t      auth_password_len;   /*!< >0 if optional autch password defined */
    uint8_t      auth_username[MAX_AUTH_USERNAME_PASSWORD_PLUS_1]; /*!< up to 60  bytes */
    uint8_t      auth_password[MAX_AUTH_USERNAME_PASSWORD_PLUS_1]; /*!< up to 60  bytes */
    uint8_t      h_comp;              /* controls PDP header compression */
    uint8_t      p_cscf_discovery;    /* 0:not influenced by +CGDCONT, 1:NAS signalling, 2:DHCP  */
    bool         nslpi;               /*  NAS signalling low priority */
    bool         im_cn_signaling;
} nas_kv_context_config_t;

typedef enum IP_TYPE_e_ {
    INVALID_PDN = 0x0,
    IPV4        = 0x1,
    IPV6        = 0x2,
    IPV4V6      = 0x3,
    NON_IP      = 0x5
} nas_pdn_type;

#define KV_MAX_APN_LEN 101
#define MAX_AUTH_USERNAME_PASSWORD_PLUS_1 61

默认值

pdn_type = IPV4V6;
request_type = 0;
apn_len = 0;
auth_port = 0;
auth_username_len = 0;
auth_password_len = 0;
h_comp = 0;
p_cscf_discovery = 0;
nslpi = 0;
im_cn_signaling = 0;

备注

  • 共有三个PDN上下文可以存NV,cid分别为0、9、10,上述默认值为cid0的默认值,且仅cid为0的上下文有默认值。
  • 配置APN时请务必遵循协议 23.003 第九章节,例如需要配置APN为test,则apn_len = 5,apn= {4,116,101,115,116},第一个字符4为test字节数,后面四个数字为test的ASCII码。
  • 该NV为加密NV,不能通过DebugKits配置,DebugKits里不显示,用户可在SDK中修改,可以使用AT+CGDCONT命令和AT+CGAUTH命令修改。

NV_ID_NAS_UE_CAPABILITY_CONFIG

Key ID

0x710B

Key状态

alive

Key描述

UE部分NAS CIoT能力配置。

结构类型

typedef struct {
    bool    psm_supported;
    uint8_t req_psm_active_timer;    /* T3324    GPRS timer 2 encoded value as 24.008 10.5.7.4 octet 3 */
    bool    ext_timer_support;       /* UE supports extended periodic timer */
    uint8_t req_ext_periodic_timer;  /* T3412ext GPRS timer 3 encoded value as 24.008 10.5.7.4a octet 3 */
} nas_ue_capability_config_t;

默认值

psm_supported = true;
req_psm_active_timer = 0x05;   /* 10 seconds */
req_ext_periodic_timer = 0x41; /* 10 hrs */

ext_timer_support = true;

备注

-

NV_ID_NAS_PCO_IE_TYPE

Key ID

0x710C

Key状态

alive

Key描述

默认PCO类型。

结构类型

typedef enum {
    PCO_IE      = 1,
    EXT_PCO_IE  = 2
} nas_kv_pco_ie_type_t;

默认值

pco_ie_type = PCO_IE;

备注

-

NV_ID_NAS_SUPPORT_SMS

Key ID

0x710D

Key状态

alive

Key描述

SMS功能使能开关。

结构类型

bool

默认值

false

备注

需要在CFUN0状态配置此NV。

NV_ID_NAS_NAS_HPPLMN_SEARCH_ENABLED

Key ID

0x710E

Key状态

alive

Key描述

HPPLMN搜索使能开关。

结构类型

bool

默认值

false

备注

-

NV_ID_NAS_POWER_OFF_GUARD_TIMER

Key ID

0x7110

Key状态

alive

Key描述

关机前尝试去注册的最大时长(s)。

结构类型

uint16_t

默认值

5

备注

可以配置0~5s。

配置超过5的值时会使用默认值5s。

入网后执行关机,如果超过配置的时长没有从网络去注册成功会强制关机。

配置成0时立即关机。

NV_ID_NAS_ALWAYS_ON_ANYCELL

Key ID

0x7111

Key状态

alive

Key描述

有卡状态脱离覆盖后是否尝试anycell驻留。打开可能增加功耗。

结构类型

bool

默认值

false

备注

-

NV_ID_NAS_PDP_CONTEXT_DYNAMIC_PARAM_REQUEST_ITEM_CONFIG

Key ID

0x7118

Key状态

alive

Key描述

DNS服务器地址请求配置。

结构类型

typedef struct {
    bool dns_server_ipv4_addr_request; /* 是否请求ipv4地址 */
    bool dns_server_ipv6_addr_request; /* 是否请求ipv6地址 */
} nas_pdp_context_dynamic_param_request_item_config_t;

默认值

dns_server_ipv4_addr_request = true;
dns_server_ipv6_addr_request = true;

备注

-

NV_ID_NAS_RPM_ENABLED

Key ID

0x711A

Key状态

alive

Key描述

RPM功能使能开关。

结构类型

bool

默认值

false

备注

-

NV_ID_NAS_RPM_PARAMS

Key ID

0x711B

Key状态

alive

Key描述

RPM功能参数。

结构类型

typedef struct {
    uint8_t   rpm_n1;  /* Max number of SW resets per Hour allowed by RPM following “permanent” EMM reject */
    uint8_t   rpm_t1;  /* Average time before RPM resets modem following permanent MM/GMM/EMM reject */
    uint8_t   rpm_f1;  /* Max number of PDP Activation Requests per Hour allowed by RPM following a PDP Activation Ignore Scenario */
    uint8_t   rpm_f2;  /* Max number of PDP Activation Requests per Hour allowed by RPM following a “Permanent” PDP Activation Reject */
    uint8_t   rpm_f3;  /* Max number of PDP Activation Requests per Hour allowed by RPM following a “Temporary” PDP Activation Reject */
    uint8_t   rpm_f4;  /* Max number of PDP Activation/ Deactivation Requests per Hour allowed by RPM */
    uint8_t   rpm_lr1; /* number of hours before C-BR-1 is decremented by 1 */
    uint8_t   rpm_lr2; /* number of hours before C-R-1 is decremented by 1 */
    uint8_t   rpm_lr3; /* number of hours before C-PDP-1 TO C-PDP-4 is decremented by 1 */
} nas_kv_rpm_params_t;

默认值

#define NAS_CONFIG_RPM_DEFAULT_T1    10
#define NAS_CONFIG_RPM_DEFAULT_F1    60
#define NAS_CONFIG_RPM_DEFAULT_F2    30
#define NAS_CONFIG_RPM_DEFAULT_F3    60
#define NAS_CONFIG_RPM_DEFAULT_F4    30
/** Default values from TS.34 V5.0 */
rpm_n1 = 1;
rpm_t1 = NAS_CONFIG_RPM_DEFAULT_T1;
rpm_f1 = NAS_CONFIG_RPM_DEFAULT_F1;
rpm_f2 = NAS_CONFIG_RPM_DEFAULT_F2;
rpm_f3 = NAS_CONFIG_RPM_DEFAULT_F3;
rpm_f4 = NAS_CONFIG_RPM_DEFAULT_F4;
/* leak rate defaults not specified */
rpm_lr1 = 0;
rpm_lr2 = 0;
rpm_lr3 = 0;

备注

-

NV_ID_NAS_RPM_COUNTS

Key ID

0x711C

Key状态

alive

Key描述

RPM计数。

结构类型

typedef struct {
    uint8_t   rpm_c_br1;  /* C-BR-1计数 */
    uint8_t   rpm_c_r1;   /* C-R-1计数 */
    uint8_t   rpm_c_pdn1; /* C-PDP-1计数 */
    uint8_t   rpm_c_pdn2; /* C-PDP-2计数 */
    uint8_t   rpm_c_pdn3; /* C-PDP-3计数 */
    uint8_t   rpm_c_pdn4; /* C-PDP-4计数 */
} nas_kv_rpm_counts_t;

默认值

rpm_c_br1 = 0;
rpm_c_r1 = 0;
rpm_c_pdn1 = 0;
rpm_c_pdn2 = 0;
rpm_c_pdn3 = 0;
rpm_c_pdn4 = 0;

备注

-

NV_ID_NAS_IMSI_CATCHER_PROTECT

Key ID

0x7120

Key状态

alive

Key描述

防伪基站功能使能开关。

结构类型

uint8_t
0: 关闭功能
1: 使用模式1
2: 使用模式2

默认值

0

备注

关闭防伪基站功能时,被bar防伪基站小区列表不会删除,需要调用AT指令AT+NCSBLACKCELL清除所有防伪基站小区。

模式1会尝试接入网络一次,模式2不会尝试接入网络。

模式2不能在漫游场景下使用。

NV_ID_NAS_SUPPORT_ROAMING

Key ID

0x7121

Key状态

alive

Key描述

是否开启漫游功能。

结构类型

uint8_t
0:关闭功能
1:开启功能

默认值

1

备注

默认开启漫游功能,仅关机状态下可更改配置(开机时更改不生效)。

NV_ID_NAS_SUPPORT_SIM_INSERT_AUTO_CON

Key ID

0x7122

Key状态

alive

Key描述

是否开启插卡自动入网功能。

结构类型

uint8_t
0:关闭功能
1:开启功能

默认值

0

备注

默认关闭插卡自动入网。

若开启插卡自动入网,需要在拔卡前发起过入网,插卡自动入网功能才会生效。

NV_ID_NAS_UPDATE_REG_UNKNOWN_STAT_TIMER_LEN

Key ID

0x7124

Key状态

alive

Key描述

设置cereg:4后定时更新搜网状态。

结构类型

uint8_t     timer_len;  /* 定时器时长(单位:s)*/

默认值

timer_len = 0,不开启定时更新。

备注

允许时长0~60s。超出范围按20s处理。

开启更新,注册态脱网上报cereg:4后,设置时长内未完成搜索上报cereg:2,未搜到可用网络报cereg:0。

更改后开机生效。

NV_ID_NAS_UPLMN_CHANGE_WRITE_TO_SIM_ENABLED

Key ID

0x7126

Key状态

alive

Key描述

设置使用+CPOL修改用户优选PLMN列表后,修改是否写入SIM卡。

结构类型

uint8_t
0:关闭功能
1:开启功能

默认值

0

备注

默认不写入SIM卡。

NV_ID_NAS_HPPLMN_SEARCH_OVERRIDE

Key ID

0x7129

Key状态

alive

Key描述

覆写HPPLMN搜索配置。

结构类型

typedef struct {
    bool       fast_first_hpplmn_configured;
    uint8_t    hpplmn_timer_length;
} nas_kv_nas_hpplmn_search_override_t;

默认值

fast_first_hpplmn_configured = false;

hpplmn_timer_length = 0;

备注

fast_first_hpplmn_configured:当KV或SIM卡中配置为true时,使能此项。

hpplmn_timer_length:允许配置范围[2,60],单位:分钟。当KV配置非0时,使用KV配置;当KV配置为0时,使用SIM卡配置。

NV_ID_NAS_USER_HIGH_PRIO_PLMNS

Key ID

0x712A

Key状态

alive

Key描述

用户配置的最高/次高优先级PLMN。

结构类型

typedef struct {
      uint8_t          user_top_prio_plmn_num;
      uint8_t          user_sec_prio_plmn_num;
      plmn_id          user_top_prio_plmn[8];
      plmn_id          user_sec_prio_plmn[8];
} nas_kv_user_high_prio_plmn_t;

默认值

数量0。

备注

用户可配置高优先级PLMN和次高优先级PLMN。优先级高于SIM卡中的EHPLMN,配置的PLMN在FPLMN列表中且不是EHPLMN时不可用。

NV_ID_NAS_AUTO_APN_CONFIG

Key ID

0x713B

Key状态

alive

Key描述

APN自适配功能配置。

结构类型

typedef struct {
    uint8_t     enable_auto_apn;
    uint8_t     reattempt_times;        /* apn reattempt times when no response */
    uint8_t     reserve1;
    uint8_t     reserve2;
} nas_kv_auto_apn_config_t;

默认值

enable_auto_apn = 1,默认开启APN自适配功能(编译版本时要添加编译宏AUTO_APN_MATCH_SUPPORT);

reattempt_times = 1,默认网络无响应时,用当前APN再次发起1次尝试。

备注

reattempt_times配置范围:0~4

NV_ID_NAS_SINGLE_IP_STACK_CONFIG

Key ID

0x713F

Key状态

alive

Key描述

配置网络下发只允许单栈(esm cause#52)时,是否只建立一路承载。

结构类型

bool

默认值

false

备注

-

NV_ID_NAS_PDN_REMAP_ENABLE

Key ID

0x7140

Key状态

alive

Key描述

配置是否支持承载remap。

结构类型

bool

默认值

false

备注

-

LPC

模块说明

参数

说明

模块ID

0

模块名

LPC

模块描述

低功耗

模块类型

System

模块Key

NV_ID_LPC_DS_BASE_ATTR

Key ID

0x2003

Key状态

alive

Key描述

深睡保护配置。

结构类型

typedef struct {
    uint8_t ds_protect_switch;  // 深睡保护开关
    uint8_t ds_protect_length;  // 深睡保护时长
    uint8_t nds_after_boot;  // boot启动后的不进深睡时间
    uint8_t reserved;
} ds_basic_attr_config;

默认值

ds_protect_switch = 0;

ds_protect_length = 48;

nds_after_boot = 5;

备注

深睡保护默认关闭。nds_after_boot的最小值为8,低于8可以配置但是值不生效。(SPC105基线以后的版本,最小值为1。)

DEBUG

模块说明

参数

说明

模块ID

66

模块名

DEBUG

模块描述

调试模块

模块类型

System

SMS

NV_ID_SMS_NV_CONFIG

Key ID

0x8101

Key状态

alive

Key描述

SMS短信配置。

结构类型

#define SMS_NV_BCD_NUM_LEN 10
typedef struct {
    uint8_t           bcd_len;
    uint8_t           addr_type;
    uint8_t           bcd_num[SMS_NV_BCD_NUM_LEN];
} sms_store_bcd_addr;
typedef struct {
    sms_store_bcd_addr  sc_addr;
    uint8_t             cmgf;
    uint8_t             csdh;
    uint8_t             cpms;
    uint8_t             csmp_fo;
    uint8_t             csmp_pid;
    uint8_t             csmp_dcs;
    uint8_t             csmp_vp;
    uint8_t             reserve;
} sms_nv_config_para;

默认值

{0}

备注

默认不存在该NV项,当配置+CMPS/+CMGF/+CSMP/+CSDH/+CSCA的AT命令时,将会保存这些命令的配置值至此NV中。

TAF

NV_ID_TAF_NV_CONFIG

Key ID

0x7400

Key状态

alive

Key描述

taf功能配置。

结构类型

typedef struct {
    uint8_t fast_sleep_switch;
    uint8_t rsv[3];
    uint32_t fast_sleep_time;
    uint8_t trans_monitor_switch;
    uint8_t trans_monitor_time;
    uint8_t dhcp_flowctl_switch;
    uint8_t dhcp_flowctl_time;
    uint16_t dhcp_lease_time;
    uint8_t ppp_auth_type;
    uint8_t ppp_echo_max_lost_cnt;
    uint8_t net_discon_is_drop_ul_pkt;
    uint8_t ndis_conn_hold_switch;
    uint8_t ecm_netcard_dial_succ_switch;
    uint8_t flow_ctl_shr_mem_byte;
    uint8_t spi_dial_type;
    uint8_t resv[NUM_THREE_SIZE];
} taf_nv_config;

默认值

{0, 0, 0, 0, 0, 1, 5, 1, 1, 72, 1, 0, 1, 0, 1, 90, 0, 0, 0, 0}

备注

  • fast_sleep_switch:是否开启增强休眠功能,默认关闭。
  • fast_sleep_time:开启增强休眠功能后无数传时快速进入idle态时间,单位:ms,最小100ms,功能开启后默认5s,不建议设置时间小于1s,时间太短可能会导致数传失败。
  • trans_monitor_switch:是否开启数传防呆功能,默认开启。
  • trans_monitor_time:开启数传防呆后保护时间,单位:min,最小1min,最大30min,默认5min 。
  • dhcp_flowctl_switch:是否开启上行dhcp流控功能,默认开启。
  • dhcp_flowctl_time:开启上行dhcp流控后保护时间,单位:h,最小1h,最大24h,默认1h。
  • dhcp_lease_time:dhcp租期,单位:h,默认72h,最大8784h。
  • ppp_auth_type:ppp鉴权类型,默认PAP。

    0:不鉴权;

    1:pap;

    2:chap。

  • ppp_echo_max_lost_cnt:ppp最大丢失echo报文次数,默认0次。
  • net_discon_is_drop_ul_pkt:脱网状态下收到上行数据包后是否丢弃。

    0:不丢弃;

    1:丢弃。

  • ndis_conn_hold_switch:USB连接断开是否保持NDIS拨号连接状态开关,默认关闭。

    0:开关关闭,断开NDIS拨号连接;

    1:开关打开,保持NDIS拨号连接。

    其它值按开关关闭处理。

  • ecm_netcard_dial_succ_switch:ECM网卡connect状态通知消息发送失败,是否保持拨号开关。该开关用于控制Windows上位机ECM自动拨号场景下,是否释放默认承载,使得支持继续使用其他模式拨号。开关默认打开。

    0:开关关闭,connect状态通知消息发送失败时,ECM拨号失败,释放默认承载,支持继续使用其他模式拨号;

    1:开关打开,connect状态通知消息发送失败时,ECM拨号成功,不释放默认承载。

    其它值按开关打开处理。

  • flow_ctl_shr_mem_byte:TAF上行内存流控门限,最小90K,最大110K,默认90K,低速模式下不生效。
  • spi_dial_type:

    0:STICK模式

    1:E5模式

    2~255:E5模式

NV_ID_TAF_TCP_WS_CONFIG

Key ID

0x7402

Key状态

alive

Key描述

配置RNDIS拨号场景下,优化普通子帧场景(normal_sa_config)和特殊子帧(ssp_sa_config)场景下,不同的基站SA子帧配比时的TCP上行和下行的TCP数据的传输窗口。

该仅在RNDIS传输TCP类型数据下生效。

配置值范围为1~800,单位:KB。

结构类型

typedef struct {
    uint16_t taf_tdd_sa0_dl;
    uint16_t taf_tdd_sa0_ul;
    uint16_t taf_tdd_sa1_dl;
    uint16_t taf_tdd_sa1_ul;
    uint16_t taf_tdd_sa2_dl;
    uint16_t taf_tdd_sa2_ul;
    uint16_t taf_tdd_sa3_dl;
    uint16_t taf_tdd_sa3_ul;
    uint16_t taf_tdd_sa4_dl;
    uint16_t taf_tdd_sa4_ul;
    uint16_t taf_tdd_sa5_dl;
    uint16_t taf_tdd_sa5_ul;
    uint16_t taf_tdd_sa6_dl;
    uint16_t taf_tdd_sa6_ul;
} taf_tdd_ws_config;
typedef struct {
    uint16_t taf_fdd_dl;
    uint16_t taf_fdd_ul;
    uint16_t taf_fdd_scale_thd;
    uint16_t taf_tdd_scale_thd;
    taf_tdd_ws_config normal_sa_config;
    taf_tdd_ws_config ssp_sa_config;
} taf_nv_tcp_ws_config;

默认值

{0}

备注

当该NV不存在或配置项的值为0时,芯片会采用默认TCP传输窗口配置,此NV项非必配项。

此NV值为调试NV,仅支持在测试场景下修改,请在海思研发指导下使用。默认值请勿修改。

NV_ID_UE_APP_DATA_RETX_NUM

Key ID

0x7404

Key状态

alive

Key描述

应用层上行数据包重传次数。

结构类型

uint8_t

默认值

{1}

备注

默认值为1,可配范围1~5。打开该功能后,RRC释放会触发协议栈把数据包回滚到TAF,TAF进行重传处理,如果开启ROHC功能,则不会进行数据包的回滚和重传。

USB

NV_ID_USB_INIT_CONFIG

Key ID

0x3002

Key状态

alive

Key描述

USB功能配置。

结构类型

typedef struct {
    uint8_t remote_wakeup_type; /* 远程唤醒类型 */
    uint8_t ndis_dial_type;     /* NDIS拨号模式(STICK/E5) */
    uint8_t net_card_type;      /* 网卡类型 */
    uint8_t ppp_dial_type;     /* PPP拨号模式(STICK/E5) */
} usb_init_config;

默认值

{0, 0, 0, 0}

备注

  • remote_wakeup_type:

    0:支持远程唤醒。

  • ndis_dial_type:

    0:STICK模式

    1:E5模式

    2~255:E5模式

  • net_card_type:

    0:AT+LOG+RNDIS

    1:AT+LOG+ECM

    2:AT+LOG+PPP

    3:AT+PPP+RNDIS

    4:AT+PPP+ECM

    5~255:AT+LOG+RNDIS

  • ppp_dial_type:

    0:STICK模式;

    1:E5模式;

    2~255:E5模式。

NV修改后,复位生效。

LWIP

NV_ID_LWIP_CLEAR_SOCKET_CONFIG

Key ID

0x7403

Key状态

alive

Key描述

用于控制LWIP缓存数据是否清除,保留时间可配置,功能默认关闭。

结构类型

typedef struct {
    uint8_t support; /* 控制开关 */
    uint8_t rsv1;     /* 保留位无意义 */
    uint16_t timer_len;      /* 定时器时长 */
} lwip_socket_nv;

默认值

{0}

备注

  • support:

    0:关闭;

    1:打开,定时清除LWIP缓存数据。

  • timer_len:定时器时长,不配置默认是最小值1s,最大是3600s。

注意事项

  • 新增 NV 前应先定义 NV_ID、属性和结构类型;使用自定义结构类型时,还需在 nv_common.h 中补充定义,供 NV 模块和工具解析。
  • DebugKits 连接用户名固定为 user,SDK 不预置口令。口令长度为 8~32 个字符,且至少包含小写字母、大写字母、数字、特殊字符中的两类;盐值长度为 1~20。
  • 使用 DebugKits 修改 NV 值时,工具无法拦截非法参数。NVvalue 必须同时满足数据类型范围、枚举或布尔值约束以及结构定义中的额外范围要求。
  • NV 备份必须遵守备份与恢复 NV中列出的状态和次数要求;备份区以最近一次成功备份的数据为模板,量产后不应再使用备份功能。
  • 执行 AT&F0 会复位芯片、擦除当前 NV 区的所有数据,并从备份区恢复;永久 Key 也会被擦除。恢复操作只恢复与备份区重复的 NV,新增 NV 不会被删除。
  • g_blacklist_array 中的 NV_ID 不参与备份和恢复;正常工作区找不到该 NV 时,也不会从备份区读取。
  • 软件默认值能够满足需求时,建议保持预置值为空,避免重复填写默认值。

问题处理

DebugKits 使用什么用户名和口令连接?

连接用户名固定为 user,无需在界面中输入。SDK 不提供预置口令,需要使用密钥生成工具设置自定义口令和盐值,并将生成结果写入 secure_conn NV 后重新生成、烧写镜像。

如何判断 NV 备份已经完成?

应用核启动后,在规定的备份状态下发送 AT&W0。命令返回 OK 表示全量 NV 备份完成。该命令不应在短时间内反复执行,最大备份次数为255次;备份区始终以最近一次成功备份的数据为模板。

为什么执行恢复后 NV 数据为空?

备份区在出厂状态下为空。如果未先执行有效备份就发送 AT&F0,恢复结果可能为空。因此应在恢复前完成备份并确认命令返回 OK

为什么恢复后新增 NV 仍然存在?

恢复操作只恢复当前 NV 区与备份区中重复的 NV,不删除备份后新增的 NV。这是恢复机制的既定行为。

为什么修改 NV 后出现非预期行为?

NV 配置值可能超出数据类型、枚举、布尔值或结构注释规定的范围。DebugKits 不会拦截非法参数,应根据NV 功能与配置预定义 Key中的取值说明逐项检查配置。