-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Serial.end() not reattaching pin to GPIO matrix #3205
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
@luketanti after using Chuck. |
Yes, offcourse. Here are two snippets. The first one is when the issue occurs and the second is how I managed to get the pin to respond to digitalWrite commands.
|
Did you try gpio_reset(K_TX); instead of gpio_matrix_out? |
I have tried to compile with gpio_reset(K_TX); but it failed.
Shouldn't Serial.end() automatically release the pins allocated to other use? |
Sorry that should have been gpio_reset_pin. And yes I'd think that Serial.end() should release the pin to normal/default state. I believe there was an older issue for the same. |
Yes, I can confirm that it also works.
Can this line be added to the UART HAL? |
@luketanti send in a PR that does this for both RX and TX in the esp32-hal-uart.c file in the uartEnd() method and I'm sure @me-no-dev will consider it. |
huh? this is rather really strange. this is already called in |
|
@me-no-dev my 2 cents: The only difference I see between I2C(working) and UART de-init is a call to Has anyone other than the OP validated this behavior? That is why I asked my silly question above. Chuck. |
@luketanti do you call Chuck. |
flush blocks untill uart's FSM is idle. |
@bertmelis yep, that is its purpose. I believe reconfiguring UART should not happen until it is idle. |
[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. |
This is still an issue on Pin16 (U2RX) on ESP-CAM using Arduino 1.0.4. |
After trying to switch back two UART pins to GPIO by using the Serial.end() function, the pins do not respond to digitalWrite commands.
I have found out that by using
gpio_matrix_out(gpio_number, SIG_GPIO_OUT_IDX, false, false);
I am able to use the pin again after ending the Serial.The text was updated successfully, but these errors were encountered: