SPI device not working after deep sleep wake up

collinm
Posts: 3
Joined: Sat May 16, 2020 9:38 pm

SPI device not working after deep sleep wake up

Postby collinm » Sat May 16, 2020 9:49 pm

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);

WiFive
Posts: 2929
Joined: Tue Dec 01, 2015 7:35 am

Re: SPI device not working after deep sleep wake up

Postby WiFive » Mon May 18, 2020 9:31 am

Try holding all spi gpios in a known good state?

ESP_Sprite
Posts: 3461
Joined: Thu Nov 26, 2015 4:08 am

Re: SPI device not working after deep sleep wake up

Postby ESP_Sprite » Mon May 18, 2020 3:56 pm

BUT result indicates the device is in a bad state.
How does this show?

collinm
Posts: 3
Joined: Sat May 16, 2020 9:38 pm

Re: SPI device not working after deep sleep wake up

Postby collinm » Sat May 23, 2020 2:24 am

after wake up I read registers and they contain wrong values

collinm
Posts: 3
Joined: Sat May 16, 2020 9:38 pm

Re: SPI device not working after deep sleep wake up

Postby collinm » Sat May 23, 2020 2:27 am

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();

Who is online

Users browsing this forum: Baidu [Spider] and 12 guests