找回密码
 立即注册

微信扫码登录

查看: 300|回复: 3

[BLE SDK] Sleep scan in adv mode

[复制链接]

1

主题

1

回帖

25

积分

英勇黄铜

积分
25
发表于 2025-9-16 00:06:38 | 显示全部楼层 |阅读模式 来自 瑞士
Information
说明:   建议参照本版块置顶帖内容输入必要信息
芯片型号: TLSR8251
SDK及版本: Telink_825X_SDK
I tested sleep mode and scan in adv mode. After sleep scan in adv mode does not work, what has to be initialized on wakeup?

call for sleep:
bls_pm_setSuspendMask (SUSPEND_ADV | DEEPSLEEP_RETENTION_ADV | SUSPEND_CONN | DEEPSLEEP_RETENTION_CONN);

Main:
_attribute_ram_code_ int main (void)    //must run in ramcode
{
    blc_pm_select_internal_32k_crystal();
    cpu_wakeup_init();
    int deepRetWakeUp = pm_is_MCU_deepRetentionWakeup();  //MCU deep retention wakeUp
    rf_drv_init(RF_MODE_BLE_1M);
    gpio_init( !deepRetWakeUp );  //analog resistance will keep available in deepSleep mode, so no need initialize again
#if (CLOCK_SYS_CLOCK_HZ == 16000000)
    clock_init(SYS_CLK_16M_Crystal);
#elif (CLOCK_SYS_CLOCK_HZ == 24000000)
    clock_init(SYS_CLK_24M_Crystal);
#endif
    blc_app_loadCustomizedParameters();
   
    init_i2c();
    if( deepRetWakeUp ){
        user_init_deepRetn ();
    }
    else{
        user_init_normal ();
    }   
    irq_enable();
    while (1) {
        main_loop ();
    }
}

Function called on wakeup:
_attribute_ram_code_ void user_init_deepRetn(void){//after sleep this will get executed
    init_lcd_deepsleep();
    blc_ll_initBasicMCU();
    rf_set_power_level_index (RF_POWER_P3p01dBm);
    blc_ll_recoverDeepRetention();
}





48

主题

306

回帖

1137

积分

版主

积分
1137
发表于 2025-9-16 16:18:46 | 显示全部楼层 来自 上海
which SDK version you using?

1

主题

1

回帖

25

积分

英勇黄铜

积分
25
 楼主| 发表于 2025-9-16 16:56:28 | 显示全部楼层 来自 瑞士

48

主题

306

回帖

1137

积分

版主

积分
1137
发表于 2025-9-18 09:58:54 | 显示全部楼层 来自 上海
This is a third-party SDK, and we cannot provide direct support because we are uncertain about the actual version they are using at the underlying level and whether they have modified certain configurations. We recommend you first communicate with Ai-Thinker.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-10-12 20:54 , Processed in 0.100967 second(s), 21 queries .

Powered by Telink 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表