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've been building an application based on The USB Async Example and have been debugging an issue where only the first packet gets responded to. The issue only arises when using the embedded_io_async Write trait after waiting on a signal. I'm able to reproduce this issue by modifying the example to call the async write-all instead of the regular synchronous version that the write! macro uses. Adding additional write_alls before the signal.wait work fine also.
The only modification is in the writer function. There seems to be some issue with the async write trait that the regular one isn't running into. However, I'm not sure yet why it's no longer responding. Seems like the reader never receives any more bytes after the write_all call but I haven't been able to nail down why yet.
Working Code
#[embassy_executor::task]asyncfnwriter(muttx:UsbSerialJtagTx<'static,Async>,signal:&'static Signal<NoopRawMutex, heapless::String<MAX_BUFFER_SIZE>>,){use core::fmt::Write;
embedded_io_async::Write::write_all(&mut tx,b"Hello async USB Serial JTAG. Type something.\r\n",).await.unwrap();loop{let message = signal.wait().await;
signal.reset();write!(&mut tx,"-- received '{}' --\r\n", message).unwrap();
embedded_io_async::Write::flush(&mut tx).await.unwrap();}}
Non Working Code
#[embassy_executor::task]asyncfnwriter(muttx:UsbSerialJtagTx<'static,Async>,signal:&'static Signal<NoopRawMutex, heapless::String<MAX_BUFFER_SIZE>>,){use core::fmt::Write;
embedded_io_async::Write::write_all(&mut tx,b"Hello async USB Serial JTAG. Type something.\r\n",).await.unwrap();loop{let message = signal.wait().await;
signal.reset();//write!(&mut tx, "-- received '{}' --\r\n", message).unwrap();
embedded_io_async::Write::write_all(&mut tx,b"Got Stuff").await.unwrap();
embedded_io_async::Write::flush(&mut tx).await.unwrap();}}
The text was updated successfully, but these errors were encountered:
Hardware
ESP32-S3-DevKitC-1 v1.1
Issue
I've been building an application based on The USB Async Example and have been debugging an issue where only the first packet gets responded to. The issue only arises when using the
embedded_io_async
Write trait after waiting on a signal. I'm able to reproduce this issue by modifying the example to call the async write-all instead of the regular synchronous version that thewrite!
macro uses. Adding additional write_alls before the signal.wait work fine also.The only modification is in the writer function. There seems to be some issue with the async write trait that the regular one isn't running into. However, I'm not sure yet why it's no longer responding. Seems like the reader never receives any more bytes after the write_all call but I haven't been able to nail down why yet.
Working Code
Non Working Code
The text was updated successfully, but these errors were encountered: