Device wake gpio and gpio irq with the same pin for cyw20719b2

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

cross mob
anje_2248446
Level 3
Level 3
25 sign-ins 10 replies posted 10 questions asked

Hello guys,

I have a custom board with cyw20719b2, with a build setup using modus toolboox 2.1 and wiced bt sdk v2.7.1 fdb3982. As this is a custom board for embedded environment, the host is not really connected.

I have sleep configuration like this:

 

wiced_sleep_configure(
    &(wiced_sleep_config_t) {
        .sleep_mode                   = WICED_SLEEP_MODE_TRANSPORT,
        .device_wake_gpio_num         = WICED_P28,
        .device_wake_mode             = WICED_SLEEP_WAKE_ACTIVE_HIGH,
        .device_wake_source           = WICED_SLEEP_WAKE_SOURCE_GPIO,
        .host_wake_mode               = WICED_SLEEP_WAKE_ACTIVE_HIGH,
        .sleep_permit_handler         = m_shutdown_handler,
    }
);

 

 

Here in the sleep configuration WICED_P28 is connected to interrupt pin coming from PMIC (Which gives push button / charger connect etc interrupts coming from PMIC).

So my problem is that, I also need the WICED_P28 pin for GPIO interrupt to handle various interrupts coming from PMIC.

When I tried to configure WICED_P28 for both (wiced_sleep_configure() & wiced_hal_gpio_register_pin_for_interrupt()), the gpio interrupt never gets called.

My question is, if it is possible to use same gpio pin for wiced_sleep_configure() & wiced_hal_gpio_register_pin_for_interrupt() ?

Thanks,

aniket

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hello Aniket,

You should be able to use same pin for sleep wake up source as well as GPIO interrupt. 

Did you try checking only the interrupt routing is working fine or not disabling sleep config? 

Can you please recheck the pin configuration used?  Please check if the same pin is by default configured to some other functionalities in Device configurator as well. 

Regards,

Anjana

 

 

View solution in original post

0 Likes
3 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hello Aniket,

You should be able to use same pin for sleep wake up source as well as GPIO interrupt. 

Did you try checking only the interrupt routing is working fine or not disabling sleep config? 

Can you please recheck the pin configuration used?  Please check if the same pin is by default configured to some other functionalities in Device configurator as well. 

Regards,

Anjana

 

 

0 Likes
anje_2248446
Level 3
Level 3
25 sign-ins 10 replies posted 10 questions asked

Hello Anjana,

Thanks for the reply.

Here is the pin configuration used:

 

#define ioss_0_pin_28_config \
{\
.gpio = (wiced_bt_gpio_numbers_t*)&platform_gpio_pins[PLATFORM_GPIO_11].gpio_pin, \
.config = GPIO_INPUT_ENABLE | GPIO_PULL_UP_DOWN_NONE | GPIO_INTERRUPT_ENABLE | GPIO_EN_INT_FALLING_EDGE, \
.default_state = GPIO_PIN_OUTPUT_LOW, \
}

 

And one thing I would like to mention is, if wiced_sleep_configure() is commented out and P28 is only configured as gpio irq using wiced_hal_gpio_register_pin_for_interrupt() Then gpio irq handler is correctly getting called. But as I mentioned in previous post if P28 is used in both wiced_sleep_configure() and wiced_hal_gpio_register_pin_for_interrupt() then gpio irq handler is never getting called. Is there something missing ?

0 Likes
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

If the host is not in connection and want the device to go to sleep, I think we should select, WICED_SLEEP_MODE_NO_TRANSPORT as sleep_mode. There was some issue reported for SDS sleep mode in 20719. Is your device goes to SDS mode? 

I will try testing the configuration and update you soon my observation with PDS mode.

 

Thanks,

-Dheeraj

0 Likes