Switch to XTAL16M on wakeup

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
14 posts / 0 new
最后一篇
rajucoolsuraj
离线
最后一次露面:6 months 4 weeks ago
加入:2018-12-12 16:09
Switch to XTAL16M on wakeup

你好对话框,

根据UART2外设示例示例,我已配置UART2以在BLE SleepMode示例中进行串行通信。

On observing the communication data, there is erroneous transmission.

在论坛上的类似讨论前面推荐调用“Arch_ble_Force_WakeUp()”API,使时钟切换到XTAL16M并具有可靠的UART转移。

交换机成功,但一旦转移完成,就必须关闭BLE收音机。

我可以know,

1. If there is a way to turn off BLE radio after UART transfers.

2.如果有一种方法可以从睡眠中切换到XTAL16M,没有“Arch_ble_force_wakeup()”API调用。

问候

Raju

Device:
qinjiny_dialog
离线
最后一次露面:3 weeks 3 days ago
职员
加入:2016-11-01 05:47
Hi Raj,

Hi Raj,

1. By "turning off BLE radio after UART transfers" I suppose you mean stops BLE advertising,

是的,你可以通过致电来完成这件事app_easy_gap_advertise_stop随着UART写作操作的回调

2. arch_ble_force_wakeup() is the most recommended way to wake up the BLE core and operate with XTAL16M. If there's BLE activity the device works with XTAL16M automatically. There's also some low lever way to switch the clock e.g:

if ((GetWord16(CLK_CTRL_REG) & RUNNING_AT_XTAL16M) == 0)
{
而((getword16(sys_stat_reg)&xtal16_settled)== 0);//等待XTAL16定居
SetBits16(CLK_CTRL_REG , SYS_CLK_SEL ,0); // switch to XTAL16
while((getword16(clk_ctrl_reg)&running_at_xtal16m)== 0);//等待实际开关
}
}

I'm really not sure if there's any reason to use this, or there's any concequences using this though.

rajucoolsuraj
离线
最后一次露面:6 months 4 weeks ago
加入:2018-12-12 16:09
你好对话框,

你好对话框,

I am switching Data transfers between UART and BLE. Both transfers are mutually exlusive.

使用ARCH_BLE_FORCE_WAKEUP()导致当前消耗量的增加,这对于实现的解决方案不可行。

因此,如果是推荐的方式,那么关闭无线电将由呼叫发起易于API?

问候

raju

PM_DIALOG.
离线
最后一次露面:1 day 9 hours ago
职员
加入:2018-02-08 11:03
嗨rajucoolsuraj,

嗨rajucoolsuraj,

In your initial post you mentioned that you are working on the ble_app_sleepmode example of the SDK, aren’t you? This example puts the device into sleep mode. To do so, all peripheral blocks including the Radio and the UART are powered down. Can you please clarify if you have the sleep mode disable? Any other clarification would be very helpful.

谢谢,PM_DIALOG.

rajucoolsuraj
离线
最后一次露面:6 months 4 weeks ago
加入:2018-12-12 16:09
你好对话框,

你好对话框,

I have used ble_app_sleepmode sample example to setup sleepmode feature in the application.

There is no BLE advertisements. Upon initialization, user_app_adv_start( ) is never called.

Using Wakeup interrupt from button, I perform UART transfers.

Data is sent reliably over UART only if XTAL16M clock is enabled through, arch_force_ble_wakeup( ) is called.

在UART转移终止时,需要关闭通过ARCH_FORCE_BLE_WAKEUP()上打开的BLE RADER。因此,ARCH_BLE_EXT_WAKEUP()API正在用于完成它。

Is it the right way of implementation or is there a simple substitute for switching clocks to XTAL16M and back to low power clocks upon sleep resumption ?

问候

Raju

PM_DIALOG.
离线
最后一次露面:1 day 9 hours ago
职员
加入:2018-02-08 11:03
Hi Raju,

Hi Raju,

If I understood correctly, as soon as the device boots, you put it in sleep mode and you configured the wake up controller to detect the GPIO interrupt. When the button is pressed, the device will print data through UART2. As soon as the 585 wakes up, the BLE_WAKEUP_LP_Handler will be executed. The crystal 16MHz is being used when the system is in active mode and the crystal 32KHz when it is in sleep mode. In sleep mode all the peripheral blocks are powered off. Upon UART transfer termination, I need some clarifications on that. When interacting with UART2, that radio is ON or OF? Or is ON but you don’t advertise? The radio will be powered on when the chip wakes up.

谢谢,PM_DIALOG.

rajucoolsuraj
离线
最后一次露面:6 months 4 weeks ago
加入:2018-12-12 16:09
After boot up, system

After boot up, system initialization will not allow for the start of advertisement. The system is allowed to go into "Extended Sleep Mode without OTP copy".

On button press, Wakeup handler is called to initiate UART2 transfers. (This needs XTAL16M for reliable transfers).

在唤醒时,才会在执行BLE_WAKEUP_LP_HANDLLer时切换回XTAL16M。(It does not if advertisement is not initiated).

To achieve the clock switch to XTAL16M, arch_ble_force_wakup( ) API is to be executed as per a forum discussion.

1. Is there a simpler way to switch clocks without calling arch_ble_force_wakup( ) API?

2.通过ARCH_BLE_FORCE_WAKUP()API切换时钟,主循环中的下一个睡眠阶段是否会关闭与ARCH_BLE_FORCE_WAKUP()API调用打开的BLE无线电?

如果您尚未遵循,我将妥善安排进一步阐明。

regards

raju

PM_DIALOG.
离线
最后一次露面:1 day 9 hours ago
职员
加入:2018-02-08 11:03
嗨rajucoolsuraj,

嗨rajucoolsuraj,

每次系统唤醒时都会触发BLE_WAKEUP_LP_HANDLER。在睡眠模式下,该设备运行32K时钟,因此,一旦唤醒,时钟就会切换到16MHz。按下按钮唤醒时,将执行APP_BUTTON_PRESS_CB()CALLABACK功能以启动外围设备块和BLE。我无法明白为什么要打开时钟。如果芯片处于活动模式,则可以使用UART才能打印数据 - 如果芯片是广告,则无关紧要。请注意,外设块使用16MHz时钟,在睡眠模式下,它们被关闭。如果您对UART2有任何问题,请您说明吗?此外,如果您使用的是广告间隔之间的任何睡眠模式,请说明吗?

谢谢,PM_DIALOG.

rajucoolsuraj
离线
最后一次露面:6 months 4 weeks ago
加入:2018-12-12 16:09
你好对话框,

你好对话框,

I request to follow the below statements exactly as stated.

启动后,系统初始化不会允许广告的开始(User_App_Adv_StartAPI不被称为)。该系统被允许进入“没有OTP拷贝的扩展睡眠模式”(Arch_set_extended_sleepAPI)。

Wakeup controller is initialized to handle button interrupts and the device is allowed to sleep (this switches the clocks from XTAL16M to RC32K).

On button press, Wakeup interrupt handler is called to initiate UART2 transfers. (UART/UART2 needs XTAL16M for reliable transfers).

在唤醒时,才会在执行BLE_WAKEUP_LP_HANDLLer时切换回XTAL16M。(It does not if advertisement is not initiated through user_app_adv_start API)。

I hope you have understood my setting from the above abstract.

如果只有上述情况清楚,我将继续。

Thanks

问候

Raju

PM_DIALOG.
离线
最后一次露面:1 day 9 hours ago
职员
加入:2018-02-08 11:03
Hi Raju,

Hi Raju,

唤醒程序与广告程序无关。这意味着一旦按下按钮唤醒DA14586,始终执行BLE_WAKEUP_LP_HANDLer。user_app_adv_start()API仅适用于广告!为此,即使设备未广告,也可以使用UART2硬件块。

谢谢,PM_DIALOG.

rajucoolsuraj
离线
最后一次露面:6 months 4 weeks ago
加入:2018-12-12 16:09
你好对话框,

你好对话框,

解决索赔 - “这意味着一旦按下按钮即可唤醒DA14586,始终执行BLE_WAKEUP_LP_HANDLER。”

如果根据我的设置配置了某些内容,则不会在唤醒中从按钮中断执行BLE_WAKEUP_LP_HANDLER。

简单的实验足以为索赔提供证据。

Request to validate the setting as the same was not the case on my end.

THanks

问候

Raju

PM_DIALOG.
离线
最后一次露面:1 day 9 hours ago
职员
加入:2018-02-08 11:03
Hi Raju,

Hi Raju,

The BLE_WAKEUP_LP_HANDLER will be executed in every wake up and the LP clock will be swathed to 16MHz clock in every wake up.

谢谢,PM_DIALOG.

rajucoolsuraj
离线
最后一次露面:6 months 4 weeks ago
加入:2018-12-12 16:09
你好对话框,

你好对话框,

发生什么,如果

1. "arch_ble_ext_wakup_on( )" API is called.

2. "app_easy_gap_undirected_advertise_start( )" API is never called.

On wakeup via WakeUp interrupt controller, (BLE Radio is turned off before sleeping),

BLE_WAKEUP_LP_HANDLLEL永远不会执行,并且不会发生时钟开关。

问候

Raju

PM_DIALOG.
离线
最后一次露面:1 day 9 hours ago
职员
加入:2018-02-08 11:03
嗨rajucoolsuraj,

嗨rajucoolsuraj,

请看看ble_app_sleepmode example of the SDK6.0.10. When the undirect advertising is completed the user_app_adv_undirect_complete() callback function is triggered and if you check the source code the arch_ble_ext_wakeup_on() is executed in order to disable wakeup for BLE and timer events. Only external (GPIO) wakeup events can wakeup the processor through the wake up controller. To do so, in this stage the device is in permanent sleep mode but the wake up controller is configured ad it is ready to detect an external wake up event (app_button_enable()). When a wake up event is detected the app_button_press_cb() is triggered, it checks whether the BLE core is in permanent sleep mode or not. If yes, it takes the BLE core out of the permanent sleep mode.

谢谢,PM_DIALOG.