Closed NE4Y closed 9 months ago
I'm having exactly the same issue with an even simpler setup:
use std::{thread, time::Duration};
use embedded_graphics::{
geometry::Point,
primitives::{Line, PrimitiveStyle, StyledDrawable},
};
use epd_waveshare::{color::Color, epd7in5_v2::Display7in5};
use log::info;
fn main() -> anyhow::Result<()> {
esp_idf_svc::sys::link_patches();
esp_idf_svc::log::EspLogger::initialize_default();
info!("Init complete");
let mut display = Display7in5::default();
Line::new(Point::new(0, 0), Point::new(1, 1))
.draw_styled(&PrimitiveStyle::with_stroke(Color::Black, 3), &mut display)?;
loop {
info!("Done!");
thread::sleep(Duration::from_secs(1));
}
}
If I comment out the draw call, everything works as expected, but even Init complete
isn't being printed when trying to draw.
After some digging and asking around, I've found the answer. The epd7in5_v2::Display7in5
struct size is 800*480=375KB + some additional fields and vtable. It's way too big to live on stack, so it must be put on heap:
let mut display = Box::new(Display7in5::default());
Oh wow, of course. I haven't thought about that. Now it works! Thanks!
@bemyak Did you find a way to speed up the update time of the screen? If flickers for like 20 seconds when updating data (update_color_frame) which is somewhat unsatisfying. Do you know if there is a way to transmit the data (without the flickering) and then update the display quickly?
That's just how the color displays are. The spec says that the full update time is 26s, I don't think there are any workarounds, at least not through the SPI. Maybe if you connect directly to it through 24 pin bus, you'll be able to find some shortcuts.
That's the main reason why I chose the B&W one :)
It would be actually nice, if this library would take care of that, or at least have some comment to give users a hint how to use it
Hi all,
im currently trying to connect a Waveshare 7.5 (B) v3 e ink display (https://www.waveshare.com/product/7.5inch-e-paper-hat-b.htm) to an esp32.
I'm using the master branch of the epd-waveshare repo.
The problem is, as soon as i call
update_and_display_frame
, the program stops at callingapp_main()
(without printing the firstStart
).My rust code:
If i remove
epd.update_and_display_frame(&mut driver, display.buffer(), &mut delay)?;
i get both prints.Any idea whats going on? I also tried v0.5.0 but got the same results.
Cargo.toml