The problem about call the function ----- app_disable_sleep()

10 posts / 0 new
Last post
liyang
Offline
Last seen:3 months 3 weeks ago
Expert
Joined:2014-09-24 11:51
The problem about call the function ----- app_disable_sleep()

hi,dialog :
I have use the DA14580 for 12 months . from SDK 3.0.2 to 3.0.10 .But I always met a problem . when I open the LED which controled by two PWM pulse .I use the function app_disable_sleep(), so the LED can work well . and when I close the LED ,I call the function app_set_extended_sleep() to make sure the device work in low power mode .
It work well , but when I use the LED for several hours (when I open the LED ,I call the app_disable_sleep one time per second) , the PWM can not work well. I think the call of the app_disable_sleep() does not work . why ???

Device:
MT_dialog
Offline
Last seen:6 days 4 hours ago
Staff
Joined:2015-06-08 11:34
Hi liyang,

Hi liyang,

What do you mean that the PWM dont work well, you think that the da falls asleep although the disable sleep is issued ? From where do you call the functions in order to wake up the system and start the PWM ? Is an external interrupt ? You say that at the beggining this implementation works well but as the time goes by the problem occurs? Have you tried implement the same function (blink a led) but with a ke_timer to see if the problem persists ?

Thanks MT_dialog

liyang
Offline
Last seen:3 months 3 weeks ago
Expert
Joined:2014-09-24 11:51
hi,MT_dialog,

hi,MT_dialog,
the PWM dont work well,because the periph_init() which in the function BLE_WAKEUP_LP_Handler() was called. My PWM control the LED which is indicate the state of device charge.

MT_dialog
Offline
Last seen:6 days 4 hours ago
Staff
Joined:2015-06-08 11:34
Hi liyang,

Hi liyang,

Why do you think that the periph_init() function in the BLE_WAKEUP_LP_Handler() is the one that cause you problems? Is the current implementation working and over time it doesn't, have i understood correctly? In which point of your implementation you call the functions in order to start the system and start the PWM?

Thanks MT_dialog

liyang
Offline
Last seen:3 months 3 weeks ago
Expert
Joined:2014-09-24 11:51
Hi,MT_dialog,

Hi,MT_dialog,
就像我说的,我的PWM控制LED表明e the state of device charge. When I charge my device ,I need a continuous PWM wave for a long time . Actually when the device run for a few hours ,the PWM is not continuous . So you will see the LED is blinking. But I need the LED glow lasts.
except the call of the periph_init() function in the BLE_WAKEUP_LP_Handler(),which one can make the PWM discontinuous?

MT_dialog
Offline
Last seen:6 days 4 hours ago
Staff
Joined:2015-06-08 11:34
Hi liyang,

Hi liyang,

Is the watchdog timer enabled. Maybe this is because of the it. If the system doesn't sleep it never re-initializes the watchdog timer, and the watchdog timer overflows, this causes the system to issue a platform reset command and reboots. Can you please disable the watchdog timer if it is enabled and give it a try ?

Thanks MT_dialog

liyang
Offline
Last seen:3 months 3 weeks ago
Expert
Joined:2014-09-24 11:51
Hi,MT_dialog,

Hi,MT_dialog,

It has nothing to do with the watchdog timer.

Thanks liyang

MT_dialog
Offline
Last seen:6 days 4 hours ago
Staff
Joined:2015-06-08 11:34
Hi liyang,

Hi liyang,

Is the watchdog timer enabled in your project?

You can check if a platform reset issues by replacing the platform_reset_func in the jump_table.c file with a custom empty function and try to catch the call of the function with a break point in debbuging.

Thanks MT_dialog

liyang
Offline
Last seen:3 months 3 weeks ago
Expert
Joined:2014-09-24 11:51
Hi,MT_dialog,

Hi,MT_dialog,

Trust me , It has nothing to do with the watchdog timer.

Thanks liyang

MT_dialog
Offline
Last seen:6 days 4 hours ago
Staff
Joined:2015-06-08 11:34
Hi liyang,

Hi liyang,

Can you check if the probelm persists if you dont call disable sleep, but try to keep the da14580 awake in the app_asynch_proc function while charging and dont let it move further down in the loop in order to fall asleep?

Thanks MT_dialog