ESP32 and external watchdog problems / questions

jimhelios
Posts: 39
Joined: Sun Nov 10, 2019 2:35 pm

ESP32 and external watchdog problems / questions

Postby jimhelios » Wed Apr 08, 2020 5:57 am

Hi All...

I have a board with an ESP32 and an STWD100 watchdog timer chip. The WDT is connected to the ESP EN pin through a jumper, which was included to make debugging easier. The WTD's EN pin is not used, as connecting it to the ESP32 could defeat its purpose. The timeout on the WDT is 1.6 seconds and this works very well. My code has no trouble feeding it. Until it's time to boot.

When the jumper is in place (as intended for production) the ESP32 is rebooted by the WDT while it is booting because the boot takes too long. This is a nasty loop. The ESP32 is running Mongoose OS and I have already turned off the boot messages in an attempt to speed the boot, but it was not sufficient.

As I think about it, if wonder if the WDT is a good idea. Aside from the boot time, I'm wondering if it will cause problems during OTA updates, and if it will prevent the ESP from being placed in deep sleep.

I would like to include the WDT in the final board design but I don't know how to solve these problems. I would appreciate thoughts and suggestions.

Thanks...

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 and external watchdog problems / questions

Postby chegewara » Wed Apr 08, 2020 7:39 am

Hi,
whats wrong with internal esp32 WDT?

jimhelios
Posts: 39
Joined: Sun Nov 10, 2019 2:35 pm

Re: ESP32 and external watchdog problems / questions

Postby jimhelios » Wed Apr 08, 2020 4:01 pm

I thought it safest to have an external WDT. Can the ESP32's internal WDT work as reliably? I was under the impression that interna WDTs were of a software type.

boarchuz
Posts: 606
Joined: Tue Aug 21, 2018 5:28 am

Re: ESP32 and external watchdog problems / questions

Postby boarchuz » Wed Apr 08, 2020 4:28 pm

-Configure ESP32 to boot faster. Will your production firmware really take >1.6s to boot? I highly doubt it. Tie GPIO_15 low, disable all debugging in menuconfig, etc.
-Use a different external wdt with a timeout that meets your needs.
-Modify the bootloader to feed your external watchdog.
-Add some kind of RC circuit on the watchdog enable pin to disable it temporarily (eg. for 5s) after ESP_EN goes high.

jimhelios
Posts: 39
Joined: Sun Nov 10, 2019 2:35 pm

Re: ESP32 and external watchdog problems / questions

Postby jimhelios » Thu Apr 09, 2020 10:13 pm

boarchuz wrote:
Wed Apr 08, 2020 4:28 pm
-Configure ESP32 to boot faster. Will your production firmware really take >1.6s to boot? I highly doubt it. Tie GPIO_15 low, disable all debugging in menuconfig, etc.
-Use a different external wdt with a timeout that meets your needs.
-Modify the bootloader to feed your external watchdog.
-Add some kind of RC circuit on the watchdog enable pin to disable it temporarily (eg. for 5s) after ESP_EN goes high.
Thanks for all these good suggestions. I read up on GPIO 15 and the next revision of the board will probably allow us to tie it low. We're very short on pins so we're looking at freeing some up with the GPIO expander we have. I'm also trying to get the output disabled, Mongoose does not make this easy.

It does look like we'll need a few seconds to boot, so we're now looking at a longer watchdog timer but I like your suggestion of initially delaying the one we have.

Thanks again.

Who is online

Users browsing this forum: MicroController and 89 guests