Cypress技术论坛
直播中

朱虹博

7年用户 230经验值
私信 关注
[问答]

什么时候单核蓝牙可以进入深度睡眠/睡眠状态?

你好,
我们有蓝牙配置为单核M0+蓝牙控制器和主机。我们想知道,在下面的表中,什么是被视为祝福模式(广告,连接,传输等)?具体来说,我们可以把核心放在深度睡眠,而蓝牙广告呢?或者只有睡眠模式是可能的?我们使用逻辑分析仪来观察CythySypMyDeSoLeLeP()和CythySypMySeLeP()的成功/不成功转换。对于CythySypMyLoSe[(),波形显示成功成功的不成功周期,而蓝牙是广告,而CythySypMyDeSLeLeP()显示了一个成功的循环,接着是多次失败。
至于当蓝牙设备连接时,我们同样感到奇怪。如果一个设备被连接,但是没有数据被发送/接收,我们能将祝福放置到睡眠模式吗?或者只有当一个设备被连接时,祝福才能处于主动模式吗?
最好的,
史蒂夫

以上来自于百度翻译


     以下为原文
  Hi there,

We have Bluetooth configured to single core m0+ for both Bluetooth controller and host. We are wondering, in reference to the table below, what is considered active mode for BLESS (advertising, connected, transmission, etc.)? Specifically, can we put the core to deep sleep while bluetooth is advertising? Or is only sleep mode possible? We are using a logic analyzer to observe the successful/unsuccessful transitions of Cy_SysPm_DeepSleep() and Cy_SysPm_Sleep(). For Cy_SysPm_Sleep(), the waveforms show successful-successful-unsuccessful cycles while bluetooth is advertising, while Cy_SysPm_DeepSleep() shows cycles of one success followed by multiple unsuccesses.

As for when a bluetooth device is connected, we are wondering the same. If a device is connected but no data is being transmitted/received, could we put the BLESS to sleep mode? Or can the BLESS only be in active mode so long as a device is connected?



Best,
Steve

回帖(16)

朱虹博

2018-9-7 11:51:07

你好,
没问题,我们一直在做其他的任务。
是的,我们仍然面临蓝牙连接的问题,非常感谢您的帮助。
最好的,
史蒂夫

以上来自于百度翻译


     以下为原文
  Hi msur,
 
No problem, we have been working on other tasks meanwhile.
 
And yes, we are still facing the issue with Bluetooth connectivity and would greatly appreciate your help  
 
Best,
Steve
举报

张帆

2018-9-7 12:00:01
引用: Emily1225 发表于 2018-9-7 17:44
你好,
没问题,我们一直在做其他的任务。
是的,我们仍然面临蓝牙连接的问题,非常感谢您的帮助。

史提夫,
我看了一下这个项目,并添加了您提供的修改的(;)循环。如果您还记得我前面提供的示例,您将需要调用过程服务器直到广告开始。基本上,在CythBuryHalf.It.c文件中的修复是不完整的,没有堆栈库中的另一个修复——我们只使用修复的一半。完整修复将很快作为PDL 3.0.4(一个或两个星期)的一部分。
这就是我的(循环)循环的样子(我相信标志名称是不言自明的),并且我的广告在每一次超时后都开始良好。
(;)
{
如果(过程)iStaskon)ISStaveAdvut完备)
{
Cyle Burr进程();
过程错误;
}
如果(!)CythySypMyCM0ISLoWPOWER()
{
CythySypMsEndoLoPultMeod();
}
CythEnEnLyBulsBelsStisteTyBelStest= CyBulyStaskGutBelestStand();
如果(BelsSt==CythBulyBelsStisteAc能能能生)BelsSt==CythBulyBelsStAtEyEx Eoo稳)
{
CythEnthySypMsStutsSutht APIREST=CythySypMyS入睡(CythySypMmithWaITY-FuxId中断);
如果(APIREST)!CysySypMm成功
{
CygGPIOSET(dBu00xPoT,dBy00nnUm);/ /不工作
}
其他的
{
CygGPIO-CLR(dBu00PoT,dBu00nnUm);/ /工作
}
}
其他的
{
CythEnthySypMsStutsSutht APIREST=CysySypMyDeSt入睡(CythySypMmithWaiTi For中断);
如果(APIREST)!CysySypMm成功
{
CygGPIOSET(dBu11PoT,dBu11nNm);/ /不工作
}
其他的
{
CygGPIO-CLR(dBu11PoT,dBu11nNm);/ /工作
}
}
}
所以请添加那个代码,看看它是否修复了这个问题。
当做,
Meenakshi Sundaram R

以上来自于百度翻译


     以下为原文
  Steve,
 
I took a look at the project and added the modified for(;;) loop you provided. If you remember the example I provided earlier, you will need to call ProcessEvents till Advertisement starts. Basically the fix in the cy_ble_hal_int.c file is incomplete without another fix in the stack library - we are using only one half of the fix. The complete fix will be soon out as part of PDL 3.0.4 (in a week or two).
 
This is how my for(;;) loop looks like (I believe the flag names are self explanatory ) and my advertisement starts fine after every timeout.
 
for(;;)
    {
        if(processEvents || (!isStackOn) || (!isStartAdvComplete))
        {
            Cy_BLE_ProcessEvents();
           
            processEvents = false;       
        }
       
        if(!Cy_SysPm_Cm0IsLowPower())
        {
            Cy_SysPm_EnterLowPowerMode();
        }      
 
        cy_en_ble_bless_state_t bleSsState = Cy_BLE_StackGetBleSsState();      
 
        if(bleSsState == CY_BLE_BLESS_STATE_ACTIVE || bleSsState == CY_BLE_BLESS_STATE_ECO_STABLE)
        {
            cy_en_syspm_status_t apiResult = Cy_SysPm_Sleep(CY_SYSPM_WAIT_FOR_INTERRUPT);
            if(apiResult != CY_SYSPM_SUCCESS)
            {
                Cy_GPIO_Set(DB_0_PORT,DB_0_NUM);    // Doesn't work
            }
            else
            {
                Cy_GPIO_Clr(DB_0_PORT,DB_0_NUM);    // Work
            }
        }
        else
        {
            cy_en_syspm_status_t apiResult = Cy_SysPm_DeepSleep(CY_SYSPM_WAIT_FOR_INTERRUPT);
            if(apiResult != CY_SYSPM_SUCCESS)
            {
                Cy_GPIO_Set(DB_1_PORT,DB_1_NUM);    // Doesn't work
            }
            else
            {
                Cy_GPIO_Clr(DB_1_PORT,DB_1_NUM);    // Work
            }
        }
    }
 
So please add that code and see if that fixes the issue.
 
Regards,
Meenakshi Sundaram R
举报

朱虹博

2018-9-7 12:19:14
史提夫,
祝福不能进入低功耗模式,这是广告(而广播主动做TX),监听连接请求(无线电主动做RX)和连接层(通常连接发送/接收的每个连接的间隔期)。
不得不说的是,一旦你开始堆和栈的广告开始,自动将负责管理广播的功率模式。这一cy_ble_start API注册回调和回调函数使系统不进入深度睡眠而广播活动(通过调用时返回cy_syspm_fail cy_syspm_deepsleep API)。注意,当设备不允许深度睡眠当广播活跃时期,它允许睡。然而,在某些情况下,收音机需要CPU以及(一些处理)-通常中断或cy_ble_processevents API。
无论如何,你不必担心cy_syspm_deepsleep API调用,会自动把设备深睡眠时,收音机是成功进入低功耗模式。
当做,
Meenakshi Sundaram R

以上来自于百度翻译


     以下为原文
  Steve,
 
The BLESS cannot enter low power mode while it is advertising (while the radio is active doing Tx), listening for connection requests (radio active doing Rx) and making connection pings (usual conn Tx/Rx every connection interval period).
 
Having said that, once you start the stack and advertisement starts, the stack automatically takes care of managing the radio's power modes. The Cy_BLE_Start API registers DeepSleep callbacks and those callbacks makes sure the system does not enter deep sleep while the radio is active (by returning CY_SYSPM_FAIL when calling Cy_SysPm_DeepSleep API). Note that while the device is not allowed to deep sleep during the period when radio is active, it is allowed to sleep. However, there are cases when the radio requires CPU as well (for some processing) - usually interrupts or Cy_BLE_ProcessEvents API.
 
Anyway, you do not have to worry about calling Cy_SysPm_DeepSleep, the API will automatically put the device to deep sleep when the radio is successfully put into low power mode.
 
Regards,
Meenakshi Sundaram R
举报

张帆

2018-9-7 12:24:28
你好,
谢谢,清理了很多东西。
我们很好奇收音机是否放在低功耗模式内部?还是要把它进入低功耗模式,通过调用cy_syspm_enterlowpowermode()?我们也注意到,我们能够使CPU进入深度睡眠时,设备连接。收音机是无效时,数据不转移但连接到设备?

以上来自于百度翻译


     以下为原文
  Hi msur,
 
Thank you, that cleared up a lot of things.
 
We are curious if the radio gets put into low power mode internally? or do we have to put it into low power mode by calling Cy_SysPm_EnterLowPowerMode()?  We also notice that we are able to put the cpu into deep sleep when a device is connected. Is the radio inactive when data is not transferring but connected to the device?
举报

更多回帖

发帖
×
20
完善资料,
赚取积分