ESP32/Arduino stops calling loop() but no WDT timeout

mlefevre
Posts: 5
Joined: Sun Jun 16, 2024 4:08 pm

ESP32/Arduino stops calling loop() but no WDT timeout

Postby mlefevre » Sun Jun 16, 2024 4:22 pm

Hi,
I've been developing with the ESP8266 and ESP32 for years and never ran into this issue until now. I have an ESP32-WROVER-E with 16MB of flash and 8MB (4MB useable) of SPI PSRAM. Development is with vscode+PlatformIO.
This system boots and gets into a good idle state with ArduinoCore calling loop() regularly. When I send my system an MQTT command, it starts processing it and gets most of the way to completion (over 1200 - 1500 mS) when Arduino stops calling loop() and the system hangs. No WDT fires and it will sit there forever until I reset it.

Before I offer all of the gory details of what I'm doing, I want to ask if there are ways to enable the Arduino core to use the serial port to help me debug? I have already added the call to SeDebugOutput(true) after Serial.begin() and I don't see any output before or after the hang. I have debug builds enabled in platformio.ini. I have an ESP32 debugger somewhere but I've never used it and I'd like to pursue any easy-to-implement debug options before I climb the JTAG debugger learning curve.

Again, at this point I'm just looking for information on how to observe what ArduinoCore is doing between calls to my loop().


mlefevre
Posts: 5
Joined: Sun Jun 16, 2024 4:08 pm

Re: ESP32/Arduino stops calling loop() but no WDT timeout

Postby mlefevre » Sat Jun 22, 2024 1:21 pm

Thanks for the pointer to that info. It was what I was looking for. However, even setting the level to 5 (verbose), I don't see anything on the Serial stream when my loop() stops getting called. I am in the process of trying to get my debugger working but I'm having communication issues with it that I haven't been able to solve:

```
Open On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz

adapter speed: 5000 kHz

Info : tcl server disabled
Info : telnet server disabled
Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description '*', serial '*' at bus location '*'
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6014, description '*', serial '*' at bus location '*'

.pioinit:11: Error in sourced command file:
Remote communication error. Target disconnected.: No error.
```
I pursued that LIBUSB error and installed the toolchain and driver that Espressif recommends but that didn't seem to help at all. I used Zadif to make sure the WINUSB driver was installed as that's what all of the YouTube videos suggest.

I've decided that my next move is to back out the changes I have made and see if I can find the one that created this problem. This project used to work but after a series of optimizations and performance enhancements, it started failing with the problem I have described.

Who is online

Users browsing this forum: No registered users and 78 guests