Extended Sleep on custom PCB

⚠️
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.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
7 posts / 0 new
Last post
aparna.anand
Offline
Last seen:3年5个月前
加入:2017-04-21 11:01
Extended Sleep on custom PCB

Hi,

We have a custom PCB with DA14580 in Buck Mode Configuration with only XTAL16. Here BLE app is loaded via SPI when main microcontroller reset happens
and some sensor data to be transmitted via BLE is send over UART from main microcontroller. As I understand only extended sleep is possible in this with
#define CFG_LP_CLK LP_CLK_RCX20 and variable app_default_sleep_mode=ARCH_EXT_SLEEP_ON. From BLE android app, during scan, device is visible.
But on initiating connection, further connection is lost and device name is no longer listed.

Can you please provide some suggestions on this behavior?

Thanks,
Aparna

Device:
MT_dialog
Offline
Last seen:3个月6小时前
Staff
加入:2015-06-08 11:34
Hi aparna.anand,

Hi aparna.anand,

If you are able to see the device when it starts up, and upon connection it fails to connect and then its not visible any more i can assume that when connecting somewhere the code stalls, you should check via debugging where the code ends up after the connection happens and it causes the device to be unresponsive. In a normal case if a connection fails the device should start advertising again by invoking the start advertising procedure in the .app_on_connection callback (in the else condition if the connection failed) or at the app_on_disconnect callback, if this is not invoked then the device is not going to start the advertising once the connection attempt fails. But since there is no case of a successful connection, most probably something stalls the device upon the connection procedure.

Thanks MT_dialog

aparna.anand
Offline
Last seen:3年5个月前
加入:2017-04-21 11:01
Hi,

Hi,

Thanks for your suggestion. I will try debugging at what point the app is stuck.
Meanwhile can you please confirm that CFG_LP_CLK as LP_CLK_RCX20 for extended sleep mode entry on the run time is possible? This is because we don't have XTAL32 on our custom board.

I see that application runs fine when I disable extended sleep mode and is stuck only when I enable extended sleep.

Thanks,
Aparna

MT_dialog
Offline
Last seen:3个月6小时前
Staff
加入:2015-06-08 11:34
Hi aparna.anand,

Hi aparna.anand,

由于您的自定义板以Buck模式配置,因此您可以在RCX上运行,但是,我没有获取运行时任期,但是应该在DA1458x_config_Advanced.h文件中完成LP时钟的选择,并且CFG_LP_CLK应设置为LP_CLK_RCX20,如果您没有外部XTAL32这是您在编译期间应该拥有的配置。由于启动时,您的设备可见,这意味着它可以睡眠和宣传它应该,当您正在运行的FW中发生连接时,必须存在错误,也许读取创建故障的传感器。您可以使用一个简单的SDK示例进行检查并连接到它,以验证问题在于您的FW,而不是您的自定义板。

Thanks MT_dialog

aparna.anand
Offline
Last seen:3年5个月前
加入:2017-04-21 11:01
Hi,

Hi,

By runtime what I meant is enabling sleep mode in between the connection or the advertising intervals. As debug lines for DA14580 have not been brought out in the custom board, I am still figuring out how to debug this issue further.

The other thing I am trying out is enabling sleep mode(permanent) on DA upon a GPIO event by the main microcontroller(an input to DA driven high). A power reset would bring out both DA and main microcontroller out of reset. Can you please tell me if this would be possible?
I have seen examples of using wkupct_register_callback() and wkupct_enable_irq() APIs. But in my case I don't need to enable wakeup timers. I just need to service GPIO ISR and enable extended sleep.

Some suggestion on examples to look upon would be helpful.

Thanks,
Aparna

MT_dialog
Offline
Last seen:3个月6小时前
Staff
加入:2015-06-08 11:34
Hi aparna.anand,

Hi aparna.anand,

Enabling and disabling the sleep during execution of the code can be done via the arch_disable_sleep(), arch__set_extended_sleep() api. Also something that you ve might misunderstood, you dont have to enable and disable sleep during the connection intervals, if the device is by default in extended sleep mode (by using the ARCH_EXT_SLEEP_ON in the app_default_sleep_mode structure) the SDK will arrange the sleeping and awakening of the device during the advertising intervals and connection intervals without any need from the application to take any action, the disable sleep function in normally used when the application requires from the device to stay awake even if the there is no need for BLE activity (no upcomming connection event or advertising event).

关于从外部微控制器启用睡眠模式,您可以通过外部中断配置580以唤醒,您可以看一下BLE_APP_SLEEPMODE,在广告少量时间之后的设备下降到永久性睡眠(没有BLE事件)并通过外部按钮中断唤醒。此外,如果在PMU_CTRL_REG中配置RESET_ON_WAKEUP,则可以在下次唤醒时配置设备在下次唤醒中,如果这是您的要求。

关于醒来,如果您处于永久性睡眠模式(意味着没有编程的BLE事件,没有建立或广告所安排的连接),则设备可以通过内核计时器(其也被认为是BLE事件)或从唤醒时唤醒定时器(名称有点误导,实际上这是在发生预编程的GPIO事件的预编程数量的GPIO事件之后断电之后唤醒设备的模块),因此使用WKUPCT_Timer的示例是您应该使用的示例。

Thanks MT_dialog

aparna.anand
Offline
Last seen:3年5个月前
加入:2017-04-21 11:01
Thanks a bunch for clearing

Thanks a bunch for clearing the misunderstanding and pointing to examples!

Thanks & Regards,
Aparna