Page 1 of 1

ESP32 board appears to freeze/unfreeze when USB port disconnected/connected

Posted: Thu May 12, 2022 5:08 pm
by tlaritz
Hi

Not sure if this is a HW problem or not. I'll start here.

My board (see here for schematic: https://copperhilltech.com/content/ESP32_CAN_rev_B.pdf) is acting as a CANbus/Wifi gateway. (I am using Espressif IDE for writing the C++ application code.) The gateway listens for CAN frames on its CANbus interfaces, then buffers them up and sends them via WiFi to my iPhone.

The board can be powered via USB or via 12v. When I power the board using +12v, the board appears to freeze (ie, no longer forwards CAN frames to WiFi) when I disconnect the USB bus from my laptop. Note that gateway is not receiving power over this USB and the corresponding com port on the laptop is disabled. If I reconnect the gateway's USB, frames flow again. I can cycle repeatedly between the non-freezed (ie, USB disconnected) and frozen states.

My app using ESP_LOGx messages, and I currently have the logging level set to None. The None setting appears to mean that ESP_LOGx messages are sent for only about 1 second after booting the board.

(Note: I am actually connecting the gateway to a 4-way USB splitter which is connected to my laptop. This splitter allows me to control power to individual ports. This feature is allowing me to prevent the USB from supplying power to the board.)

Short of some kind of flow control issue, it is hard to understand how connecting/disconnecting the USB could effect the application's operation. I'm pretty baffled.

Re: ESP32 board appears to freeze/unfreeze when USB port disconnected/connected

Posted: Thu May 12, 2022 5:27 pm
by liebman
Maybe something happens with the DTR & RTS signals at disconnection?

Re: ESP32 board appears to freeze/unfreeze when USB port disconnected/connected

Posted: Fri Jan 06, 2023 6:18 pm
by Ferrin13
I know this is pretty old, but I just had this same problem. The issue was that my ground from the board was incorrectly wired. With the USB port connected it acted as a ground, but as soon as it disconnected there was no longer a ground and the board crashed.