⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
17 posts / 0 new
Last post
GAK
离线
Last seen:1 year 7 months ago
Joined:2018-10-01 11:18
睡眠模式集成

大家好,

I am already using the ble_app_peripheral example in SDK 5.0.2.1 for UART data transfer.
I need to add sleep mode feature in ble_app_peripheral example.
要求是,
existing code should be go to sleep mode ,while i am sending GPIO interrupt from external MCU(through any gpio pin ).
(by default sleep should be off and its should be send/receive data , and External MCU will be set /ON the sleep mode at run time )
And also i want to disable/wakeup the sleep mode using same gpio pin like toggling .

Kindly share you view on this ASPS.

谢谢,

设备:
GAK
离线
Last seen:1 year 7 months ago
Joined:2018-10-01 11:18
大家好,

大家好,

Kindly share you view on this ASPS.

谢谢,

IBA_DIALOG.
离线
Last seen:4 weeks 13 hours ago
Staff
Joined:2018-01-02 14:45
嗨gak,

嗨gak,

Thanks for your interesst on the DA14580,

The lateste up to date SDK version supporting the DA14580 is the 5.0.4 release, you can refer to it.

We already provide an applicationble_app_sleepmode.showing how to use the
sleep mode API and change in runtime the sleep mode. For the DA14580 two sleep mode are available:
●扩展睡眠模式
● Deep sleep mode

In the example the user can wake up the device by pressing a button. After the button press the device will start to advertise again for the predefined time and then go for sleep.

You can use/add these APIs for you peripheral example.

Please let us know if you have more questions.

问候

IBA_DIALOG.

GAK
离线
Last seen:1 year 7 months ago
Joined:2018-10-01 11:18
大家好,

大家好,

Thanks for your support,

As per your suggestion , I was followed the wake up using from pressing button .(if button is pressed ,wake-up callback is called only one time)
Its working fine by using wake-up interrupt handler( wkupct_register_callback(app_button_press_cb)) and (wkupct_enable_irq()).

I want to use some GPIO pin(port1_pin3) for wake up instead of button.
For this i am Reserved , configure the GPIO pins & register my callback (wkupct_register_callback(app_button_press_cb)) and enable the gpio pins and set the polarity(high) to the appropriate pin (wkupct_enable_irq()).

The input of the GPIO is high and after some time its going to Low.(like as button press)
这个时候打来叫醒来,醒来up is working fine.

但总是醒来回电话叫甚至the GPIO is going to Low ,(GPIO status is checked with multi meter - the voltage leave is 0.0volt only ).
Here the programmed like " wkupct_enable_irq(WKUPCT_PIN_SELECT(GPIO_PORT_1, GPIO_PIN_3), // select pin (GPIO_BUTTON_PORT, GPIO_BUTTON_PIN)
wkupct_pin_polarity(gpio_port_1,gpio_pin_3,wkupct_pin_polarity_high),//极性低
1, // 1 event
10);" which is i am used.
My expectation is,The GPIO Pin is going to Low , wakeup call back is should not called.
Its should called only the GPIO pin is in High stat.

Also i want to know how this wake up function perfectly works for button press?
One press = one time wake up call back called.
And there is no wkupct_disable_irq() callback used in SDK.

explain this also.

Kindly proved your support for this ASAP.

谢谢,

PM_Dialog
离线
Last seen:8 hours 26 min ago
Staff
Joined:2018-02-08 11:03
嗨gak,

嗨gak,

Glad that are able to wake your device up via a button pressing and following the instructions of IBA_Dialaog. However, I need a few clarifications for what you are trying to implement. Apologies, but I am not able to completely understand what you are trying to accomplish, so let me ask you some question to make the thing clear.

  • “要求是,现有代码应该转到睡眠模式,而我从外部MCU发送GPIO中断(通过任何GPIO引脚)。

(by default sleep should be off and its should be send/receive data , and External MCU will be set /ON the sleep mode at run time )
And also i want to disable/wakeup the sleep mode using same gpio pin like toggling . “

如果我理解正确,那么设备将最初处于活动模式,它应该能够通过UART发送或接收数据。你想用gpio中断实施什么?您希望在扩展睡眠模式下收到中断并设置您的设备吗?如何如何将睡眠模式配置从活动模式更改为扩展睡眠模式?GPIO中断由外部MCU驱动?请注意,由于设备进入扩展休眠模式,因此所有外设块都会关闭,因此您将无法进行UART活动。

In order to get more information about the ble_app_sleepmode example of the SDK, I would highly suggest you to read the 8.50 Pillar 5 (Sleep Mode) of the
UM-B-050 : DA1458x Software Developers Guide (SDK5). You can find it from the DA14580 tab of our support page. The main purpose of this application example is to show how to use the sleep mode API and change in runtime the sleep mode.

谢谢,PM_Dialog

GAK
离线
Last seen:1 year 7 months ago
Joined:2018-10-01 11:18
大家好,

大家好,

是的,you are correct,
Please find the following info for your clarifications,

1)The device will be initially in active mode and it should be able to send or receive data through UART.
2)If GPIO interrupt is driven by an external MCU , the device should be go to extended sleep mode.
3)Wake up also controlled by an external MCU and another GPIO interrupt is driven by an external MCU for wake up.
4)After wake up i should able to restore the BLE device state for continue the data transfer .

find the inline Answer ,
您想在扩展睡眠模式下收到中断并设置您的设备吗?<<<是的,
When it receive an interrupt from external MCU ,it should set device to extended sleep mode.
如何如何将睡眠模式配置从活动模式更改为扩展睡眠模式?<<<
step 1)Device in Active mode( either one of this mode Adverting /connecting(BLE device can able to transfer data over Air) )
步骤2)扩展睡眠模式(通过外部MCU驱动的GPIO中断)
Step 3)Device wake up from sleep mode(through GPIO interrupt by External MCU )
step 4)After wake up Device should ready to transfer data

GPIO中断由外部MCU驱动?是的,

请注意,由于设备进入扩展睡眠模式,因此所有外围设备块都将关闭,因此您将无法进行UART活动。<<是的,在睡眠模式下无需通过UART发送任何数据。但是,当从睡眠中醒来时,它应该恢复像广告/数据传输的旧状态。

Kindly provide you support ASAP.

谢谢,

PM_Dialog
离线
Last seen:8 hours 26 min ago
Staff
Joined:2018-02-08 11:03
嗨gak,

嗨gak,

Can you please check the following post in order?
https://support.dialog-semicondiondiondiondum/forums/post/dialog-smartbond-bl....

This post might help you in order to catch the interrupt generated by the external MCU and the you should call the app_easy_gap_advertise_stop function. Also, you can check the CodeLess reference application code. Using this application, you can send AT commands over UART into the DA14580, so you can configure your device in extended sleep mode by sending the appropriate AT command

https://support.dialog-semiconductor.com/connectivity/product/da14580?qt...

谢谢,PM_Dialog

GAK
离线
Last seen:1 year 7 months ago
Joined:2018-10-01 11:18
大家好,

大家好,

Already ,I am using the "wake-up timer"block for wake up the DA14580 and wake up timer is working fine with switch SW3(P1_1) and SW2 (P0_6).
As mentioned above post "https://support.dialog-semicondiondiondiondum/forums/post/dialog-smartbond-bl....", is not give an exact solution for me.

I want to use GPIO P1_3 for wake up the DA14580 by using wkupct_irq.
Code change is,
#define gpio_button_port gpio_port_0.
#define gpio_button_pin gpio_pin_1.
(I am giving the signal to (GPIO) P1_3 of DA14580 from external MCU (low to high))
实际问题是,
Once the P0_1pin status is changed from low to high, wkupct_callback is called every 3sec once.
Its called one time only if i am using sw3/sw2(ie, wkupct_irq is called once for single press of SW3/SW2)
My Observation is ,after change the SW2/SW3 to GPIO P1_3 , wkupct irq is called every 3sec even-tho GPIO P1_3 is going to high.

but it should not called every 3sec and its works like a SW2/SW3 press.

Kindly provide your support for this ASAP

联系:
J5 - 5th pin in DA14580
wire jumper is used for connecting the External MCU GPIO pin to DA14580 GPIO P1_3.

谢谢,

PM_Dialog
离线
Last seen:8 hours 26 min ago
Staff
Joined:2018-02-08 11:03
嗨gak,

嗨gak,

如果我理解正确,则要从PIN1_3唤醒设备,并从SW3和SW2中删除唤醒功能。那是对的吗?您是否在user_periph_setup中配置了PIN1_3?对不起,但我有点混淆你的描述,你能解释一下你想要完成的事情吗?你想从哪个gpio醒来?PIN0.1做了什么?请您可以上传配置和PIN1_3的唤醒过程吗?

谢谢,PM_Dialog

GAK
离线
Last seen:1 year 7 months ago
Joined:2018-10-01 11:18
大家好,

大家好,

如果我理解正确,则要从PIN1_3唤醒设备,并从SW3和SW2中删除唤醒功能。<<< Yes its correct.

你想从哪个gpio醒来?<<<< GPIO P1_3 is using.

PIN0.1做了什么?<< sorry ,wrongly used.GPIO P1_3 is used.
请找到上传的文件fyi。

谢谢,

Attachment:
PM_Dialog
离线
Last seen:8 hours 26 min ago
Staff
Joined:2018-02-08 11:03
嗨gak,

嗨gak,

根据您的描述,P1_3处于活动高电平,外部MCU触发从低电平到高,这是正确的?如果是,则应更改极性,因为在附加的代码片段中,您使用wkupct_pin_polarity_low极性。按钮配置为INPUTE_PULLUP,因此当GPIO变为低电平时触发唤醒控制器,这就是为什么衬套按钮的极性低。在你的情况下,你应该做到相反的。此外,您应该将p1_3配置为input_pulldown并使用wkupct_pin_polarity_high。请找到附加的p1_3唤醒程序的示例。

谢谢,PM_DIalog

Attachment:
GAK
离线
Last seen:1 year 7 months ago
Joined:2018-10-01 11:18
大家好,

大家好,

感谢您的支持,

我在项目中使用了上面提到的配置。
Please find the inline of bellow for your clarification,
P1_3 is active high and the external MCU is triggering from low to high, that’s correct?<<< yes .

实际的是,当外部MCU从低到高电平触发时,“app_button_press_cb()”呼叫呼叫仅呼叫一次。

But In my case, wake-up controller "app_button_press_cb ( )" call back is triggered more then one time(external MCU is changed the GPIO P1_3 from High to Low ).

请为此提供支持。

谢谢,

PM_Dialog
离线
Last seen:8 hours 26 min ago
Staff
Joined:2018-02-08 11:03
嗨gak,

嗨gak,

你是什​​么意思唤醒控制器正在触发多次?如果它被触发多次,这意味着您将稍微获得中断。您是否可以检查P1_3是否从外部MCU多次触发?

谢谢,PM_Dialog

GAK
离线
Last seen:1 year 7 months ago
Joined:2018-10-01 11:18
大家好,

大家好,

是的,一个中断触发了一次。

请找到圆线,
您是否可以检查P1_3是否从外部MCU多次触发?>>我通过CRO在外部MCU侧通过CRO检查了P1_3状态,并且其未多次触发。
Also I am checking a same pin in DA145080 Pro kit through CRO and this pin status also changed according to External MCU.

谢谢,

PM_Dialog
离线
Last seen:8 hours 26 min ago
Staff
Joined:2018-02-08 11:03
嗨gak,

嗨gak,

The app_button_press_cb() when you get a active low interrupt into the wake-up controller. this means that the app_button_press_cb() will be executed only when the device is in permanent sleep and you get a wake-up interrupt. If the device is still advertising, this callback will not be triggered. So, your device gets into the permanent sleep mode, you send an interrupt to wake your device up, then it is advertising and the callback is still executed? I am trying to understand which your problem is.

谢谢,PM_Dialog

GAK
离线
Last seen:1 year 7 months ago
Joined:2018-10-01 11:18
大家好,

大家好,

...you send an interrupt to wake your device up, then it is advertising and the callback is still executed? Yes, Its correct, Wake up callback is executed even the devise in advertising .

谢谢,

PM_Dialog
离线
Last seen:8 hours 26 min ago
Staff
Joined:2018-02-08 11:03
嗨gak,

嗨gak,

我想让你知道这有点奇怪的情况。请检查默认BLE_APP_SLEEPMODE示例,您将看到APP_BUTTON_ENABLE()仅调用为void user_app_add_undirect_complete()函数,因此才会在设备进入永久睡眠模式时触发APP_BUTTON_PRESS_CB()打断。在您的情况下,我并不完全确定您的固件是什么。在我的情况下,我无法复制这个问题。如果app_button_press_cb()是多次执行的,这意味着您就会超过唤醒控制器将中断发送到唤醒控制器。您是否尝试过连接到唤醒控制器的GPIO?

谢谢,PM_Dialog