Skip to content
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

Add MKS UI option (TFT_LITTLE_VGL_UI) #18071

Merged
merged 29 commits into from
Jun 16, 2020

Conversation

makerbase-mks
Copy link
Contributor

@makerbase-mks makerbase-mks commented May 22, 2020

Add LVGL GUI library for MKS Robin Nano.

@thisiskeithb
Copy link
Member

thisiskeithb commented May 22, 2020

LVGL looks promising. I'll be able to test this on a Robin Nano 1.2 once it passes checks 🙂

@thinkyhead thinkyhead changed the title Bugfix 2.0.x Add MKS UI option (TFT_LITTLE_VGL_UI) May 22, 2020
@vivian-ng
Copy link
Contributor

This looks interesting, especially if it can be used with any of the displays and microcontrollers supported by LVGL. I had been hoping that Marlin would support ILI9341 displays for a while.

@hobiseven
Copy link

Gosh, seems we are quite a few to have LVGL running on our printers!!!
I also have my flavour of the port for STM32F103 on alfawise.

@hobiseven
Copy link

hobiseven commented May 27, 2020

Hmm, this is SPI based, right?
On the STM32F103, for Alfawise, we have it going through FSMC / 16 bit parallel, with DMA in background mode. So likely to be a lot more responsive.

@hobiseven
Copy link

hobiseven commented May 27, 2020

@vivian-ng And, yes, our alfawise flavour is since a while using ili9341
IMG_1702 jpg 2878a786f88dc99978ec135913587ea4

@makerbase-mks
Copy link
Contributor Author

@hobiseven ,we have implemented LVGL in both SPI interface and FSMC interface.

@looxonline
Copy link
Contributor

FSMC

Do any motherboards provide a breakout for the FSMC interface?

@hobiseven
Copy link

@makerbase-mks
Went on the facebook pages, to find one picture of LVGL gui. Can you share more pictures please?

@thinkyhead
Copy link
Member

Did some cleanup. A few more hours of code cleanup will be needed.

@vivian-ng
Copy link
Contributor

@makerbase-mks Is this implementation generic? Such that I can test it by defining TFT_LITTLE_VGL_UI or SPI_GRAPHICAL_TFT in Configuration.h, then the relevant pins in the pins file? Hoping to give it a try because I don't see any HAL-specific files being changed.

@thinkyhead thinkyhead merged commit 642112d into MarlinFirmware:bugfix-2.0.x Jun 16, 2020
@rhapsodyv
Copy link
Member

rhapsodyv commented Jun 17, 2020

Marlin/src/HAL/STM32F1/../../inc/SanityCheck.h:691:4: error: #error "CUSTOM_STATUS_SCREEN_IMAGE requires a Graphical LCD."
   #error "CUSTOM_STATUS_SCREEN_IMAGE requires a Graphical LCD."

Do Conditionals_LCD.h needs update? Or am I doing something wrong?

I just changed from FSMC_GRAPHICAL_TFT to TFT_LITTLE_VGL_UI/SPI_GRAPHICAL_TFT, and it won't compile because of the graphical related defines I did.

@rhapsodyv
Copy link
Member

Even disable all the graphical "dependent" features, I can't compile it. Now there're references to a folder that doesn't exist.

Or am I doing something wrong?

@Stephane-Peel
Copy link

I just changed from FSMC_GRAPHICAL_TFT to TFT_LITTLE_VGL_UI/SPI_GRAPHICAL_TFT, and it won't compile because of the graphical related defines I did.

The same for me...

@rhapsodyv
Copy link
Member

@makerbase-mks @thinkyhead

@thinkyhead
Copy link
Member

thinkyhead commented Jun 24, 2020

For a PR of this size and complexity, I prefer to leave it to the contributor to be the maintainer. We don't like to go on safaris to find bugs, so if there's some obvious typo causing a compile error, someone should drop us a set of Configuration files so we can just drop them into Marlin and compile to see the same error you see. Maybe it's easy to fix.

@thisiskeithb
Copy link
Member

Here's a ready-to-build branch to view said errors.

I just put in PR #18401 to address the file include errors, but there are others that I'm unsure how to resolve (see PR for details).

@rhapsodyv
Copy link
Member

I could get it compiling. But I got linker errors too.
And some fixes really points to missing things...
So, I decided to ask to thinkyhead and the author first.
Or at least someone that have this screen to test. I don’t have one.

@thisiskeithb
Copy link
Member

I have a Robin Nano with TFT35 combo this LVGL PR is meant to run so I can easily test working code, but I couldn’t get it to compile before or after fixing the includes (again, see my PR for details).

Here’s the error output from the linked PR:

Log Output
Compiling .pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/printer_opration.cpp.o
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_about.cpp.o] Error 1
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_change_speed.cpp.o] Error 1
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_error_message.cpp.o] Error 1
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_dialog.cpp.o] Error 1
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp.o] Error 1
In file included from Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h:48:0,
                 from Marlin/src/lcd/extui/lib/mks_ui/draw_opration.cpp:27:
Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h:28:41: error: variable or field 'lv_draw_error_message' declared void
 extern void lv_draw_error_message(PGM_P const msg);
                                         ^~~~~
Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h:28:35: error: 'PGM_P' was not declared in this scope
 extern void lv_draw_error_message(PGM_P const msg);
                                   ^~~~~
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_language.cpp.o] Error 1
In file included from Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h:48:0,
                 from Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp:27:
Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h:28:41: error: variable or field 'lv_draw_error_message' declared void
 extern void lv_draw_error_message(PGM_P const msg);
                                         ^~~~~
Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h:28:35: error: 'PGM_P' was not declared in this scope
 extern void lv_draw_error_message(PGM_P const msg);
                                   ^~~~~
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_opration.cpp.o] Error 1
In file included from Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h:48:0,
                 from Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp:27:
Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h:28:41: error: variable or field 'lv_draw_error_message' declared void
 extern void lv_draw_error_message(PGM_P const msg);
                                         ^~~~~
Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h:28:35: error: 'PGM_P' was not declared in this scope
 extern void lv_draw_error_message(PGM_P const msg);
                                   ^~~~~
In file included from Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h:48:0,
                 from Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp:36:
Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h:28:41: error: variable or field 'lv_draw_error_message' declared void
 extern void lv_draw_error_message(PGM_P const msg);
                                         ^~~~~
Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h:28:35: error: 'PGM_P' was not declared in this scope
 extern void lv_draw_error_message(PGM_P const msg);
                                   ^~~~~
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp.o] Error 1
In file included from Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h:48:0,
                 from Marlin/src/lcd/extui/lib/mks_ui/draw_tool.cpp:27:
Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h:28:41: error: variable or field 'lv_draw_error_message' declared void
 extern void lv_draw_error_message(PGM_P const msg);
                                         ^~~~~
Marlin/src/lcd/extui/lib/mks_ui/draw_error_message.h:28:35: error: 'PGM_P' was not declared in this scope
 extern void lv_draw_error_message(PGM_P const msg);
                                   ^~~~~
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_printing.cpp.o] Error 1
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp.o] Error 1
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_tool.cpp.o] Error 1
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp:49:1: error: 'CFG_ITMES' does not name a type
 CFG_ITMES gCfgItems;
 ^~~~~~~~~
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp:50:1: error: 'UI_CFG' does not name a type
 UI_CFG uiCfg;
 ^~~~~~
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp:51:1: error: 'DISP_STATE_STACK' does not name a type; did you mean 'SPI_STATE_READY'?
 DISP_STATE_STACK disp_state_stack;
 ^~~~~~~~~~~~~~~~
 SPI_STATE_READY
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp:52:1: error: 'DISP_STATE' does not name a type; did you mean 'LS_DATE'?
 DISP_STATE disp_state = MAIN_UI;
 ^~~~~~~~~~
 LS_DATE
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp:53:1: error: 'DISP_STATE' does not name a type; did you mean 'LS_DATE'?
 DISP_STATE last_disp_state;
 ^~~~~~~~~~
 LS_DATE
compilation terminated due to -fmax-errors=5.
*** [.pio/build/mks_robin_nano35/src/src/lcd/extui/lib/mks_ui/draw_ui.cpp.o] Error 1

@rhapsodyv
Copy link
Member

@thisiskeithb great. I will push my branch so you can test. Reach me in marlin discord, if you want. rhapsodyv

rhapsodyv added a commit to rhapsodyv/Marlin that referenced this pull request Jun 24, 2020
jmp0x0000 pushed a commit to jmp0x0000/Marlin that referenced this pull request Aug 7, 2020
HairingX pushed a commit to HairingX/Marlin that referenced this pull request Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants