-
Notifications
You must be signed in to change notification settings - Fork 7.6k
serial.end() doesn't work #3878
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
Comments
@lbernstone do you have any idea about what can cause this behaviour? |
Turn on verbose debugging so you can see if any errors are shown. |
One more ticket related to this issue: |
@lbernstone looks like you solved it 😁 At first, I tried as you suggested to put big delays, then slowly I removed all of them and no problem showed up in about 5 minutes running this sketch #include <Arduino.h>
#define TX_PIN 17
void setup(){}
void loop()
{
pinMode(TX_PIN, OUTPUT);
digitalWrite(TX_PIN, HIGH);
delay(50);
digitalWrite(TX_PIN, LOW);
delay(1000);
digitalWrite(TX_PIN, HIGH);
Serial2.begin(9600);
for (uint8_t n = 1; n < 5; n++)
{
Serial2.write(n);
delay(50);
}
Serial2.end();
gpio_matrix_out(TX_PIN, 0x100, false, false);
} Also, note that after the I think it is an easy fix if the maintainers need I can make a PR @me-no-dev just tell me if the arduino-esp32/cores/esp32/HardwareSerial.cpp Lines 82 to 89 in 0f77227
And to make it error-proof I would add _txPin to the protected variables of the HardwareSerial class, and finally add here_txPin = txPin;
Here the LA log: |
The gpio_matrix disconnect is already buried in the end method. It just isn't working for some reason. I'll see if I can track down where it is dropping the ball. |
Saw that you are interested in a flutter app to standardize access to BT wearables - did you get anywhere. I also find this interesting and would contribute. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Issue solved with PR #5385 |
Description:
Serial.end()
should free the serial pins and leave the user the ability to dodigitalWrite()
on them, but it doesn't work. Instead to drive the TX pin to a LOW state i need to reset the board.I tested the code below with the following cores:
I also made three logic analyzer captures: la.zip
An example from one of these, as you can see it shows that the pin is driven low only once (after upload of the code or reset)
Sketch:
NOTE: looks like that the problem was here before #3713 and #3664
The text was updated successfully, but these errors were encountered: