Closed sajattack closed 4 years ago
Thank you @sajattack ! I'm also not having much time lately. But I will try to get into this when I have some time.
@sajattack It should be working now. I made a basic mistake of forgetting to include #![no_std]
to the lvgl-sys crate. Please try again and let me know.
Btw, we still need the flag -Zfeatures=build_dep
to build.
That should be not needed after https://github.com/rust-lang/cargo/issues/7915 is fixed.
Needs alloc?
error: no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait.
Yes, we need alloc. You can find how to setup an allocator here: https://github.com/rafaelcaricio/pinetime-rtfm/blob/master/pinetime-rtfm/src/main.rs#L37 I will publish later a simplified example of how to do this.
Ok, just not very #![no_std]
friendly to have alloc.
Well, LittlevGL do allocate memory dynamically. So there is not really a workaround for that.
@sajattack I have updated the README with the points we discussed in this thread so others are aware. https://github.com/rafaelcaricio/lvgl-rs#building-for-embedded-environments
Please let me know if we can close this issue. Also, you are welcome to amend the README.md with any other info you think would be important to know. I really appreciate you help and interest in this project.
I'm testing now. Currently getting a display full of static, is there a method I need to call to flush lvgl to the display?
You need to call those two methods:
ui.tick_inc(Duration::from_millis(5));
ui.task_handler();
So LittlevGL will load the framebuffer and flush to the display. https://docs.lvgl.io/v7/en/html/porting/project.html#initialization
Sorry, it's not working for me and I don't have time to debug.
Ok, no worries. I will update the readme with some step-by-step so it is easier for everyone (including me).
As the main concern in this ticket is solved, I will close. Please open a new ticket for further questions.
@sajattack About your concern on the dependency on alloc
, maybe this idea would make lvgl-rs
flexible enough: https://github.com/rafaelcaricio/lvgl-rs/issues/16
So currently, this crate has only been tested in the embedded-graphics simulator. I have encountered two problems compiling for an embedded target:
I'm happy to contribute to get this to work but I'm a little bit stumped. I thought I should at least document it here in case anyone else can figure it out. I look forward to using this crate in the future.