Skip to content
Discussion options

You must be logged in to vote

After some digging I found its a ESP32S3 chip bug which causes it to lose its ADC calibration register values during lightsleep().

There is a commit for esp_idf_4.4 to fix it: espressif/esp-idf@32afe6a
(essentially just adds a save/restore around the sleep)

Strangely my esp_idf_4.4 download doesnt have the fix, so I just added the save/restore functions to my esp32ext module (along with the gpio wake setup I needed to wake on a gpio on this MCU)


// workaround for chip bug, not in 4.4?
#define REGI2C_ANA_CALI_BYTE_NUM 8
static DRAM_ATTR uint8_t _adc_reg_val[REGI2C_ANA_CALI_BYTE_NUM];

// save ADC calibration values before sleeping (only required on ESP32S3 apparently)
STATIC mp_obj_t esp3…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@brianwyld
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@brianwyld
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by brianwyld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
ESP32
Labels
None yet
3 participants