在连接resualt powerdown外围设备system crash

5 posts / 0 new
Last post
orient
Offline
Last seen:4 years 2 months ago
Joined:2015-07-20 04:11
在连接resualt powerdown外围设备system crash

Dear Dialog,
I try to reduce the power of my system,when the phone connect to the dialog14580,i didn‘t call periph_init() until data transfer ble -> uart, I call user_wakeup_hold_set() and start data transfer, after a time, the timer callback will call to restore_sleep_mode, here the problem coming when device go to sleep, system crash !!

void user_wakeup_hold_set(void)
{
if (wakeup_hold_timer_used == 0)
{
wakeup_hold_timer_used = app_easy_timer(USER_WAKEUP_HOLD_TIME, wakeup_hold_timer_cb_handler);

periph_init();
arch_force_active_mode();

arch_printf("wake up hold set\n");
}
else
{
wakeup_hold_timer_used = app_easy_timer_modify(wakeup_hold_timer_used, USER_WAKEUP_HOLD_TIME);
arch_printf("wake up hold reset\n");
}
}

static void wakeup_hold_timer_cb_handler(void)
{
arch_restore_sleep_mode();
wakeup_hold_timer_used = 0;
arch_printf("Wake up hold clear\n");
}

i have no idea to figure it out ,please help me,thank you very mush!

Device:
orient
Offline
Last seen:4 years 2 months ago
Joined:2015-07-20 04:11
update : if i do not use uart

update : if i do not use uart's rx , everything is ok!

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi orient,

Hi orient,

The periph_init is called from the LP_Handler when the system wakes up, what is your code does when crashing ? It hits the NMI_Handler, Hardfault or it resets ?

Thanks MT_dialog

orient
Offline
Last seen:4 years 2 months ago
Joined:2015-07-20 04:11
Hi dialog staff

Hi dialog staff

i call arch_force_active_mode() to keep 580 wakeup and init uart to rx&tx data, after that , i call arch_restore_sleep_mode() to release 580 so that it can go to sleep, the code crash this time. yesterday i used uart2(uart1 before) to test, everything goes well.

Is different between uart1 and 2 ?

thanks!

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi orient,

Hi orient,

Thanks for indicating.

The hardware modules are identical, the driver implementation is a bit different, the uart1 code is located in ROM, so this might cause you trouble,glad it worked.

Thanks MT_dialog