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
亲爱的对话员工,
Could you please answer?
问候,
Wouter
Hi Wouter Vos,
对不起延迟回复,同事正在调查它,我们会尽快让你知道。
Thanks MT_dialog
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.
亲爱的对话框,
谢谢您的回答。I am aware of the items you pointed out in your reply. Unfortunately, it does not help me. With
CFG_INITILIALIZE_NVDS_STRUCT
defined该设备按照OTP正确按计划运行和靴子。但是,当我称之为这个设备A并且我刻录一个名为B的第二个设备CFG_INITILIALIZE_NVDS_STRUCT
undefined并使用OTP NVDS工具将NVDS内存从设备A复制到设备B的空NVDS内存,设备B未启动广告。设备B的程序计数器似乎在内存位置0x805b4时趋于四处,而设备A的程序计数器在0x20000000以上。At first I thought the advertisement data may be incorrect, because
user_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_NAME
empty 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_storage
innvds.c.
the sleep (NVDS_TAG_SLEEP_ENABLE
) is enabled and the external wakeup (nvds_tag_ext_wakeup_enable.
)禁用(它们是固定的)。那是什么影响CFG_EXTERNAL_WAKEUP
和cfg_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
Could you please answer?
Regards
你好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
你好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
亲爱的LC,
谢谢您的回答。我打算它的工作。(不幸的是,我在从NVDS内存中读取名称标记的代码中遇到了错误。)
Concerning A)
从代码中尚不清楚spi_div的值(无数据表提供)。你能告诉我吗?
Concerning B)
所以,如果我理解正确。必须在NVDS内存中启用NVDS_TAG_SLEEP_ENABLE和NVDS_TAG_EXT_WAKEUP_ENABLES,并且必须定义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
。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
你好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
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_sleepmodeSDK中提供的项目在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
你好LC,
我想我创建了一个混合版本;在蓝牙模块上,一个独立的应用程序正在运行,管理连接和SPI接口。SPI接口仅用于发送和接收接收的数据,或者需要在空中发送。这意味着我已经定义了cf_app
da1458x_config_basic.h
因此ble_app_present。It is unclear to me what needs to be defined and undefined.
问候,
Wouter
Hello Wouter,
如果我理解正确,您只有一个处理器系统。因此,在单个处理器系统中,您不必担心CFG_EXTERNAL_WAKEUP,NVDS_TAG_EXT_WAKEUP_ENABLE和EXT_WAKEUP_ENABLE()。这些仅用于外部处理器配置。
在您的单个处理器Configuratoin中,您必须在Config.h中启用睡眠模式类型(Deep_sleep或Extended_sleep)。为按钮进行按钮启用extrnal输入的相应GPIO,然后在检测按钮按下时设置回调函数。请参阅此支持门户网站上的项目BLE_APP_SLEEPMODE和用户手册文档UM-B-006。该项目设置了几个回拨功能,以检测按钮按下,并按下该按钮必须完成的内容。如果您在这方面有其他问题,请告诉我。
问候,
LC