GPIO states not retained in extended sleep

4 posts / 0 new
Last post
wisilica
Offline
Last seen:11 months 2 days ago
加入:2015-03-17 08:16
GPIO states not retained in extended sleep

Hi Team,
I am working on the ble_app_peripheral project. The default sleep mode is set to ARCH_EXT_SLEEP_ON in user_config.h file. I am using a gpio which is configured as follows in set_pad_function() in periph_init() :
GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_4, OUTPUT, PID_GPIO, true);
Also, the state of this gpio is varied in the code using GPIO_SetActive and GPIO_SetInactive functions.
我们面临的问题是, the current state of the gpio was not retained each time the device wakes up from extended sleep. The issue was solved by configuring the gpio to the current state each time using the function
GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_4, OUTPUT, PID_GPIO, present_gpio_state) in set_pad_function() .
Is this the expected behaviour or is there any other means for making the gpios hold their current state during extended sleep.

Thanks,
Team Wisilica

Device:
MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
嗨wisillica,

嗨wisillica,

Yes, the 580 retains its state while in sleep mode, but as soon as it wakes up the periph_setup() executes in order to configure the pins, so they are set but in their default state, the solution to that is to keep the pin's state in your fw and reconfigure it in the periph_init() accordingly.

Thanks MT_dialog

wisilica
Offline
Last seen:11 months 2 days ago
加入:2015-03-17 08:16
Hi,

Hi,

Why is it required to do a periph_init every time the chip wakes up from sleep? Removing this call will have any side effects?

Thanks,
Wisilica

MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi wisilica,

Hi wisilica,

The periph_init() is invoked in the LP_Handler() of the system, is there a reason that you would like to remove the function ? In the 580 the state is retained and not the function of the pin, so as soon as you fall asleep the state will be retained but not the configuration and as soon as you wake up the 580 will have the default configuration of the pins without the periph_init().

Thanks MT_dialog