Hi,
I'm new to ESP32 and FreeRTOS but not for microcontrollers. For developing I'm using an Dev Kit and Visual Studio Code with Platformio and Arduino framework. I have a code calculating RMS values from 3 analog signals sampled using the builtin adc_digi_read_bytes() and FreeRTOS tasks taking actions based in those RMS calculations. The code works ok but it hangs after some hours. I have the DevKit connected to my PC using a USB and like "extra hardware" there is only one led attached to GPIO 23. I'm using some GPIO ports changing their states to keep watch for running tasks and using Serial.pintln() in loop() for terminal communitacions, and BluetoothSerial too.
For example, before taking the samples, GPIO25 is set HIGH and set to LOW when all samples are manipulated.
Things that I noticed when the ESP32 hangs:
All GPIO outputs are in LOW state <- Can I eliminate the possibility of an infinite loop here?
No Serial communications.
No Bluetooth.
When I'm using Visual Studio Code and its terminal to read the data from the Dev Kit and then it is closed this action reset the DevKit. Is this normal?
Thanks.
ESP32 hang
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 hang
What is your power supply like? Possibly EMC problems from the motor?
Re: ESP32 hang
The power supply cames from the PC USB port. I'm in early development stage, so there is no motor yet, the three phase signals cames from a simple 5V pwm sine generators, these are feeding my first prototype running a PIC microcontroller, that is in production right now, without any issue. I noticed that some times closing Visual Studio Code while it is receiving data through Serial Monitor hangs the ESP32 too.
-
- Posts: 1707
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: ESP32 hang
The ESP's "/reset" or "EN" and "BOOT" pins are controlled via the DTR and RTS signals of the (USB) serial port to enable PC software to reset the ESP and enter flash download mode automatically.When I'm using Visual Studio Code and its terminal to read the data from the Dev Kit and then it is closed this action reset the DevKit. Is this normal?
Depending on the PC application (and the USB-serial's driver) those signal lines may toggle or be set to a certain level upon opening or closing the virtual COM port, which can cause a reset ("EN" toggles) or disabling ("EN" stays low) of the ESP until the COM port is reconfigured by an application or the USB is disconnected.
So, yes, this is kind-of normal and not a sign of any problems with the ESP or its code.
Re: ESP32 hang
Thank you for this info. This allows me to continue to find out what's going onThe ESP's "/reset" or "EN" and "BOOT" pins are controlled via the DTR and RTS signals of the (USB) serial port to enable PC software to reset the ESP and enter flash download mode automatically.
Depending on the PC application (and the USB-serial's driver) those signal lines may toggle or be set to a certain level upon opening or closing the virtual COM port, which can cause a reset ("EN" toggles) or disabling ("EN" stays low) of the ESP until the COM port is reconfigured by an application or the USB is disconnected.
So, yes, this is kind-of normal and not a sign of any problems with the ESP or its code.
Who is online
Users browsing this forum: No registered users and 105 guests