dg_configLATCH_WKUP_SOURCE not waking up the device!!!

4 posts / 0 new
Last post
garzola
Offline
Last seen: 2 weeks 2 days ago
Joined: 2018-07-23 13:21
dg_configLATCH_WKUP_SOURCE not waking up the device!!!

Hi ,

I enabled dg_configLATCH_WKUP_SOURCE because i need in my app multiple source events. I verified that if ths macro is enabled the wakeup from hibernation mode doesn't work. If I disable it instead it wakes the device....

I DO need more irqs ... Is that a bug of SDK ?

thanks for your reply!

Marco

Device: 
garzola
Offline
Last seen: 2 weeks 2 days ago
Joined: 2018-07-23 13:21
Hi,

Hi,

I solved the issue. I guess it's a SDK bug. It misses the writing of a register WKUP_SELECT_Px_REG
below as i solved with my function.
could you confim this ? btw seems it works waking device from hibernation.

hw_wkup_init(NULL);
hw_wkup_configure_pin(HW_GPIO_PORT_3,HW_GPIO_PIN_1,true,HW_WKUP_PIN_STATE_LOW);
hw_wkup_enable_wakeup( HW_GPIO_PORT_3,HW_GPIO_PIN_1 ); <---- this is my fnc
hw_wkup_register_interrupt(wkup_handler, 1);

void hw_wkup_enable_wakeup(HW_GPIO_PORT port, HW_GPIO_PIN pin)
{
switch (port) {
case HW_GPIO_PORT_0:
WAKEUP->WKUP_SELECT_P0_REG |= (1 << pin);
break;
case HW_GPIO_PORT_1:
WAKEUP->WKUP_SELECT_P1_REG |= (1 << pin);
break;
case HW_GPIO_PORT_2:
WAKEUP->WKUP_SELECT_P2_REG |= (1 << pin);
break;
case HW_GPIO_PORT_3:
WAKEUP->WKUP_SELECT_P3_REG |= (1 << pin);
break;
case HW_GPIO_PORT_4:
WAKEUP->WKUP_SELECT_P4_REG |= (1 << pin);
break;
default:
ASSERT_WARNING(0);//Invalid argument
}
}

Thanks

Marco

PM_Dialog
Offline
Last seen: 4 days 13 hours ago
Staff
Joined: 2018-02-08 11:03
Hi garzola,

Hi garzola,

Could you please let me know if this fixed your issue? You should write the WKUP_SELECT_Px_REG.

Thanks, PM_Dialog

garzola
Offline
Last seen: 2 weeks 2 days ago
Joined: 2018-07-23 13:21
yes it fixed my issue. Marco

yes it fixed my issue.

Marco