-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP8266 resets when serial monitor is opened via a FT232 USB UART Board #1539
Comments
I have read your post a couple of times but I can't make sense of it. |
Sorry for my unclear description. With "opened" I mean as long as I do not open the serial monitor functionality in Sloeber, the DTR and RTS pins of the FT232 USB UART Board connected to the ESP8266 chip are not activated (high level) and so, the ESP8266 is normal operating. Once when I open the serial monitor to see the output of the EPS8266, these pins get activated (low level) and the ESP8266 is kept in the reset mode. The problem is that I can't use the serial monitor of Sloeber because my hardware has a FTDI chip as USB-serial interface and Sloeber is activating the ESP8266 reset when I open the serial monitor. The difference with #394 is that once when I have an ESP8266 NodeMCU panel connected, Sloeber controls the DTR and RTS lines correctly and what I understand, this is not in problem description #394. It looks like Sloeber does not correctly control the serial port for different types of USB-serial hardware. At the moment, as work around, I use Sloeber to design and check my code and Arduino IDE to compile, upload and see the serial monitor. Thanks for your great Sloeber design, a huge improvement compared to the Arduino IDE. |
I'm still not fully understanding but I think this is about a physical board connecting the pc with a board (named FT232 USB UART Board) not having a serial interface.
3 is the best solution to me as then at least I know what to change. Do you see this as feasible? |
I found the root cause of the problem. Sloeber supports only ESP hardware as implemented in the commercial NodeMCU boards. More in depth. In attached figure 'nodemcu-circuit-diagram.jpg' you see that the DRT and RTS pins of USB-serial interface U2 via two transistors VT1 and VT2 are connected to the EPS-RST and EPS-GPIO0. This circuitry is more or less a XOR configuration, see the small table in that diagram just above this circuitry. Without serious knowledge of electronics it is hard to understand what's going on so I made a timing diagram 'ESP_reset.jpg' where you can see the relation between the logic levels of RTS and DTR coming out of the USB interface U2 and the levels of RST and GPIO0 going to the EPS8266. Explanation of the timing diagram. What's going wrong with Sloeber connected to my design.
This piece of software 'accidentally' works in a NodeMCU because looking to the timing diagram you can see that the first instruction puts DTR HIGH while RTS is LOW. This generates a reset to the EPS. Then it sets RTS HIGH resulting in releasing both, the ESP_RST and ESP_GP0. Hereafter DTR LOW resulting in a low level to ESP_GP0 and as last RTS LOW what results that both, ESP_RTS and ESP_GP0 are high again. Recommendations for ESP8266 support in Sloeber. Why is my proposal working for both hardware setups (commercial NodeMCU boards and ESP designs with directly connected RTS and DTR lines). My test bench with the proposals. public class MainEntry {
} /////////////////////////////////// |
I'm impressed with your skills. 👍 I have heard of the capacitor on the reset line in Arduino world as a "must have". Not sure why I write this; maybe because that is the only thing that popped into my mind. Here is one of the many pages on this issue on the internet. Anyway:
The reset in serial is the reset used by the serial monitor. The reset for upload (see next point) is here
What do you mean with " the serial download mode"? Are you talking about what is called upload in Arduino world? arduino-eclipse-plugin/io.sloeber.core/src/io/sloeber/core/tools/uploaders/UploadSketchWrapper.java Line 232 in 276915d
The actual upload command is run in the OS environment a bit further in the code arduino-eclipse-plugin/io.sloeber.core/src/io/sloeber/core/tools/uploaders/UploadSketchWrapper.java Line 253 in 276915d
I'm all confused here. I thought the problem was related to Serial monitor and the code change is in reset and "serial download mode" none of these are used in the serial monitor.
No Sloeber does not do so and I do not want Sloeber to do so. |
My problem is that I do not have any Arduino experience. This morning I had a quick scan on the internet and when I understand well, the base of Arduino is an Atmel micro controller chip and for firmware upload they use a dedicated chip like the ATMEGA16U2 as used in Arduino UNO Rev3 design (see attachment). The Arduino firmware upload is different compared to the EPS firmware upload. That explains to me why I see 'remarkable code' regarding how Sloeber is interfacing the ESP. I don't know the total architecture of Sloeber. That's why I can't say what you need to change because an 'improvement here' can generate ‘a bug elsewhere’.
Sorry to say but as far as I can see, that is completely different.
You are right. General speaking is ‘upload’ but I read different usages especially from Chinese origin. That's why I'm not sure which word to use.
As previous written, until now upload to EPS works OK but because I have seen doubtful interfacing code regarding ESP, it can be wise to review again how you enter the upload mode of the ESP.
I don't know if and when you call the serial.reset() method but that piece of code is not valid for ESP.
No problem for me as long as the Restart button of the serial monitor works correctly. |
We all have problem and bad life choices. 😉 Nothing to be ashamed about. As you will have found out by now pi and Arduino are far from the same thing.
That is how it all started but now there is a ton of hardware that is in the Arduino world. Arduino made a framework to support their set of ARM chip based boards. Over time that framework was extended to support other chips. (Teensy from Paul Stoffregen has played a big role here. )
The Sloeber behaviour should be the same as the Arduino IDE behaviour. And as explained above: the Arduino behaviour is based on a "board" not a chip.
Indeed. I have plenty of tests to test compile and I have some boards that I use to test upload. However serial monitor testing is not easy and It all boils down to manual tests. Thanks for understanding.
Given above "you are right". I will look into it.
While investigating I found that the setDTR and setRST simply are not taken into account.
I would expect so but .... I'm not a java programmer 👶 |
Let's wait and see. |
Thanks |
The tests for #1541 are currently running. |
DTR and RTS pins are set to GND as long as the serial monitor is opened via a FT232 USB UART Board regardless the checkbox setting in the 'add serial port' dialog window.
Programming the EPS8266 via this FT232 USB UART Board works perfectly.
An official NodeMCU EPS8266 board with USB-UART included, does not show this problem.
The serial monitor of the Arduino IDE does not have this problem.
Used setup is the installation of Sloeber V4.4.1_win64.2022-09-05_06-48-31.zip on a Windows 10 and Windows 11 PC.
This problem is very similar as mentioned in reported issue 'ESP8266 resets when serial monitor is opened #394'
The text was updated successfully, but these errors were encountered: