Device not working as expected after waking up from deep sleep mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Device not working as expected after waking up from deep sleep mode

1,062 Views
kooljitdas
Contributor I

After entering deep sleep mode, I am trying to wake up the device using GPIO interrupt. i am able to configure the GPIO interrupt for the rising edge and the control is going to the IRQ handler on every rising edge, but there is some clocking issue that has occurred. The output on the debug UART is coming as some garbage value which looks like a baud rate issue. I tried to manually configure the clock and reinitialize the hardware including debug UART(UART 3), but its still not helped. 

Following is the IRQ handler that i have written, please suggest if any changes are required.

void EINT3_IRQHandler(void)

{
delay();
NVIC_ClearPendingIRQ(EINT3_IRQn);
Chip_GPIOINT_ClearIntStatus(LPC_GPIOINT, 0, 6);
prvSetupHardware();
xTaskResumeAll();
DEBUGOUT("Rising Status: %d\n", Chip_GPIOINT_GetStatusRising(LPC_GPIOINT,0));
DEBUGOUT("Falling Status: %d\n", Chip_GPIOINT_GetStatusFalling(LPC_GPIOINT,0));
delay();
NVIC_EnableIRQ(EINT3_IRQn);
DEBUGOUT("IRQ Enabled\n");
delay();
}

0 Kudos
Reply
2 Replies

932 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Kooljit,

Could you please provide the information of which MCU are you using? 

Also, notice that you are using the printf function inside your handler, the function DEBUGOUT makes the call to printf, this could be the root of the problem that you are having.

It's a good practice to keep the Handler of the interrupts as short as possible. Is not a good idea to add delays inside the Handler. It would be better that  in the Handler you just clear the interrupt flag and activate another flag and do everything else outside. 

Hope it helps!

Victor.

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

932 Views
carstengroen
Senior Contributor II

It would probably be easier if you told what processor you are having problems with ?

(and maybe also what factor the baudrate is off from the expected, might point you in some direction)

0 Kudos
Reply