|
查看: 2067|回复: 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();
}





145

主题

338

回帖

1588

积分

管理员

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

1

主题

1

回帖

25

积分

英勇黄铜

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

145

主题

338

回帖

1588

积分

管理员

积分
1588
发表于 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

相关侵权、举报、投诉及建议等,请发 E-mail:forum@telink-semi.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|沪ICP备17008231号-1 |沪公网安备31011502403548号

在本版发帖返回顶部