5 posts / 0 new
Last post
2455321262
Offline
Last seen:2 years 4 months ago
Joined:2017-01-22 06:43
DA14580睡眠模式唤醒异常

你好,
我用自己打的板子,程序从external sleep 模式唤醒后,进入下面这一段代码,跑不动了,请问如何解决?
if ((DEVELOPMENT_DEBUG) && (USE_POWER_OPTIMIZATIONS))
{
slp_period_retained = slp_period;
// if this Assertion hits then the LP ISR lasts longer than the time
// that has been reserved via LP_ISR_TIME_XTAL32_CYCLES and LP_ISR_TIME_USEC.
if (sleep_lp_cycles && (sleep_lp_cycles < slp_period))
{
user_gpio_status_set(PET_GREEN_LED_PORT,PET_GREEN_LED_PIN,INACTIVE);
ASSERT_WARNING(0);
}
}

Device:
Qinjiny_Dialog
Offline
Last seen:1 month 6 days ago
Staff
Joined:2016-11-01 05:47
你修改了哪些低功耗或者唤醒相关的的handler函数吗

你修改了哪些低功耗或者唤醒相关的的handler函数吗?这个简单来说是你的设备比设定好的时间睡的久了。

去sdk\platform\arch.c可以看到关于设定LP_ISR_TIME_XTAL32_CYCLES和 LP_ISR_TIME_USEC的说明,你可以尝试修改一下

/* Note
* --------------------------
* After XTAL16M settling, the code needs ~10usec + 1/2 LP cycle to power-up BLE and pop BLE registers.
* This translates to ~26usec for XTAL32 and ~57usec for RCX.
*
* Thus, LP_ISR_TIME_USEC - XTAL16 settling time = 3357 - 2900 = 457usec and 457 - 57 = 400usec
* are left as a safety margin in the worst case (RCX) (best case is 3357 - 2900 - 26 = 431 for XTAL32).
*
* In principle, this time can be reduced to be at least 2 low power cycles.
*
* If the remaining time is not enough for periph_init() to complete then an ASSERTION will hit in
* BLE_WAKEUP_LP_Handler (when DEVELOPMENT_DEBUG is 1). In this case, since the settling time of the
* XTAL16M is fixed, the user should increase the LP_ISR_TIME_USEC (and, consequently, the
* LP_ISR_TIME_XTAL32_CYCLES).
*/

2455321262
Offline
Last seen:2 years 4 months ago
Joined:2017-01-22 06:43
额,我没有修改任何关于低功耗或者唤醒相关的handler

额,我没有修改任何关于低功耗或者唤醒相关的处理程序,我的代码是在需求方的基础上修改的,我删除了部分我不需要的代码,然后新增自己需要的。
我尝试着将宏LP_ISR_TIME_USEC的值修改成我能够修改的最大值,但是它任然会进入1楼提到的warning中,我不知道该怎么做,你能给一些建议吗,谢谢

2455321262
Offline
Last seen:2 years 4 months ago
Joined:2017-01-22 06:43
我尝试着禁用宏DEVELOPMENT_DEBUG

我尝试着禁用宏DEVELOPMENT_DEBUG,但是在设备从睡眠状态唤醒后,它无法进入串口中断、也不能进入GPIO中断,在每次唤醒设备后是否需要重新配置管脚?重新配置其中断?重新启用中断?

CYibin
Offline
Last seen:3 months 2 weeks ago
Staff
Joined:2017-12-14 02:48
你好,

你好,

每次唤醒系统后,都要重新初始化外设的,将相关需要用到的外设的初始化,集中放在 periph_init 函数中即可