Particle + LVGL Sample

Hi everyone,
I spent some time testing LVGL with Particle devices and got a sample working. I hope the repository can be useful for anyone trying to create complex UIs with a Particle device.

4 Likes

oh, that looks nice!
Did you get any cool widget as well as text?

Thank you! & I only tested the Arc widget, but it seemed to work well with the following code:

  lv_display_t *disp;
  disp = lv_display_create(HOR_RES, VER_RES);
  lv_display_set_flush_cb(disp, my_disp_flush);
  lv_display_set_buffers(disp, draw_buf, NULL, sizeof(draw_buf), LV_DISPLAY_RENDER_MODE_PARTIAL);

  static lv_subject_t value;
  lv_subject_init_int(&value, 50);

  lv_obj_t *arc = lv_arc_create(lv_screen_active());
  lv_obj_set_size(arc, 100, 100);
  lv_obj_center(arc);
  lv_arc_bind_value(arc, &value);

Good to know, what is the display you are using? Thanks

In this case it's the Adafruit SSD1680 E-Ink featherwing but it should be easily adaptable to other displays

1 Like

Great to see you use lvgl on Particle!

I've cloned your repo, but the project does not compile on Windows 10. Any suggestions?

Hi @bg4 can you describe the errors you're seeing?

@ericpietrowicz - Thanks for your response - I've "progressed" in my troubleshooting:

All my projects are Boron targets for deviceOS 6.1.1, with lv_conf.h within lib\lvgl folder.

  1. I switched to my linux machine, and your project compiles (local) with no issues.
  2. In a new project on same linux machine, I local compiled with your lvgl folder and it completes as expected.
  3. In a new project on the same linux machine, I cannot local compile an empty project with lvgl 9.3.0 zipped from lvgl repo. I found your magic edit: change line 60 in lib\lvgl\src\lv_conf_internal.h to #include "../lv_conf.h" from #include "../../lv_conf.h". With this change I can compile successfully.
  4. In your project on Windows, this is my error:

Creating c:/Users/myuser/Documents/particle_projects/particle-lvgl-eink-example/target/6.1.1/boron/platform_user_ram.ld ...
/bin/bash: C:/Users/myuser/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-gcc-ar: Argument list too long
make[4]: *** [../build/module.mk:238: ../build/target/user/platform-13-m/particle-lvgl-eink-example/libuser.a] Error 126
make[3]: *** [../../../build/recurse.mk:12: user] Error 2
make[2]: *** [makefile:51: /cygdrive/c/Users/myuser/.particle/toolchains/deviceOS/6.1.1/modules/boron/user-part/makefile] Error
2
make[1]: *** [C:/Users/myuser/.particle/toolchains/buildscripts/1.16.0/Makefile:156: make-modules] Error 2
make: *** [C:/Users/myuser/.particle/toolchains/buildscripts/1.16.0/Makefile:100: compile-all] Error 2

I did not do a full diff on your lvgl folder versus the lvgl repo one, but I did manually look and found some differences. Can you describe additional changes to the lvgl folder/files?

The import path for lv_conf.h was the only change I made to the stock LVGL library.

The error you're getting seems to be a limitation with Windows. Here is a description of the Argument list too long error:

This issue often arises in projects with a large number of source files, overly long paths, or excessive arguments passed to the compiler. It's a common issue on systems with limited argument list length, particularly on Windows when using tools designed for UNIX-like environments.

Searching the forums for Argument list too long error shows this being a problem for other projects with large imports.

Are you able to continue your development on a Linux machine? That might be the easiest solution.

Thanks for the updates! I think I will just use the linux development machine for these projects.

For anyone else brave enough to change their Windows machines to solve the
"Argument list too long"

Related to the Argument list too long message on Windows, Particle suggests to use Docker. As I don't have a Linux machine (apart from some RPi's) I've needed to use Docker in some cases. In the end it wasn't too difficult to set up.