You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing some program that communicates over serial with the desktop (I'm using a Mac). I don't have access to the desktop code.
It's a simple protocol where the deskop sends short packets to the device, and it responds.
When I used uart serial (with no logs) everything seemed to worked fine. At that time I didn't use logging.
Then I switched the code to use jtag and used uart for esp-println logging.
That caused things to stop working as good.
The first sequence of communication didn't work (desktop sent, device responded, desktop responded with an error, not sure if because it did not receive the data or because device didn't receive or didn't respond).
But second sequence starting again worked.
And after reset to the device it started with the problems again.
I then noticed that when I added logs (over uart) things got fixed again.
I tried replacing that log with a delay, and it didn't have the same effect.
So I wonder if there is any kind of interaction between the uart and jtag that could cause that?
To show how println! makes things work, the below code is a working situation. (rx is on jtag and println is going to uart)
if I remove the println, things misbehave.
if I change the println to print (even if adding more characters) things misbehave as if the newline makes a difference.
If I change the println to print("\n") things is working again. again, as if the newline makes the difference.
really strange
let mut first_time = true;
loop {
let r = embedded_io_async::Read::read(&mut rx, &mut temp_buf).await;
if first_time {
esp_println::println!("");
first_time = false;
}
.
.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm writing some program that communicates over serial with the desktop (I'm using a Mac). I don't have access to the desktop code.
It's a simple protocol where the deskop sends short packets to the device, and it responds.
When I used uart serial (with no logs) everything seemed to worked fine. At that time I didn't use logging.
Then I switched the code to use jtag and used uart for esp-println logging.
That caused things to stop working as good.
The first sequence of communication didn't work (desktop sent, device responded, desktop responded with an error, not sure if because it did not receive the data or because device didn't receive or didn't respond).
But second sequence starting again worked.
And after reset to the device it started with the problems again.
I then noticed that when I added logs (over uart) things got fixed again.
I tried replacing that log with a delay, and it didn't have the same effect.
To show how
println!
makes things work, the below code is a working situation. (rx is onjtag
and println is going touart
)if I remove the
println
, things misbehave.if I change the
println
toprint
(even if adding more characters) things misbehave as if the newline makes a difference.If I change the
println
toprint("\n")
things is working again. again, as if the newline makes the difference.really strange
Beta Was this translation helpful? Give feedback.
All reactions