在唤醒时切换到XTAL16M

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
14 posts / 0 new
Last post
rajucoolsuraj
Offline
Last seen:6个月3周前
加入:2018-12-12 16:09
在唤醒时切换到XTAL16M

Hello Dialog,

I have configured UART2 for serial communication in BLE SleepMode example as per UART2 peripheral sample example.

在观察通信数据时,存在错误的传输。

一个类似的讨论论坛recommends calling "arch_ble_force_wakeup()" API to make clock switch to XTAL16M and have reliable UART transfers.

The switch is successful but once the transfers are complete, it would be necessary to turn off the BLE radio.

我可以know,

1.如果有一种方法可以在UART转移后关闭BLE收音机。

2. If there is a way to switch to XTAL16M on wakeup from sleep without "arch_ble_force_wakeup()" API call.

Regards

Raju

设备:
Qinjiny_Dialog
Offline
Last seen:2 weeks 4 days ago
Staff
加入:2016-11-01 05:47
嗨raj,

嗨raj,

1.通过“在UART转移后关闭BLE收音机”我想你的意思是停止BLE广告,

Yes you can do this by callingapp_easy_gap_advertise_stopwith the callback of UART writing operation

2. ARCH_BLE_FORCE_WAKEUP()是唤醒BLE核心并使用XTAL16M运行的最推荐的方法。如果有BLE活动,设备会自动使用XTAL16M。还有一些低的杠杆方式来切换时钟e:

if((getword16(clk_ctrl_reg)&running_at_xtal16m)== 0)
{
while( (GetWord16(SYS_STAT_REG) & XTAL16_SETTLED) == 0 ); // wait for XTAL16 settle
setbits16(clk_ctrl_reg,sys_clk_sel,0);//切换到xtal16
while( (GetWord16(CLK_CTRL_REG) & RUNNING_AT_XTAL16M) == 0 ); // wait for actual switch
}
}

我真的不确定是否有任何理由使用此操作,或者虽然有任何概念。

rajucoolsuraj
Offline
Last seen:6个月3周前
加入:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

我正在在UART和BLE之间切换数据传输。两种转移都是互化的。

Using arch_ble_force_wakeup() is causing an increase in current consumption which is not viable for the solution implemented.

Hence, if it is the recommended way, then turning off the radio is to be initiated by a call to which easy API ?

Regards

raju.

PM_Dialog
Offline
Last seen:2天19小时前
Staff
加入:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

在您提到的初始帖子中,您提到您正在研究SDK的BLE_APP_SLEEPMODE示例,不是吗?此示例将设备放入睡眠模式。为此,包括无线电和UART在内的所有外围块都断电。如果您有休眠模式禁用,请您澄清吗?任何其他澄清都非常有帮助。

谢谢, PM_Dialog

rajucoolsuraj
Offline
Last seen:6个月3周前
加入:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

我使用BLE_APP_SLEEPMODE示例示例来在应用程序中设置SleepMode功能。

没有BLE广告。初始化后,永远不会调用user_app_adv_start()。

使用从按钮使用唤醒中断,我执行UART转移。

只有在UART中可靠地发送数据,才通过XTAL16M时钟,调用ARCH_FORCE_BLE_WAKEUP()。

Upon UART transfer termination, BLE radio turned ON via arch_force_ble_wakeup( ) will need to be turned off. Hence, arch_ble_ext_wakeup( ) API is being used to accomplish it.

是否是正确的实现方式,或者在睡眠恢复时有简单的切换时钟和返回低功耗时钟的简单替代品吗?

Regards

Raju

PM_Dialog
Offline
Last seen:2天19小时前
Staff
加入:2018-02-08 11:03
嗨raju,

嗨raju,

如果我能够正确地理解,一旦设备靴子,就把它放在睡眠模式,并且您将唤醒控制器配置为检测GPIO中断。按下按钮时,设备将通过UART2打印数据。一旦585醒来,就会执行BLE_WAKEUP_LP_HANDLER。当系统处于活动模式和晶体32kHz时,正在使用晶体16MHz时,当处于睡眠模式时。在睡眠模式下,所有外围块都会断电。在UART转移终止时,我需要一些澄清。与UART2交互时,该无线电亮起?或者正在上,但你不宣传?当芯片唤醒时,无线电将被通电。

谢谢, PM_Dialog

rajucoolsuraj
Offline
Last seen:6个月3周前
加入:2018-12-12 16:09
启动后,系统

启动后,系统初始化不允许启动广告。允许该系统进入“没有OTP Copy的扩展模式”。

在按钮按下,调用唤醒处理程序以启动UART2传输。(这需要XTAL16M进行可靠的转移)。

在唤醒时,才会在执行BLE_WAKEUP_LP_HANDLLer时切换回XTAL16M。(如果未启动广告,则不执行此操作。

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

1.在不调用Arch_ble_Force_Wakup()API的情况下,是否有更简单的方法来切换时钟?

2. Once the clocks are switched via arch_ble_force_wakup( ) API, does the next sleep phase in the main loop turn off the BLE radio that was turned ON with call to arch_ble_force_wakup( ) API ?

If you are yet unable to follow, I shall make suitable arrangements to elucidate further.

问候

raju.

PM_Dialog
Offline
Last seen:2天19小时前
Staff
加入:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

The BLE_WAKEUP_LP_HANDLER is triggered every time the system wakes up. The device is running with the 32K clock when in sleep mode, so as soon as it wakes up, the clock is switched to 16MHz. When pressing the button to wake up, the app_button_press_cb() callaback function will be executed in order to initiate the peripherals block and the BLE. I cannot get why you would like to switch clocks. If the chip is in active mode, you could use UART in order to print data – it doesn’t matter if the chip is advertising or not. Be aware that the peripherals blocks are using the 16Mhz clock and they are shut down when in sleep mode. Can you please indicate if you have any issue with UART2? Also, can you please indicate if you are using any of the sleep modes between advertising intervals?

谢谢, PM_Dialog

rajucoolsuraj
Offline
Last seen:6个月3周前
加入:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

我要求按照规定的方式遵循以下陈述。

启动后,系统initialization will not allow for the start of advertisement (user_app_adv_startAPIis not called). The system is allowed to go into "Extended Sleep Mode without OTP copy" (arch_set_extended_sleepAPI).

唤醒控制器初始化以处理按钮中断,并且允许设备睡眠(这将来自XTAL16M的时钟切换到RC32K)。

在按钮按下,调用唤醒中断处理程序以启动UART2传输。(UART / UART2需要XTAL16M进行可靠的转移)。

在唤醒时,才会在执行BLE_WAKEUP_LP_HANDLLer时切换回XTAL16M。(如果未通过User_App_Adv_Start API启动广告).

我希望你从上面的摘要中了解了我的环境。

I shall continue if only the above is clear.

谢谢

Regards

Raju

PM_Dialog
Offline
Last seen:2天19小时前
Staff
加入:2018-02-08 11:03
嗨raju,

嗨raju,

The wake up procedure is independent from the advertising procedure. This means that as soon as you press the button for waking up the DA14586, the BLE_WAKEUP_LP_HANDLER is always executed. The user_app_adv_start() API is only for advertising! To do so, you can use UART2 hardware block even if the device is not advertising.

谢谢, PM_Dialog

rajucoolsuraj
Offline
Last seen:6个月3周前
加入:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

To address the claim - "This means that as soon as you press the button for waking up the DA14586, the BLE_WAKEUP_LP_HANDLER is always executed."

If something is configured as per my setting, It will never execute BLE_WAKEUP_LP_HANDLER on wakeup from button interrupt.

A simple experiment is sufficient to provide the evidence for the claim.

请求验证设置,同样不是我的结尾。

谢谢

Regards

Raju

PM_Dialog
Offline
Last seen:2天19小时前
Staff
加入:2018-02-08 11:03
嗨raju,

嗨raju,

BLE_WAKEUP_LP_HANDLL将在每个唤醒中执行,LP时钟将在每次唤醒时换成16MHz时钟。

谢谢, PM_Dialog

rajucoolsuraj
Offline
Last seen:6个月3周前
加入:2018-12-12 16:09
Hello Dialog,

Hello Dialog,

What happens, if

1.调用ARCH_BLE_EXT_WAKUP_ON()“API。

2.“app_easy_gap_undircted_advertise_start()”API永远不会调用。

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

BLE_WAKEUP_LP_HANDLER is never executed, and no clock switch shall happen.

Regards

Raju

PM_Dialog
Offline
Last seen:2天19小时前
Staff
加入:2018-02-08 11:03
Hi rajucoolsuraj,

Hi rajucoolsuraj,

请查看SDK6.0.10的BLE_APP_SLEEPMODE示例。当未确定的广告完成后,触发user_app_adv_undirect_complete()回调函数,如果检查源代码,则执行ARCH_BLE_EXT_WAKEUP_ON()才能禁用BLE和TIMER事件的唤醒。只有外部(GPIO)唤醒事件可以通过唤醒控制器唤醒处理器。为此,在此阶段,设备处于永久睡眠模式,但唤醒控制器被配置为AD,它已准备好检测外部唤醒事件(App_button_enable())。当检测到唤醒事件时,触发app_button_press_cb(),它检查BLE核心是否处于永久睡眠模式。如果是,则将BLE核心从永久睡眠模式中取出。

谢谢, PM_Dialog