I am using Platformio on a Win11 pc to develop a project using a esp32-ProS3 board. I realize this is the Arduino forum and not Platformio but since some of the smartest and most helpful people hang-out here and I have seen this reset issue on the Arduino IDE also, with different projects. The problem I have is that if I connect the serial terminal (primarily for troubleshooting) and than terminate the connect in Platformio the esp32-Pros3 performs a reset. Can someone please explain why this is happening and how to prevent it?
Topic moved. Please do not post in “Uncategorized”; see the sticky topics in Uncategorized - Arduino Forum.
Just a hunch, but if the code called Serial.end(); prior to the physical disconnect I will make a small wager the reset will not happen.
While this project is still in testing phase Serial.end() wouldn't be practical, at least without a major rewrite.
it's tied to DTR and RTS toggling..
this is used to reset the board after code is uploaded..
might be a way to stop it but then the upload process will change..
there's nothing broken it's working as designed..
good luck.. ~q
Thanks for the reply. I found the app CoolTerm with DTR and RTS turned off works. For some reason Platformio and Putty do not fully turn off these signals.
Hi @bdrmachine.
It is an interesting subject. On the classic Arduino boards which do not have native USB capability, there is a special circuit on the board used to trigger the reset when the DTR signal is asserted.
Such a circuit is only possible when the board has a dedicated USB interface chip, and so on the boards where the primary microcontroller interfaces directly with the host PC via USB, there typically is no such reset when the serial port is opened. For this reason, it is common to add some code to the sketch specifically to cause it to wait for the serial port to be opened so that we can see all the content the sketch program prints to Serial
in the Serial Monitor:
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
The Unexpected Maker ProS3 has a direct connection between the PC and its ESP32-S3 microcontroller, so we would intuitively expect that the assertion of the serial port control signals would not cause a reset. However, it turns out that a reset system is implemented in the ESP32-S3 microcontroller itself, as documented in section 33.3.2 ("CDC-ACM USB Interface Functional Description") of the ESP32-S3 Technical Reference Manual:
Aside from general-purpose communication, the CDC-ACM interface also can be used to reset the ESP32-S3 and optionally make it go into download mode in order to flash new firmware. This is done by setting the RTS and DTR lines on the virtual serial port.
Table 33.3-2. CDC-ACM Settings with RTS and DTR
RTS DTR Action 0 0 Clear download mode flag 0 1 Set download mode flag 1 0 Reset ESP32-S3 1 1 No action
It is possible to configure whether or not the Arduino IDE Serial Monitor will assert the control signals when it opens the port of a given board:
I don't know whether PlatformIO has anything equivalent to that.
Thanks Much for the reply!
Platformio has flags to disable rts and dtr but for some reason they have zero effect on my setup. The same thing for Putty terminal. I was about ready to tug out the last remaining hair I have when a successfully gave CoolTerm a try which obviously has working rts/dtr controls.