ESP32-C3 resets on activating WiFi AP powered by USB-C ...

Started by winfried, August 28, 2023, 11:12:05 PM

Previous topic - Next topic

winfried

Using Platformio and Arduino/ESP-IDF framework on ESP32-C3-DevKit-LiPo I experience a reset when activating as WiFi Access Point powering over USB-C.

Installed Platformio (using VSCode) and settings:

[env]
platform = espressif32
framework = espidf
monitor_speed = 115200

[env:esp32-c3-devkitm-1]
board = esp32-c3-devkitm-1
upload_protocol = esp-builtin
debug_tool = esp-builtin
debug_init_break = tbreak setup

Using example `hello-world` I can compile, upload via USB-C and run without issue.
Also, one key debug works (F5), fine stepping through code.

When setting up as an access point, it always resets, inspecting the logs it says brown out...
When I added a scope to 3.3V power, I saw a glitch, which causes the reset.



Using external 5V power on the 5V pin, the glitch does not happen, and it does not reset.

Maybe USB-C 5V power supply causes the brown out of the chip.

Any suggestion how to fix this without external 5V power ?

mfg
 Winfried Ritsch
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----

LubOlimex

Looking at the schematic, it is probably the USB port or the USB cable. Probably high inner resistance of the cable or poor contact or hardware fault at the USB port. First try with all USB ports of the computer to see if same glitch remains, then test with another cable. Maybe test with another computer. Maybe investigate what voltage and current is available at the cable or the USB ports. Maybe test with externally powered USB hub or converter (instead of computer USB) to further exhaust all scenarios.
Technical support and documentation manager at Olimex

winfried

Hello,

Quote from: LubOlimex on August 29, 2023, 08:54:20 AMLooking at the schematic, it is probably the USB port or the USB cable. Probably high inner resistance of the cable or poor contact or hardware fault at the USB port. First try with all USB ports of the computer to see if same glitch remains, then test with another cable. Maybe test with another computer. Maybe investigate what voltage and current is available at the cable or the USB ports. Maybe test with externally powered USB hub or converter (instead of computer USB) to further exhaust all scenarios.

I already tested with HUB and other USB ports and different computer (station, laptop), tested with 2 different cables, but of the same type.

Since I saw no glitch in the 5V but only 3V I suspected something else... but with externel 5V power from Prog-C it does not reset.

So will check with another USB-C3 cable type and report back.
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----

LubOlimex

External 5V line and USB line go to basically same location and are only separated by a diode.
Technical support and documentation manager at Olimex

winfried

Thanks for the hint and solved:

Here for the record:

I tested again with more accurate measurements:

a) with a shorter cable without USB cable extension it did not brown out anymore.
The glitch was smaller, and I saw it also on the USB 5V.

b) adding a LiPo battery also helped.

Anyway, it seems the ESP32-C3 draws some power peak activating the WLAN as station and using the USB-C for debugging providing serial and JTAG interface over the USB seems to have caused the glitch.

Using the serial as for monitoring and no JTAG from USB-C also does not cause the brown out, and now I understand the reason for the ICSP programming connector.
Also, the reset button in combination with the GPIO8-Boot button helped to rescue from repeating resets with flashing.

best regards
 winfried
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----