From 5ea9097dbdd471674e4b4a77230b9e17ef0eb41c Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 3 Feb 2017 16:08:17 +1100 Subject: [PATCH 1/2] esptool: Update to latest v2.0 beta version * New "espefuse.py set_flash_voltage" command to easily set a fix VDD_SDIO regulator voltage (1.8V, 3.3V or disabled). * Fixes bugs when flashing files with non-4-byte aligned lengths (doesn't effect esp-idf image files) * README improvements --- components/esptool_py/esptool | 2 +- examples/storage/sd_card/README.md | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/components/esptool_py/esptool b/components/esptool_py/esptool index e9e9179f6f..c1d00094d5 160000 --- a/components/esptool_py/esptool +++ b/components/esptool_py/esptool @@ -1 +1 @@ -Subproject commit e9e9179f6fc3f2ecfc568987d3224b5e53a05f06 +Subproject commit c1d00094d564451636b01308625119901e2257ac diff --git a/examples/storage/sd_card/README.md b/examples/storage/sd_card/README.md index b125716eae..47fb599254 100644 --- a/examples/storage/sd_card/README.md +++ b/examples/storage/sd_card/README.md @@ -37,25 +37,24 @@ GPIO2 pin is used as a bootstrapping pin, and should be low to enter UART downlo ### Note about GPIO12 -GPIO12 is used as a bootstrapping pin to select output voltage of an internal regulator which powers the flash chip. +GPIO12 is used as a bootstrapping pin to select output voltage of an internal regulator which powers the flash chip (VDD_SDIO). This pin has an internal pulldown so if left unconnected it will read low at reset (selecting default 3.3V operation). When adding a pullup to this pin for SD card operation, consider the following: -- For boards which don't use the internal regulator, GPIO12 can be pulled high. -- On boards which use the internal regulator and a 3.3V flash chip, GPIO12 should be pulled up high, which is compatible with SD card operation. -- For boards which use 3.3V flash chip, GPIO12 needs to be low at reset. - * In this case, internal pullup can be enabled using a `gpio_pullup_en(GPIO_NUM_12);` call. Most SD cards work fine when an internal pullup on GPIO12 line is enabled. Note that if ESP32 experiences a power-on reset while the SD card is sending data, high level on GPIO12 can be latched into the bootstrapping register, and ESP32 will enter a boot loop until external reset with correct GPIO12 level is applied. - * Another option is to program flash voltage selection efuses: set `XPD_SDIO_TIEH=1`, `XPD_SDIO_FORCE=1`, and `XPD_SDIO_REG = 1`. This will permanently select 3.3V output voltage for the internal regulator, and GPIO12 will not be used as a bootstrapping pin anymore. Then it is safe to connect a pullup resistor to GPIO12. This option is suggested for production use. +- For boards which don't use the internal regulator (VDD_SDIO) to power the flash, GPIO12 can be pulled high. +- For boards which use 1.8V flash chip, GPIO12 needs to be pulled high at reset. This is fully compatible with SD card operation. +- On boards which use the internal regulator and a 3.3V flash chip, GPIO12 must be low at reset. This is incompatible with SD card operation. + * In most cases, external pullup can be omitted and an internal pullup can be enabled using a `gpio_pullup_en(GPIO_NUM_12);` call. Most SD cards work fine when an internal pullup on GPIO12 line is enabled. Note that if ESP32 experiences a power-on reset while the SD card is sending data, high level on GPIO12 can be latched into the bootstrapping register, and ESP32 will enter a boot loop until external reset with correct GPIO12 level is applied. + * Another option is to burn the flash voltage selection efuses. This will permanently select 3.3V output voltage for the internal regulator, and GPIO12 will not be used as a bootstrapping pin. Then it is safe to connect a pullup resistor to GPIO12. This option is suggested for production use. -The following commands can be used to program flash voltage selection efuses **to 3.3V**: +The following command can be used to program flash voltage selection efuses **to 3.3V**: ```sh - # Override flash regulator configuration using efuses - components/esptool_py/esptool/espefuse.py burn_efuse XPD_SDIO_FORCE - # Select 3.3V output voltage - components/esptool_py/esptool/espefuse.py burn_efuse XPD_SDIO_TIEH - # Enable internal voltage regulator - components/esptool_py/esptool/espefuse.py burn_efuse XPD_SDIO_REG + components/esptool_py/esptool/espefuse.py set_flash_voltage 3.3V ``` +This command will burn the `XPD_SDIO_TIEH`, `XPD_SDIO_FORCE`, and `XPD_SDIO_REG` efuses. With all three burned to value 1, the internal VDD_SDIO flash voltage regulator is permanently enabled at 3.3V. See the technical reference manual for more details. + +`espefuse.py` has a `--do-not-confirm` option if running from an automated flashing script. + ## 4-line and 1-line modes By default, example code uses the following initializer for SDMMC host peripheral configuration: From 527720fb5b2dc052144169e3c7695e79dea99876 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 3 Mar 2017 11:22:25 +1100 Subject: [PATCH 2/2] esptool: Update esptool.py to integrate reset fix for older dev boards Originally marked "Reset with ESP32R0 Windows workaround", but proven to be necessary on some other platforms as well. This is now integrated into the default esptool.py reset behaviour. Closes #305 https://github.com/espressif/esp-idf/issues/305 --- components/esptool_py/Kconfig.projbuild | 8 -------- components/esptool_py/esptool | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/components/esptool_py/Kconfig.projbuild b/components/esptool_py/Kconfig.projbuild index 3ce1b7f3f8..84ca5d6831 100644 --- a/components/esptool_py/Kconfig.projbuild +++ b/components/esptool_py/Kconfig.projbuild @@ -140,24 +140,16 @@ choice ESPTOOLPY_BEFORE wired from the serial port to the ESP32. Most USB development boards do this internally. - The "Reset with ESP32R0 Windows workaround" option works - around an automatic reset bug in hardware, when using Windows - with some development boards. This fix only works if you're - using a silicon revision 0 ESP32. - config ESPTOOLPY_BEFORE_RESET bool "Reset to bootloader" config ESPTOOLPY_BEFORE_NORESET bool "No reset" -config ESPTOOLPY_BEFORE_ESP32R0 - bool "Reset with ESP32R0 Windows workaround" endchoice config ESPTOOLPY_BEFORE string default "default_reset" if ESPTOOLPY_BEFORE_RESET default "no_reset" if ESPTOOLPY_BEFORE_NORESET - default "esp32r0" if ESPTOOLPY_BEFORE_ESP32R0 choice ESPTOOLPY_AFTER prompt "After flashing" diff --git a/components/esptool_py/esptool b/components/esptool_py/esptool index c1d00094d5..907273664a 160000 --- a/components/esptool_py/esptool +++ b/components/esptool_py/esptool @@ -1 +1 @@ -Subproject commit c1d00094d564451636b01308625119901e2257ac +Subproject commit 907273664ada32fc33f3fbfeba99550512c67e4d