unstable ESP32

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
academo
Posts: 8
Joined: Thu Feb 10, 2022 8:21 pm

unstable ESP32

Post by academo » Sun Feb 13, 2022 12:05 pm

Hello everyone.

After solving the problem of the PWM by flashing the "unstable" 1.18 I am now having a different kind of problem.

From to time, without running code on main, the board "hangs". Attempts to put files with ampy will just wait for ever. Connecting to the repl with picocom will work but I will never get the prompt, it just stays there waiting (pressing enter or any other combination gives me nothing).

Basically I can't do anything until I press the rst button on the board where I get the regular reset message:

Code: Select all

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4540
ho 0 tail 12 room 4
load:0x40078000,len:12344
ho 0 tail 12 room 4
load:0x40080400,len:4124
entry 0x40080680
MicroPython v1.18 on 2022-02-10; ESP32 module with ESP32
Type "help()" for more information.
>>> %
I am not running code yet, simply syncing files with ampy and now with mpy-utils: mpy-upload (which turned out to be more reliable), my main.py is empty at the moment and I don't have a boot.py

when I was using ampy, sometimes it will sync 1 or two files and then hang there, until I press reset. Once again, not running code, just syncing files.

This is the board I have (not endorsed in anyway): Image

When I flashed MP I got this:

Code: Select all

❯ esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 460800 write_flash --verify -z 0x1000 esp32-20220210-unstable-v1.18-121-gd8a7bf83c.bin
esptool.py v3.2
Serial port /dev/ttyUSB0
Connecting.....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: [redacted]
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x0017dfff...
Compressed 1558624 bytes to 1025193...
Wrote 1558624 bytes (1025193 compressed) at 0x00001000 in 23.6 seconds (effective 529.4 kbit/s)...
Hash of data verified.

Leaving...
Verifying just-written flash...
(This option is deprecated, flash contents are now always read back after flashing.)
Verifying 0x17c860 (1558624) bytes @ 0x00001000 in flash against esp32-20220210-unstable-v1.18-121-gd8a7bf83c.bin...
-- verify OK (digest matched)

fivdi
Posts: 16
Joined: Thu Feb 03, 2022 10:28 pm
Contact:

Re: unstable ESP32

Post by fivdi » Sun Feb 13, 2022 5:11 pm

I don't know what the problem is here but perhaps it's a poor USB connection? Does the operating system on your PC report any errors related to USB? For example, if you are using Linux on your PC, does running the dmesg command from a terminal window display error messages related to USB?

academo
Posts: 8
Joined: Thu Feb 10, 2022 8:21 pm

Re: unstable ESP32

Post by academo » Tue Feb 15, 2022 1:25 pm

My USB cable is a good quality one and I also used it to work with the esp8266 dev board and micropython without this problem.

Reading more here and there I saw that some of these boards have problems with the boot mode and stability because they are missing a capacitor between EN and GND. So I put a 2uF capacitor and I got it working stable.

Thanks for the hint! your message took me to a search of how the boot modes work for the esp32 and the esptool.

bulletmark
Posts: 59
Joined: Mon Mar 29, 2021 1:36 am
Location: Brisbane Australia

Re: unstable ESP32

Post by bulletmark » Tue Feb 15, 2022 11:09 pm

@academo, I have a few of those ESP32 devkit clones bought from ebay/aliexpress and that is a very common problem. Here is a photo of 3 I just pulled from my drawer. They are all basically the same circuit except notice the 1st (left) one has no capacitor near the EN switch in the bottom left corner. The 2nd one has a capacitor seemingly tacked on as a clear erratum design change and the 3rd has cleaned up that change to align it vertically with the other components. I just add a 10uf cap to my circuits and that means it always works regardless of which ESP32 clone I insert.

academo
Posts: 8
Joined: Thu Feb 10, 2022 8:21 pm

Re: unstable ESP32

Post by academo » Wed Feb 16, 2022 9:59 pm

@bulletmark thanks for confirming!

Indeed since I addded the capacitor (2.2uf) it had been working great, entering the correct boot mode and repl working fine.

Thanks for the tips!

jg1112
Posts: 2
Joined: Mon Feb 21, 2022 1:32 am

Re: unstable ESP32

Post by jg1112 » Mon Feb 21, 2022 1:58 am

bulletmark wrote:
Tue Feb 15, 2022 11:09 pm
@academo, I have a few of those ESP32 devkit clones bought from ebay/aliexpress and that is a very common problem. Here is a photo of 3 I just pulled from my drawer. They are all basically the same circuit except notice the 1st (left) one has no capacitor near the EN switch in the bottom left corner. The 2nd one has a capacitor seemingly tacked on as a clear erratum design change and the 3rd has cleaned up that change to align it vertically with the other components. I just add a 10uf cap to my circuits and that means it always works regardless of which ESP32 clone I insert.
could you explain further about the cap in your circuit. Do you place it on the breadboard? a schematic or pic would be greatly appreciated.

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: unstable ESP32

Post by OutoftheBOTS_ » Mon Feb 21, 2022 6:53 am

The cap needs to go between EN and ground. If the voltage on the EN pin dips at all it resets the MCU so you need a small cap on the EN to fill any dips.

From above https://imgur.com/a/YWYB2AO you can see on the left board there isn't a cap on bottom left EN so it becomes unstable

bulletmark
Posts: 59
Joined: Mon Mar 29, 2021 1:36 am
Location: Brisbane Australia

Re: unstable ESP32

Post by bulletmark » Mon Feb 21, 2022 6:55 am

@jg1112, you will find this ESP32 issue discussed all over the web. E.g here and here.

Post Reply