亲爱的读者,
I have created my own vendor defined BLE profile for my own BLE peripheral, based on the peripheral example code. So far I have been successful in running the firmware in a standalone version running from OTP memory. However, for now I have to change the device name in the firmware for each device and rebuild the firmware during production. I would like to burn the device name in the OTP NVDS memory (NVDS_TAG_DEVICE_NAME) during production. However, I have been unsuccessful in doing so; it is unclear how to do this properly and which values need to be set. Could you help me out?
到目前为止,我得到了以下内容:
I undefined: CFG_INITIALIZE_NVDS_STRUCT; CFG_DEVELOPMENT_DEBUG
我定义:cfg_boot_from_otp
使用SmartSnippet将二进制文件刻录到OTP,使用SmartSnippet,OTP NVDS内存块从0x40340开始仍然为空。当我用从另一个设备的OTP NVDS存储器创建的NVDS模板内存文件填充此区域时,该区域是运行用与仍然定义CFG_INITIALIZE_NVDS_STURE的代码编写的固件(并且代替NVDS.C中的NVDS调用),那么设备不会开始广告。
问候,
韦特
Dear Dialog employee,
你能回答吗?
问候,
韦特
嗨wouter vos,
Sorry for the delayed response, a colleague is looking into it, we will let you know asap.
谢谢mt_dialog.
你好wouter,
我为延迟道歉。请找到对您的问题的分析..
You wont be able to keep part of the NVDS in the OTP and another part in your code. When you burn the code in the OTP without thecfg_initilialize_nvds_struct.定义了你留下整个。
OTP图像中的NVDS区域为空,为您使用NVDS OTP工具刻录。您必须使用OTP NVDS选项卡(内存偏移)稍后填写该区域0x340直到0x440)。So you
将使用代码中的NVDS数据刻录图像,或者在OTP NVDS工具之后将其燃烧。
The #defines that you mention are the proper ones to define/undefine in order to boot from OTP during the burning process. Make sure that application flags in the OTP Header are both burned to yes in order for the bootloader to make the OTP mirror happen (you can check this by checking if the bootloader is executing just by opening a UART port and check if the RX TX pins are toggled).
如果这有助于您解决问题,请告诉我们,或者您还有更多问题..
问候,
LC._Dialog
Dear Dialog,
谢谢您的回答。我知道你在回复中指出的物品。不幸的是,它没有帮助我。和
cfg_initilialize_nvds_struct.
定义the device runs as intended and boots correctly from OTP. However, when I call this device A and I burn a second device called B withcfg_initilialize_nvds_struct.
不明确的and copy the NVDS memory from device A to the empty NVDS memory of device B using the OTP NVDS tool, device B does not start advertising. The program counter of device B seems to be going around at memory location 0x805B4, while the program counter of device A is somewhere above 0x20000000.起初我认为广告数据可能不正确,因为
user_advertise_data.
被定义为空字符串user_config.h
。但是在通过代码筛选后,我注意到它被附加了nvds._TAG_DEVICE_NAME
在功能中app_easy_gap_undirected_advertise_start_create_msg.
(app.c.
) 如果USER_CONFIG
是定义的user_config.h
- 在我的代码中是这种情况。现在我开始怀疑是否有可能保留
cfg_initilialize_nvds_struct.
定义, but leaveuser_device_name.
空in.user_config.h
烧了nvds._TAG_DEVICE_NAME
它手动在OTP内存中的长度(因为它是一个或存储器,并且可以将零更改为Zero,但不是另外的方式)。我还有一些额外的问题与上述情况无直接相关:
We have the device running as an SPI slave and send data to an from a host MCU. The interrupt based communication is already implemented and functional. However, currently we have to set the SPI master SPI clock below 1 MHz and add delays between the bytes to ensure correct transfers.
A) What is the clock speed of the SPI module? The clock divider register seems to be set to zero, but I do not know what clock speed this represents.
B) In the struct
nvds_data_storage
在nvds.c.
睡觉 (nvds_tag_sleep_enable.
)已启用并外部唤醒(nvds._TAG_EXT_WAKEUP_ENABLE
)禁用(它们是固定的)。那是什么影响cfg_external_wakeup.
andCFG_MEM_MAP_DEEP_SLEEP
在设备的睡眠和唤醒行为上?当SPI通信发生时,我希望设备醒来。目前我有睡眠定义未定义。这是否意味着设备不会睡觉?问候,
韦特
你能回答吗?
问候
Hello Wouter Vos,
我正在努力查询来获得解决方案。我会尽快回复解决方案。
谢谢!为了你的耐心。
问候,
LC.
Hello Wouter Vos,
首先,您可以使用设备A中的NVDS数据并将其写入设备B,假设设备B配置为NVDS工具可编程(UNDEFcfg_initialize_nvds_struct.)。而且,您将能够使用工具写入NVDS时cfg_initialize_nvds_struct.已定义,填满可用0s。如此,我们没有尝试过,并不建议在您可以在NVDS内存中有随机定义的数据进行打磨。
a)主模式下的默认时钟速度设置为2MHz。为了修改时钟速度,您需要更改CLK_PER_REG(控制外围时钟)和SPI_INIT()函数中的SPI_XTAL_FREQ_T的SPI_DIV的值(这控制SPI块时钟的频率)。
b)基于选择类型,将管理重复存储器开/关。如果睡眠定义未定义,则设备将始终处于活动模式。为了使用SPI,您可以设置外部_WakeUp模式,每当您接收外部中断时都可以唤醒系统。
希望这是你的问题......
问候,
LC.
Dear LC,
谢谢您的回答。I got it working as I intended it to. (Unfortunately, I had made an error in the code that reads the name tag from the NVDS memory.)
关于a)
It is unclear from the code what the values for SPI_DIV mean (no datasheet available). Could you please tell me?
关于b)
So if I understand it correctly. Both NVDS_TAG_SLEEP_ENABLE and NVDS_TAG_EXT_WAKEUP_ENABLE have to be enabled in the NVDS memory AND both CFG_MEM_MAP_EXT_SLEEP and CFG_EXTERNAL_WAKEUP have to be defined AND the wake up pins have to be defined in
user_peripheral_setup.h
。Will external wake up work if CFG_APP is defined in
da1458x_config_basic.h.
?因为cfg_app定义了ble_app_present,因此external_wakeup_enable()
will not be executed inArch_main.c.
。你好wouter,
我很高兴听到你能够让它工作......
A) The SPI_DIV is a part (Bits 8,9) of the CLK_PER_REG register which controls the clock to different peripherals within the system. This will divide the XTAL clock by the value that you provide to it. And you can provide 4 different values to divide the clock by 1/ 2/ 4/ 8 times. This is referenced in the Datasheet of 14580 (page 29 in my case) which you can download in the support website.
b)关于这个,我想知道,
您是否在14580 M0上使用任何外部处理器系统或主机应用程序?自从你提到从SPI通信中唤醒时,那是什么?你能讨论这个用例吗?
问候,
LC.
Hello LC,
b)DA14580充当收发器,可通过SPI连接的本地MCU之间交换数据包和遥控器启用平台。因此DA14580是空闲直到本地MCU或远程平台需要发送数据。
问候,
韦特
你好wouter,
如果我理解正确,您正在使用外部MCU配置?是MCU上的应用程序,您将通过GTL接口连接到外部MCU吗?
而且,我也建议你看看ble_app_all_in_one.orble_app_sleepmode.projects provided in the SDK as they showcase the use of sleepmode wakeup using external wakeup and this would give you an option to run from OTP optional which is otherwise mandatory to enable thedeep_sleep_mode。
而且,我不会建议在工作中arch_mainfile. In general you should be albe to enable thedeep_sleep_modeby configuring in theuser_config.h文件并通过设置所需的标志来关闭OTP内存的文件。这个简单的设置应该让您使用deep_sleep_mode。
问候,
LC.
Hello LC,
我想我创建了一个混合版本;在蓝牙模块上,运行独立应用程序,管理连接和SPI接口。SPI界面仅用于发送和接收接收的数据,或者需要通过空气发送。这意味着我已经定义了cf_app
da1458x_config_basic.h.
and therefore BLE_APP_PRESENT.我不清楚我需要定义和未定义。
问候,
韦特
你好wouter,
如果我理解正确,您只有一个处理器系统。因此,在单个处理器系统中,您不必担心CFG_EXTERNAL_WAKEUP,NVDS_TAG_EXT_WAKEUP_ENABLE和EXT_WAKEUP_ENABLE()。这些仅适用于外部处理器配置。
在单处理器configuratoin, to enable the type of sleep mode in config.h (either deep_sleep or extended_sleep). Enable the respective gpio for exterrnal input for a button press and set a callback function upon detecting the button press. Please refer to the project ble_app_sleepmode and the user manual document UM-B-006 available on this support portal. The project set up a few call back functions in order to detect the button press and what has to be done when that button is pressed. Please let me know if you have further questions in this regard.
问候,
LC.