GPIO Interrupt State after Deep Sleep

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

I would like to get some confirmation on the use of gpio_getPinInterruptStatus().

My goal is to discover whether a GPIO line caused the BCM20737S to wake up from timed deep sleep or whether it was just time to wake up. While I'm able to find out whether I just came from POR or not, I'm not sure how I can make certain that a GPIO interrupt caused that wake up.

The next best thing to try was using the following code:

void

xyz_create(void)

{

  //blecm_configFlag |= BLECM_DBGUART_LOG;

  blecm_configFlag = 0;

  ble_trace1("Port Interrupt: 0x%x", gpio_getPinInterruptStatus(0, 2));

  ble_trace1("Port Interrupt: 0x%x", gpio_getPinInterruptStatus(0, 1));

  bleprofile_Init(bleprofile_p_cfg);

  bleprofile_GPIOInit(bleprofile_gpio_p_cfg);

  xyz_gpio_setup();

...

This prints

15:25:48 - Port Interrupt: 0x1

15:25:48 - Port Interrupt: 0x0

15:25:48 - 020106031900020b094d504c20446576

15:25:48 - 696365

15:25:48 - 020a04

As I would have expected since I pulled P2 low for 32ms. Now I'm not sure whether it was meant to be used without initialization

in a case like this. I hope you can help, because this would solve my problem, especially since the interrupt handler which I have to register first is not called in this case.

Regards,

Kilian

0 Likes
1 Solution
Anonymous
Not applicable

Hi Kilian,

I'm no expert, but we are using:

   if ( mia_isResetReasonTimedWake() )

   if  ( mia_isResetReasonPor()  )

etc..

View solution in original post

4 Replies
Anonymous
Not applicable

As it turned out the Interrupt status appears to be one even when there wasn't any cause for an interrupt to occur. The question remains though, how do I detect the wakeup from deep sleep cause?

Regards,

Kilian

0 Likes
Anonymous
Not applicable

I just found the following code in blegm.c:

else if(mia_isResetReasonTimedWake()) // this function is not working (button press reset also return TRUE

Thats unfortunate.

Also notice that I'm using SDK 2.2.0 by now. To refine the question further, what I'm looking for is a separation

between GPIO based wakeup from deep sleep and wakeup from timed deep sleep. I don't like the ideas I have to achieve that, i.e. to measure the time since sleep start and guess whether we should behave as if we came from timed wakeup, or to develop an external circuit that stores the GPIO state during bootup.

I hope you can help.

Regards,

Kilian

0 Likes
Anonymous
Not applicable

Oh!  Re: How can I get bcm20732s reset reason?

states that it should work, and my experiments showed that too - very nice.

0 Likes
Anonymous
Not applicable

Hi Kilian,

I'm no expert, but we are using:

   if ( mia_isResetReasonTimedWake() )

   if  ( mia_isResetReasonPor()  )

etc..