Page 1 of 1

SPI device not working after deep sleep wake up

Posted: Sat May 16, 2020 9:49 pm
by collinm
I have an SPI device that works fine all around. I use the SPI device's IRQ line to wake up the ESP32 from light sleep. To make this work I needed to keep the PERIPH domain on during light sleep, see below (light sleep cfg). However I can NOT get my SPI device work after deep sleep wake up.

Basically what I do on deep sleep wake up is the following:

- config SPI BUT DON'T reset the SPI device
- send the command to the device BUT result indicates the device is in a bad state.

I have added a 10k pull up on the SPI device lines for CS (chip select) and Reset but that did not help.

Any suggestions?

light sleep cfg:

Code: Select all

esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);

Re: SPI device not working after deep sleep wake up

Posted: Mon May 18, 2020 9:31 am
by WiFive
Try holding all spi gpios in a known good state?

Re: SPI device not working after deep sleep wake up

Posted: Mon May 18, 2020 3:56 pm
by ESP_Sprite
BUT result indicates the device is in a bad state.
How does this show?

Re: SPI device not working after deep sleep wake up

Posted: Sat May 23, 2020 2:24 am
by collinm
after wake up I read registers and they contain wrong values

Re: SPI device not working after deep sleep wake up

Posted: Sat May 23, 2020 2:27 am
by collinm
I have tried the following but not success

gpio_deep_sleep_hold_en();
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
esp_deep_sleep_start();