Hello Support Team,
I am currently working with the Murata type ZY module using a DA14580 with SDK 5.0.3. I am working with the barebones example project supplied with the SDK and would like to configure my application to Boot into extended sleep until an interrupt is received from the GPIO (no broadcasting). Once the interrupt is received I would like to have the application start as it normally would, advertising updated manufacturer supplied data. I'm a bit confused on how to implement this in the context of the user space. Any suggestions on where to start or how to approach this would be appreciated. Thanks.
Device:
Hi Dave,
您可以在App_Button_Press()函数上查看智能标记参考设计,以便在睡眠模式时唤醒设备,然后启动广告。同样在相同的参考设计中,您可以在函数结束时看一下App_adv_timer_Handler来检查如何将设备放在永久睡眠中。它可能在不同的SDK上,但API在新SDK上并不不同。请检查文档UM-B-050和UM-B-51。
谢谢mt_dialog.
我一直通过一些代码,并有几个问题,并希望澄清一些概念。
1) working off of the barebones example provided with SDK 5, when I edit user_config.h : app_default_sleep_mode=ARCH_EXT_SLEEP_ON; the chip goes into extended sleep mode when not advertising. In the main loop the processor waits for an interrupt to wake up, is this correct? Where is this interrupt coming from that allows it wake up and advertise again?
2)如果我禁用广告将processor remain in sleep until I generate an interrupt ?
3) Referring to page 45, Figure 26 of UM-B-050, Where in the code flow should I be targeting given what I am trying to do (extended sleep until push button interrupt).
Thanks
Hi Dave,
1- Yes in the main loop the da waits for an interrupt in order to wake up, the interrupts are pre-scheduled BLE events, please advice document UM-B-006 for more details about the sleeping mechanism.
2- If you disable advertising and the da doesn't have to do anything (no BLE interrupts are generated) it will remain in sleep mode, eventually will wake up (by default the da wakes up after a short period of time 10s) and it will fall asleep, if you want to avoid the brief waking up you can issue the app_ble_ext_wakeup_on in order to wake up only by an external interrupt.
3- You can try when your database creation has been completed instead of advertising to set your device in permanent sleep but first you have to configure your wake up button and interrupt.
Thansk MT_dialog
Thank you for the suggestions, if I use the original functionality of the bare bones example project I am now able to put the device to sleep (during the db creation as suggested) and then wake it up with a push button. My goal is to have the function mnf_data_update() read a sensor over the i2c bus. I have had this working previously and it still works when not forcing sleep. However when I try to combine the sleep/wakeup functionality with the i2c sensor reading in mnf_data_update() it stops working.
When the app starts i turn on an led when it goes to sleep. The callback function then turns off the led and restarts advertising, this all works with mnf_data_update() in its original form. When I use my i2c code (using i2c api calls), when I press the button to wake up the da the led stays on, no i2c transactions occur (monitored with scope) and Avg Current shoots up to 0.56 mA (monitored with smart snippets). The peak current is around 1.022 mA, so I don't think it's ever trying to advertise. Is there something I've missed that could be causing this behavior? Thanks.
Hi Dave,
可能存在I2C代码或传感器的问题。您是否可以通过通用应用程序看到您的设备广告,如果不是我认为您的设备已卡在I2C事务中。从睡眠中醒来时,您是否重新配置了I2C和您的外围设备?
谢谢mt_dialog.
我必须检查以确保我重新配置I2C和外围设备。使用BLE扫描仪(Android应用程序)扫描时,我没有看到设备的任何广告。此外,我正在监视具有范围的I2C行,并且事务永远不会开始。我将一个GPIO引脚与我的按钮回调功能设置,但LED永远不会让我相信执行永远不会进入该功能。我会在查看代码后报告。再次感谢您的帮助。
That didn't take long... I added a call to my peripheral initialization function to the pushbutton callback function and now it works as expected. Again thank you for the help, it is greatly appreciated.
嗨,支持团队,
Please let me ask the question about EXT_SLEEP mode every certain time. I need wake up it internally. I already read UM-B-006,but I'm a bit confused on how and where to write code .
In SDK5 code, which example is about it.
Please help me!
Hi wuxin_1019,
Please check your other post.
http://support.dialog-semiconductor.com/extsleep-mode-every-certain-time
谢谢mt_dialog.