-
Notifications
You must be signed in to change notification settings - Fork 226
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
Fix LCD_CAM i8080 potentially sending garbage data to display #1301
Fix LCD_CAM i8080 potentially sending garbage data to display #1301
Conversation
I don't understand what's going on. |
I'm not 100% sure what's happening here, I think it may be a regression in It was building yesterday and nothing in the repo has changed since then. I re-ran CI on the With that said, it's Saturday morning and I'm not sure how deep I'll dig into this right now. 😅 I will spend at least a few minutes investigating today and update you if I do find anything, but otherwise this will likely have to wait until Monday. Sorry for the inconvenience, unfortunately this is the price we pay for living on the bleeding edge 😁 |
From my perspective this can easily wait, enjoy the weekend. |
Just to add some additional information from my (brief) investigation: I ran cargo-expand with all the required arguments on one of the failing examples, in this case $ cd examples/
$ cargo expand --features=esp32c2,async,embassy,embassy-executor-thread,embassy-time-timg0,embassy-generic-timers --target=riscv32imc-unknown-none-elf --bin=embassy_serial From the resulting output, we'll look at this excerpt: #[doc(hidden)]
async fn __writer_task(
mut tx: UartTx<'static, UART0>,
signal: &'static Signal<NoopRawMutex, usize>,
) {
use core::fmt::Write;
embedded_io_async::Write::write(
&mut tx,
b"Hello async serial. Enter something ended with EOT (CTRL-D).\r\n",
)
.await
.unwrap();
embedded_io_async::Write::flush(&mut tx).await.unwrap();
loop {
let bytes_read = signal.wait().await;
signal.reset();
(&mut tx)
.write_fmt(format_args!("\r\n-- received {0} bytes --\r\n", bytes_read))
.unwrap();
embedded_io_async::Write::flush(&mut tx).await.unwrap();
}
}
fn writer(
tx: UartTx<'static, UART0>,
signal: &'static Signal<NoopRawMutex, usize>,
) -> ::embassy_executor::SpawnToken<impl Sized> {
type Fut = impl ::core::future::Future + 'static;
const POOL_SIZE: usize = 1;
static POOL: ::embassy_executor::raw::TaskPool<Fut, POOL_SIZE> = ::embassy_executor::raw::TaskPool::new();
unsafe { POOL._spawn_async_fn(move || __writer_task(tx, signal)) }
} The first of our two build errors for this example (they're both the same root issue):
So, as far as I can tell (this is sort of a guess at this point), it's upset with |
@Dominaezzz : I added the delay to fix the garbage data sent sometimes to the display. It fixed the issues for my app. Basically a single line of code. Anyway, @bjoernQ asked that someone tests this change to work (or I guess at least doesn't break the example or anything else) since he doesn't have a compatible device to test with. Can you help by testing this so it can be merged? Thanks |
Hello! I'll have some time later this week to run the example again on this PR. |
Sorry for the delays with fixing CI, if you rebase CI should be green now. Also just FYI, @JurajSadel and/or @playfulFence will attempt to hunt down a devkit with an appropriate display to keep in the office, so that we can hopefully test this functionality in the future. |
Just ran the example and it still works the same for me. |
@yanshay Really sorry for the huge delay here. I think we will need another rebase to get the "HIL Test" steps pass |
esp-hal/CHANGELOG.md
Outdated
- Fixed LCD_CAM i8080 potentially sending garbage to display (#1301) | ||
- ESP32: Apply fix for Errata 3.6 in all the places necessary. (#1315) | ||
- ESP32 & ESP32-S2: Fix I²C frequency (#1306) | ||
- Fixed LCD_CAM i8080 potentially sending garbage to display (#1301) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this line insists on duplicating itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebased, it went strange (but then I'm not a git expert), and now I see it doesn't compile in the build. Maybe I did something wrong.
But then I tried taking main and building the i8080 example and It doesn't compile either on my machine, so maybe it's not me but rather something that changed on the main branch?
I could try fixing the example but I don't want to make a mess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried compile the example on current main and it compiled fine for me 🤔
ac3187a
to
fd4f559
Compare
I redid the change from scratch based on main, tested, now it seems to be fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, this took so long to get merged! Thanks! |
LCD_CAM i8080 sometime outputs garbage to the display.
This is due to a race condition when LCD_CAM starts sending data to display before the DMA had time to get data to the FIFO. The solution is quite simple, adding a short delay (delay based on what's used in esp-idf) between starting the DMA and activating LCD_CAM send.
For more info - #1086 (comment)
Thank you!
Thank you for your contribution.
Please make sure that your submission includes the following:
Must
errors
orwarnings
.cargo fmt
was run.CHANGELOG.md
in the proper section.Nice to have