Setting VDD_SDIO to 3.3V in software, overriding MTDI strapping pin?
Posted: Fri Oct 13, 2023 11:54 am
I'm using a Wrover-module on a custom PCB and made a mistake by not being able to guarantee that the strapping pin MTDI is alwa
ys pulled low during power-up in order to operate the (wrover-)internal flash with 3.3V instead of 1.8V, as the latter results
in failing write ops (reads are fine, at least the previously flash firmware boots up).
I solved the issue by burning the efuse to override evaluation of MTDI, but the first ~100 are already shipped out without the
efuse being burned.
From looking at the IDF SDK it looks like I can also config VDD_SDIO in software. I found the struct `rtc_vddsdio_config_t` and respective functions like `rtc_vddsdio_set_config()` setting registers which look promising.
Since I can't actually measure VDD_SDIO as flash and esp32 are inside the wrover module I just want to have confirmation: Can I actually configure VDD_SDIO that way and does it override whatever the MTDI pin reads?
If so, I'm a bit confused about the struct's members. The header file states:
```
/**
* Structure describing vddsdio configuration
*/
typedef struct {
uint32_t force : 1; //!< If 1, use configuration from RTC registers; if 0, use EFUSE/bootstrapping pins.
uint32_t enable : 1; //!< Enable VDDSDIO regulator
uint32_t tieh : 1; //!< Select VDDSDIO voltage. One of RTC_VDDSDIO_TIEH_1_8V, RTC_VDDSDIO_TIEH_3_3V
uint32_t drefh : 2; //!< Tuning parameter for VDDSDIO regulator
uint32_t drefm : 2; //!< Tuning parameter for VDDSDIO regulator
uint32_t drefl : 2; //!< Tuning parameter for VDDSDIO regulator
} rtc_vddsdio_config_t;
```
Most likely `force` and `enable` should be set to 1, same for `tieh` as `RTC_VDDSDIO_TIEH_3_3V` is defined as `1` - but what is it with the other struct members?
What are they for exactly? What do they need to be set to in order to achieve my goal of driving the flash with 3.3V?
ys pulled low during power-up in order to operate the (wrover-)internal flash with 3.3V instead of 1.8V, as the latter results
in failing write ops (reads are fine, at least the previously flash firmware boots up).
I solved the issue by burning the efuse to override evaluation of MTDI, but the first ~100 are already shipped out without the
efuse being burned.
From looking at the IDF SDK it looks like I can also config VDD_SDIO in software. I found the struct `rtc_vddsdio_config_t` and respective functions like `rtc_vddsdio_set_config()` setting registers which look promising.
Since I can't actually measure VDD_SDIO as flash and esp32 are inside the wrover module I just want to have confirmation: Can I actually configure VDD_SDIO that way and does it override whatever the MTDI pin reads?
If so, I'm a bit confused about the struct's members. The header file states:
```
/**
* Structure describing vddsdio configuration
*/
typedef struct {
uint32_t force : 1; //!< If 1, use configuration from RTC registers; if 0, use EFUSE/bootstrapping pins.
uint32_t enable : 1; //!< Enable VDDSDIO regulator
uint32_t tieh : 1; //!< Select VDDSDIO voltage. One of RTC_VDDSDIO_TIEH_1_8V, RTC_VDDSDIO_TIEH_3_3V
uint32_t drefh : 2; //!< Tuning parameter for VDDSDIO regulator
uint32_t drefm : 2; //!< Tuning parameter for VDDSDIO regulator
uint32_t drefl : 2; //!< Tuning parameter for VDDSDIO regulator
} rtc_vddsdio_config_t;
```
Most likely `force` and `enable` should be set to 1, same for `tieh` as `RTC_VDDSDIO_TIEH_3_3V` is defined as `1` - but what is it with the other struct members?
What are they for exactly? What do they need to be set to in order to achieve my goal of driving the flash with 3.3V?