Hi Team,
我已经在SDK 5.0.2.1中使用了BLE_APP_PERITIVELAL示例for UART数据传输。
我需要在BLE_APP_PERITIVELAL示例中添加睡眠模式功能。
Requirement is ,
现有代码应转到睡眠模式,而我从外部MCU发送GPIO中断(通过任何GPIO引脚)。
(默认情况下,应关闭,其应发送/接收数据,外部MCU将在运行时设置/在睡眠模式下)
而且我也想使用同样的GPIO引脚禁用/唤醒睡眠模式,如剪切。
请在此ASPS上分享您的观点。
Thanks,
Device:
Hi Team,
请在此ASPS上分享您的观点。
Thanks,
Hi GAK,
感谢您在DA14580上的闲聊,
最新到Date SDK版本的最新版本支持DA14580是5.0.4版本,您可以参考它。
我们已经提供了一个应用程序ble_app_sleepmode显示如何使用
睡眠模式API和运行时更改睡眠模式。对于DA14580,可以使用两种睡眠模式:
● Extended sleep mode
●深度睡眠模式
在该示例中,用户可以按按钮唤醒设备。按钮按下设备后,将开始再次通告预定义的时间,然后睡觉。
您可以在外围示例中使用/添加这些API。
如果您有更多问题,请告诉我们。
Regards
IBA_Dialog
Hi Team,
谢谢你的支持,
根据您的建议,我从按下按钮后醒来。(如果按下按钮,则只需一次调用唤醒回调)
它通过使用唤醒中断处理程序(wkupct_register_callback(app_button_press_cb))和(wkupct_enable_irq())进行正常工作。
我想使用一些GPIO引脚(Port1_pin3)唤醒而不是按钮。
为此,我保留,配置GPIO引脚并注册我的回调(WKUPCT_REGISTER_CALLBALL(APP_BUTTON_PRESS_CB)),并启用GPIO引脚并将极性(高)设置为适当的PIN(WKUPCT_ENABLE_IRQ())。
GPIO的输入高,经过一段时间,它会降低。(就像按钮按下)
此时唤醒回拨回调并唤醒正常工作。
但随着GPIO的调用,唤醒回电甚至被称为低电平,(使用多仪表检查GPIO状态 - 仅限电压为0.0Volt)。
这里是“wkupct_enable_irq(wkupct_pin_select(gpio_port_1,gpio_pin_3),//选择pin(gpio_button_port,gpio_button_pin)的编程
WKUPCT_PIN_POLARITY(GPIO_PORT_1, GPIO_PIN_3, WKUPCT_PIN_POLARITY_HIGH), // polarity low
1,// 1事件
10);“我使用了。
我的期望是,GPIO引脚将会低,唤醒回电不应该调用。
它应该只调用GPIO引脚是高分的。
我也想知道这个唤醒功能如何完美适用于按钮?
一个按=一次唤醒呼叫调用。
在SDK中使用了WKUPCT_DISABLE_IRQ()回调。
也解释一下。
请尽快证明您对此的支持。
Thanks,
Hi GAK,
很高兴能够通过按钮按下并按照IBA_DIALAOG的说明来唤醒您的设备。但是,我需要几个澄清您试图实施的内容。道歉,但我无法完全理解你想要完成的事情,所以让我问你一些问题让事情变得清晰。
(默认情况下,应关闭,其应发送/接收数据,外部MCU将在运行时设置/在睡眠模式下)
而且我也想使用同样的GPIO引脚禁用/唤醒睡眠模式,如剪切。“
If I understood correctly, the device will be initially in active mode and it should be able to send or receive data through UART. What would you like to implement with the GPIO interrupt? Would you like to receive an interrupt and set your device in extended sleep mode? How do you want to change the sleep mode configuration from the active mode to extended sleep mode? The GPIO interrupt is driven by an external MCU? Be aware that since the device enters the extended sleep mode, all the peripherals blocks will be powered off, so you will not be able to have UART activity.
为了获得有关SDK的BLE_APP_SLEEPMODE示例的更多信息,我会非常建议您阅读8.50支柱5(睡眠模式)
UM-B-050:DA1458X软件开发人员指南(SDK5)。您可以从我们支持页面的DA14580选项卡找到它。本应用示例的主要目的是展示如何使用睡眠模式API并在运行时更改睡眠模式。
谢谢,PM_DIALOG.
Hi Team,
是的,你是对的,
请找到以下信息进行澄清,
1)设备最初在活动模式下,它应该能够通过UART发送或接收数据。
2)如果GPIO中断由外部MCU驱动,则设备应转至扩展睡眠模式。
3)唤醒也由外部MCU控制,另一个GPIO中断由外部MCU驱动,用于唤醒。
4)唤醒后,我应该能够恢复BLE设备状态以继续进行数据传输。
找到内联答案,
Would you like to receive an interrupt and set your device in extended sleep mode?<<< YES,
当它从外部MCU接收中断时,它应该将设备设置为扩展睡眠模式。
如何如何将睡眠模式配置从活动模式更改为扩展睡眠模式?<<<
步骤1)活动模式下的设备(此模式中的一个,除了用于通过空气传输数据)
Step 2)Going to Extended sleep mode( through GPIO interrupt driven by External MCU )
步骤3)设备从睡眠模式唤醒(通过外部MCU通过GPIO中断)
步骤4)唤醒设备后应准备转移数据后
The GPIO interrupt is driven by an external MCU? Yes,
Be aware that since the device enters the extended sleep mode, all the peripherals blocks will be powered off, so you will not be able to have UART activity.<< Yes ,At sleep mode no need to send any data through UART. But when wake up from sleep ,it should restore the old state like Advertising/data transferring .
请尽快提供支持。
Thanks,
Hi GAK,
您能否检查以下帖子吗?
https://support.dialog-semicondiondiondum/forums/post/dialog-smartbond-bl ...
此帖子可能会帮助您捕获外部MCU生成的中断,并且您应该调用app_easy_gap_advertise_stop函数。此外,您还可以检查无附加参考应用程序代码。使用此应用程序,您可以通过UART发送到DA14580的命令,因此您可以通过在命令中发送相应的休眠模式以扩展睡眠模式配置设备
https://support.dialog-semicondiondiondum/connectivity/product/da14580?qt ...
谢谢,PM_DIALOG.
Hi Team,
已经使用,我使用“唤醒定时器”块来唤醒DA14580,唤醒定时器与开关SW3(P1_1)和SW2(P0_6)工作正常。
如上所述帖子“https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl......“,对我来说并不是一个完整的解决方案。
我想通过使用WKUPCT_IRQ使用GPIO P1_3来唤醒DA14580。
代码更改是,
#define GPIO_BUTTON_PORT GPIO_PORT_0
#define GPIO_BUTTON_PIN GPIO_PIN_1
(我从外部MCU(低到高)给出DA14580的信号到(GPIO)P1_3)
Actual problem is,
一旦P0_1pin状态从低电平变为高电平,WKUPCT_CALLBALL一次被调用一次一次。
只有在使用SW3 / SW2(即,WKUPCT_IRQ一次按SW3 / SW2的单按一次)
我的观察是在将SW2 / SW3更改为GPIO P1_3之后,每3秒偶数GPIO P1_3调用WKUPCT IRQ即可。
但它不应该调用每3秒,就像SW2 / SW3按下一样。
请尽快提供您的支持
Connection:
J5 - 5号PIN在DA14580中
跳线用于将外部MCU GPIO引脚连接到DA14580 GPIO P1_3。
Thanks,
Hi GAK,
If I understood correctly, you want to wake the device up from Pin1_3 and remove the wake-up functionality from SW3 and SW2. Is that correct? Did you configured the Pin1_3 in the user_periph_setup? Sorry, but I am a little bit confused with your description, could you please explain what you are trying to accomplish? From which GPIO do you want to wake up? What does the Pin0.1 do? Can you please upload the configuration and the wake-up procedure for the Pin1_3?
谢谢,PM_DIALOG.
Hi Team,
如果我理解正确,您希望从PIN1_3唤醒设备,并从SW3和SW2中删除唤醒功能。<<<是的它是正确的。
你想从哪个gpio醒来?<<<< GPIO P1_3正在使用。
PIN0.1做了什么?<<抱歉,错误使用。使用了gpio p1_3。
Kindly find the Uploaded file FYI.
Thanks,
Hi GAK,
根据你的描述,P1_3是活跃的high and the external MCU is triggering from low to high, that’s correct? If yes, you should change the polarity, because in the code snippets that you have attached, you are using WKUPCT_PIN_POLARITY_LOW polarity. The push button is configured as INPUT_PULLUP, so the wake-up controller is triggered when the GPIO gets to low, that’s why the polarity of the bush button is low. In you case, you should do the opposite. Furthermore, you should configure the P1_3 as INPUT_PULLDOWN and use WKUPCT_PIN_POLARITY_HIGH. Please find attached an example for the P1_3 waking-up procedure.
谢谢,PM_DIALOG.
Hi Team,
Thanks for the support,
I was used the above mentioned configuration in my project.
请找到澄清的内联,
P1_3处于活动高,外部MCU从低到高电平,这是正确的?<<<是。
Actual thing is ,When the external MCU is triggering from low to high ,"app_button_press_cb ( )" call back is calling once only.
但在我的情况下,唤醒控制器“app_button_press_cb()”呼叫后触发,然后一次(外部MCU将GPIO P1_3从高到低改变为GPIO P1_3)。
Kindly provide your support on this.
Thanks,
Hi GAK,
What do you mean that the wake-up controller is being triggered more than one time? If it is triggered more than one time, this means that you get an interrupt more that one times. Could you please check if the P1_3 is triggered multiple times from the external MCU?
谢谢,PM_DIALOG.
Hi Team,
Yes, an interrupt is triggered more that one time .
Kindly find the bellow inline ,
Could you please check if the P1_3 is triggered multiple times from the external MCU? >> I was checked the P1_3 state through CRO in External MCU side and its not triggered multiple times.
此外,我还通过CRO检查DA145080 Pro套件中的相同引脚,此引脚状态也根据外部MCU而变化。
Thanks,
Hi GAK,
当您在唤醒控制器中获得活动低中中断时APP_BUTTON_PRESS_CB()。这意味着只有当设备处于永久睡眠状态时,才会执行App_button_press_cb(),并且您将获得唤醒中断。如果设备仍在宣传,则不会触发此回调。所以,你的设备进入永久睡眠模式,您发送中断唤醒您的设备,然后它是广告,回调仍然被执行?我试图了解你的问题是什么。
谢谢,PM_DIALOG.
Hi Team,
...你发送一个中断唤醒你的设备,然后它是广告,回调仍然被执行?是的,它的正确性,唤醒回调也被执行了广告中的设计。
Thanks,
Hi GAK,
I would like to let you know that this is a little bit strange situation. Please check the default ble_app_sleepmode example and you will see that the app_button_enable() is only called into the void user_app_adv_undirect_complete() function, so the app_button_press_cb() will be triggered only when the device enters the permanent sleep mode and you get a wake-up interrupt. In your case, I am not completely sure what does your firmware. In my case I am not able to replicate this problem. If the app_button_press_cb() is executed multiple times, this means that you send the interrupt to the wake-up controller more than on times. Did you try to problem the GPIO which is connected to the wake-up controller?
谢谢,PM_DIALOG.