在生产过程中刻录OTP NVDS内存中的设备名称

14个帖子/ 0新
Last post
Wouter Vos.
Offline
Last seen:4年6个月前
加入:2016-02-18 15:45
在生产过程中刻录OTP NVDS内存中的设备名称

Dear reader,
根据外围示例代码,我为自己的BLE外设创建了自己的供应商定义了BLE配置文件。到目前为止,我一直成功地在从OTP内存运行的独立版本中运行固件。但是,目前我必须在固件中更改每个设备的设备名称并在生产过程中重建固件。我想在生产过程中刻录OTP NVDS内存(NVDS_TAG_DEVICE_NAME)中的设备名称。但是,我在这样做是不成功的;目前尚不清楚如何正确执行此操作,并且需要设置哪些值。你能帮助我吗?

So far I got the following:
我未定义:cfg_initialize_nvds_struct;cfg_development_debug.
I defined: CFG_BOOT_FROM_OTP
When I burn the binary to the OTP with a correct OTP header using SmartSnippets, the OTP NVDS memory block starting at 0x40340 remains empty. When I fill this area with an NVDS template hex file created from the OTP NVDS memory of another device that is running firmware written with code in which CFG_INITIALIZE_NVDS_STRUCT is still defined (and the NVDS stuct in nvds.c is used instead), then the device will not start advertising.

问候,
Wouter

设备:
Wouter Vos.
Offline
Last seen:4年6个月前
加入:2016-02-18 15:45
亲爱的对话员工,

亲爱的对话员工,
Could you please answer?
问候,
Wouter

MT_dialog
Offline
Last seen:2个月2周前
Staff
加入:2015-06-08 11:34
Hi Wouter Vos,

Hi Wouter Vos,

对不起延迟回复,同事正在调查它,我们会尽快通知您。

Thanks MT_dialog

lc_dialog
Offline
Last seen:2 weeks 4 days ago
Staff
加入:2016-09-19 23:20
Hello Wouter,

Hello Wouter,

I apologize for the delay. Please find our analysis of your question..

您不会能够在OTP中保存部分NVDS和代码中的另一个部分。当您在没有的情况下刻录OTP中的代码CFG_INITILIALIZE_NVDS_STRUCTdefined you leave the whole.

NVDS area in the OTP image empty for you to burn with the NVDS OTP tool. You will have to fill in that area later by using the OTP NVDS tab (the memory offset by0x340直到0x440)。那么你
will have to either burn the image with the NVDS data in your code or burn it afterwards with the OTP NVDS tool.

您提到的#defines是定义/ undefine的适当的内容,以便在刻录过程中从OTP引导。确保OTP标题中的应用标志均刻录为“是”,以便引导加载程序使OTP镜像发生(您可以通过检查引导加载程序是否正在通过打开UART端口来检查并检查RX TX引脚是否执行此操作切换)。

Please let us know if this helped you solve the problem or if you have any more questions..

问候,
lc_dialog

Wouter Vos.
Offline
Last seen:4年6个月前
加入:2016-02-18 15:45
亲爱的对话框,

亲爱的对话框,
谢谢您的回答。I am aware of the items you pointed out in your reply. Unfortunately, it does not help me. WithCFG_INITILIALIZE_NVDS_STRUCTdefined该设备按照OTP正确运行并正确靴子。但是,当我称之为这个设备A并且我刻录一个名为B的第二个设备CFG_INITILIALIZE_NVDS_STRUCTundefined并使用OTP NVDS工具将NVDS内存从设备A复制到设备B的空NVDS内存,设备B未启动广告。设备B的程序计数器似乎在内存位置0x805b4时进入,而设备A的程序计数器在0x20000000以上。
At first I thought the advertisement data may be incorrect, becauseuser_advertise_data.is defined as an empty string inuser_config.h.。但在sifting through the code I noticed that it is appended with thenvds_tag_device_name.in the functionapp_easy_gap_undirected_advertise_start_create_msg(app.c) ifuser_config.is defined inuser_config.h.- which is the case in my code.
现在我开始怀疑是否有可能保留CFG_INITILIALIZE_NVDS_STRUCT定义,但离开USER_DEVICE_NAMEempty inuser_config.h.和burn thenvds_tag_device_name.和its length manually in the OTP memory (since it is an OR memory and zeros can be changed to ones, but not the other way around).

I have some additional questions that are not directly related to the above:
我们将设备作为SPI从站运行,并将数据发送到主机MCU。基于中断的通信已经实现和功能。但是,目前我们必须将SPI主SPI时钟设置为1 MHz,并在字节之间添加延迟,以确保正确转移。
a)SPI模块的时钟速度是多少?时钟分频器寄存器似乎设置为零,但我不知道这代表了哪些时钟速度。
b)在结构中nvds_data_storageinnvds.c.the sleep (NVDS_TAG_SLEEP_ENABLE) is enabled and the external wakeup (nvds_tag_ext_wakeup_enable.)禁用(它们是固定的)。那是什么影响CFG_EXTERNAL_WAKEUPcfg_mem_map_deep_sleep.on the sleep and wakeup behaviour of the device? I would like the device to wake up when SPI communication occurs. Currently I have the sleep defines undefined. Does this mean that the device does not go to sleep?

问候,
Wouter

Wouter Vos.
Offline
Last seen:4年6个月前
加入:2016-02-18 15:45
Could you please answer?

Could you please answer?
Regards

lc_dialog
Offline
Last seen:2 weeks 4 days ago
Staff
加入:2016-09-19 23:20
你好wouter vos,

你好wouter vos,

I am working on you query to get a solution. I will reply you with the solution ASAP.

Thank you! for your patience.

问候,

LC

lc_dialog
Offline
Last seen:2 weeks 4 days ago
Staff
加入:2016-09-19 23:20
你好wouter vos,

你好wouter vos,

First, you can use the NVDS data from device A and write it to device B assuming that the device B is configured for NVDS tool programmable (undefCFG_INITIALIZE_NVDS_STRUCT)。And, you will be able to write to NVDS using tool when theCFG_INITIALIZE_NVDS_STRUCTis defined, filling up the available 0s. This, we haven't tried and wouldn't suggest doing it as you may windup having random defined data in the NVDS memory.

A) The default clock speed in Master mode is set to 2MHz. In order to modify the clock speed you need to change the values for SPI_DIV in CLK_PER_REG (which controls the peripheral clock) and SPI_XTAL_Freq_t in spi_init() function (this controls the frequency of SPI block clock).

b)基于选择类型,将管理重复存储器开/关。如果睡眠定义未定义,则设备将始终处于活动模式。为了使用SPI,您可以设置外部_WakeUp模式,每当您接收外部中断时都可以唤醒系统。

Hope this anweres your questions...

问候,

LC

Wouter Vos.
Offline
Last seen:4年6个月前
加入:2016-02-18 15:45
亲爱的LC,

亲爱的LC,
谢谢您的回答。我把它搞定了。(不幸的是,我在从NVDS内存中读取名称标记的代码中发出了错误。)

Concerning A)
从代码中不清楚SPI_DIV的值(无数据表可用)。你能告诉我吗?

Concerning B)
所以,如果我理解它。必须在NVDS内存中启用NVDS_TAG_SLEEP_ENABLE和NVDS_TAG_EXT_WAKEUP_ENABLE,CFG_MEM_MAP_EXT_SLEEP和CFG_EXTERNAL_WAKEUP必须定义,必须在唤醒引脚中定义user_peripheral_setup.h.
如果在CFG_APP中定义了外部唤醒工作da1458x_config_basic.h? Because CFG_APP defines BLE_APP_PRESENT and thereforeExternal_wakeup_enable()不会被执行arch_main.c

lc_dialog
Offline
Last seen:2 weeks 4 days ago
Staff
加入:2016-09-19 23:20
Hello Wouter,

Hello Wouter,

我很高兴听到你能够让它工作......

a)SPI_DIV是CLK_PER_REG寄存器的零件(位8,9),其将时钟控制到系统内的不同外围设备。这将通过为其提供的值划分XTAL时钟。并且您可以提供4个不同的值来将时钟划分为1/2 / 4/8次。这是在14580的数据表中引用(在我的情况下第29页),您可以在支持网站中下载。

B) Regarding this, I would like to know,

您是否在14580 M0上使用任何外部处理器系统或主机应用程序?自从你提到从SPI通信中唤醒时,那是什么?你能讨论这个用例吗?

问候,

LC

Wouter Vos.
Offline
Last seen:4年6个月前
加入:2016-02-18 15:45
你好LC,

你好LC,
B) The DA14580 acts as a transceiver that exchanges data packets between a local MCU connected through SPI and a remote, Bluetooth enabled platform. So the DA14580 is idling until either the local MCU or the remote platform needs to send data.

问候,
Wouter

lc_dialog
Offline
Last seen:2 weeks 4 days ago
Staff
加入:2016-09-19 23:20
Hello Wouter,

Hello Wouter,

If I understood that correctly, you are using an external MCU configuration? Is the App on MCU and you are connecting to the external MCU over GTL interface?

And, I would also recommend you to look at theble_app_all_in_one或者ble_app_sleepmode在SDK中提供的项目,因为它们展示使用外部唤醒使用SleepMode唤醒,这将为您提供从OTP可选的选项,否则必须强制启用deep_sleep_mode.

And, I wouldn't recommend working out of thearch_main文件。一般来说,你应该是albe启用deep_sleep_mode.通过配置user_config.h.file and running the app off the OTP memory by setting the required flags. This simple setup should get you to using thedeep_sleep_mode.

问候,

LC

Wouter Vos.
Offline
Last seen:4年6个月前
加入:2016-02-18 15:45
你好LC,

你好LC,
我想我创建了一个混合版本;在蓝牙模块上,运行独立应用程序,管理连接和SPI接口。SPI界面仅用于发送和接收接收的数据,或者需要通过空气发送。这意味着我已经定义了cf_appda1458x_config_basic.h因此ble_app_present。
It is unclear to me what needs to be defined and undefined.

问候,
Wouter

lc_dialog
Offline
Last seen:2 weeks 4 days ago
Staff
加入:2016-09-19 23:20
Hello Wouter,

Hello Wouter,

如果我理解正确,您只有一个处理器系统。因此,在单个处理器系统中,您不必担心CFG_EXTERNAL_WAKEUP,NVDS_TAG_EXT_WAKEUP_ENABLE和EXT_WAKEUP_ENABLE()。这些仅适用于外部处理器配置。

在您的单个处理器Configuratoin中,您必须在Config.h中启用睡眠模式类型(Deep_sleep或Extended_sleep)。启用各自的GPIO用于按钮按下按钮,并在检测按钮时设置回调函数。请参阅此支持门户网站上的项目BLE_APP_SLEEPMODE和用户手册文档UM-B-006。该项目设置了几个回拨功能,以便按下按钮,按下该按钮必须完成的内容。如果您在这方面有其他问题,请告诉我。

问候,

LC