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按钮upress()函数上查看智能标签参考设计,以便在睡眠模式下唤醒设备,然后开始广告。同样的参考设计中,您还可以查看函数末尾的app adv_utimer_u处理程序,以检查如何将设备永久休眠。它可能在不同的SDK上,但在新SDK上api并没有那么大的不同。请查阅UM-B-050和UM-B-51文件。
谢谢你的对话
我已经运行了一些代码,并有几个问题,并想澄清一些概念。
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和外围设备吗?
谢谢你的对话
我必须检查以确保我正在配置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
谢谢你的对话