Hi @gabygold , I appreciate your answer, sorry for the interference before I noticed your answer.
From my experience with some demo code that end in an endless while loop, the ESP32 doesn't do watchdog restarts, in contrast to ESP8266. You may need to enable watchdog on ESP32 first.