ESP32 - EN pin and the flashing issues, etc
Posted: Mon Jul 22, 2019 1:35 pm
Hi All,
I spent last week connecting up an ESP32-WROOM-32D to my current STM32H7 project (that is already up and running). I received 3 of them from digikey, all came pre-loaded with ESP32-AT firmware 1.1.3.
I wired it up in the usual fashion (as reference in the datasheet and on numerous other sites, eval board schematics, etc)
1) VDD = tied to 3.3V
2) GND = all GND pins tied to GND
3) EN = pulled up via 10k resistor to 3.3V
4) IO0 = jumper to flip between being pulled up via 10k to 3.3v or pulled down via 10k to GND (for flashing)
5) IO2 = IO0 = pulled to GND via 10k resistor
bootup into normal mode or downloader mode was fine, using the simple jumper to pull IO0 hi or low.
Flashing proved to be quite difficult, and never fully completed, as I constantly got flash errors at all different times, packet header errors, even full erase started but didn't complete. This happened on every attempt at random places.
I noticed many users of other eval boards, other setups, etc were having to add large bulk caps to their EN pins in order to get flashing to work. This tells me the ESP32 needs to pull a decent amount of current into the EN pin, and it's not just a simple buffered I/O input?
(maybe espressif needs to revisit the core design of their esp32 chip and see how exactly this EN pin was layed down in the logic)
Anyhow, I also tied it to a GPIO pin of my STM32, and drove it high/low via the GPIO (leaving the 10k pull-up still in place), same flashing issues, it was crashing or timeouts most of the time. I then did a quick test and shorted the EN pin to Vdd (3.3v), and all worked perfect.
So, again going down that same path that EN is not a simple buffered I/O input, it needs to sink current, at least when doing downloading/flash things... but I would just assume it needs to pull current all the time, and just to be safe drive it from a current source, not a pull-up only.
I ended up doing a simple transistor driver, and it now works perfect, flashing was easy, and did it many times, full erase, etc, and it worked 100%, no issues.
See the below circuit for reference:
I spent last week connecting up an ESP32-WROOM-32D to my current STM32H7 project (that is already up and running). I received 3 of them from digikey, all came pre-loaded with ESP32-AT firmware 1.1.3.
I wired it up in the usual fashion (as reference in the datasheet and on numerous other sites, eval board schematics, etc)
1) VDD = tied to 3.3V
2) GND = all GND pins tied to GND
3) EN = pulled up via 10k resistor to 3.3V
4) IO0 = jumper to flip between being pulled up via 10k to 3.3v or pulled down via 10k to GND (for flashing)
5) IO2 = IO0 = pulled to GND via 10k resistor
bootup into normal mode or downloader mode was fine, using the simple jumper to pull IO0 hi or low.
Flashing proved to be quite difficult, and never fully completed, as I constantly got flash errors at all different times, packet header errors, even full erase started but didn't complete. This happened on every attempt at random places.
I noticed many users of other eval boards, other setups, etc were having to add large bulk caps to their EN pins in order to get flashing to work. This tells me the ESP32 needs to pull a decent amount of current into the EN pin, and it's not just a simple buffered I/O input?
(maybe espressif needs to revisit the core design of their esp32 chip and see how exactly this EN pin was layed down in the logic)
Anyhow, I also tied it to a GPIO pin of my STM32, and drove it high/low via the GPIO (leaving the 10k pull-up still in place), same flashing issues, it was crashing or timeouts most of the time. I then did a quick test and shorted the EN pin to Vdd (3.3v), and all worked perfect.
So, again going down that same path that EN is not a simple buffered I/O input, it needs to sink current, at least when doing downloading/flash things... but I would just assume it needs to pull current all the time, and just to be safe drive it from a current source, not a pull-up only.
I ended up doing a simple transistor driver, and it now works perfect, flashing was easy, and did it many times, full erase, etc, and it worked 100%, no issues.
See the below circuit for reference: