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

Marlin Color UI for STM32F1 (FSMC) #18952

Merged

Conversation

rhapsodyv
Copy link
Sponsor Member

@rhapsodyv rhapsodyv commented Aug 8, 2020

Description

Democratization of Marlin UIs!!

This is a port of the new Marlin Color UI for STM32F1. Currently FSMC support.

Added support for Chitu and MKS Robin Nano v1.

I will send more two separated PR in the next days. One for SPI (is almost complete) and other that will centralize all TFT IO/XPT for STM32F1: All FSMC and SPI UI will use (LVGL, emulated dogm, color UI).

Benefits

More users will be able to use the new Marlin Color UI.

Related Issues

IMG_9756

@rhapsodyv
Copy link
Sponsor Member Author

@thisiskeithb if you dont mind and have some time, can you test it in the nano v1.2? And do a M995 to calibrate the TFT, to send me the calibration values, so I can make fix the default values?
Thanks!

@thisiskeithb
Copy link
Member

@thisiskeithb if you dont mind and have some time, can you test it in the nano v1.2? And do a M995 to calibrate the TFT, to send me the calibration values, so I can make fix the default values?
Thanks!

Sure thing. I'm working on another project right now, but I should be able to get to testing this weekend.

@rhapsodyv
Copy link
Sponsor Member Author

Current bugfix-2.0x is failing the CI.

@thinkyhead thinkyhead merged commit ee69fb0 into MarlinFirmware:bugfix-2.0.x Aug 8, 2020
@Miraculix200
Copy link

Miraculix200 commented Aug 8, 2020

R0038828

Will do a calibration now, but I don't think it fixes this problem :)

These values worked with the standard touch UI:

// #define XPT2046_X_CALIBRATION 12013
// #define XPT2046_X_OFFSET -32
// #define XPT2046_Y_CALIBRATION -8711
// #define XPT2046_Y_OFFSET 256

But it doesn't react to touches with the Marlin Color UI

Edit: It doesn't react to touches when doing M995. Also tried with #define TOUCH_SCREEN commented out, but then it doesn't show the icons, so I guess it needs to be defined

@rhapsodyv
Copy link
Sponsor Member Author

WOW! The screen is mirrored! I will take a look about mirroring in the lcd init code.

In the pins_MKS_NANO_ROBIN.h, try defining all XPT2046 to 0, and try a calibration again.

@Miraculix200
Copy link

Miraculix200 commented Aug 8, 2020

I've commented out the XPT2046 defines in Configuration.h and changed those in pins_MKS_NANO_ROBIN.h to 0, but the touch screen still doesn't react to touch. Neither after booting nor after M995

@rhapsodyv
Copy link
Sponsor Member Author

@Miraculix200
Copy link

Miraculix200 commented Aug 8, 2020

@rhapsodyv I've changed the pins file like in the latest commit of your branch. Then the display doesn't start (shows the "Booting..." screen). Printer starts however, can be connected through USB.

I'll try with reset pin commented out. Just a random test

@rhapsodyv
Copy link
Sponsor Member Author

@rhapsodyv I've changed the pins file like in the latest commit of your branch. Then the display doesn't start (shows the "Booting..." screen). Printer starts however, can be connected through USB.

I'll try with reset pin commented out. Just a random test

Its the TFT_DRIVER I changed to auto. Try setting back to ILI9488 or ST7796 .

@Miraculix200
Copy link

Ok. Are you sure TOUCH_BUTTONS_HW_SPI is right? Because this is not an SPI display

@rhapsodyv
Copy link
Sponsor Member Author

Ok. Are you sure TOUCH_BUTTONS_HW_SPI is right? Because this is not an SPI display

Touch is SPI, almost always. Sometimes SW SPI, sometimes HW SPI.

@rhapsodyv
Copy link
Sponsor Member Author

I'm testing a Nano v2 now

@Miraculix200
Copy link

Still doesn't react to touch. I'll try ST7796

@rhapsodyv
Copy link
Sponsor Member Author

hahahah I found the problem!!!!
the last @thinkyhead commit removed a "return"!!

Just a moment.

@rhapsodyv
Copy link
Sponsor Member Author

Try my branch now. If touch works, we will fix the tft.

@Miraculix200
Copy link

Well, it's calibrating itself instead of waiting for me touching it. I'll try again, but I don't think that's right. It gets touch signals from somewhere else

@rhapsodyv
Copy link
Sponsor Member Author

Try this branch, I fixed the touch: #18958

@rhapsodyv
Copy link
Sponsor Member Author

Well, it's calibrating itself instead of waiting for me touching it. I'll try again, but I don't think that's right. It gets touch signals from somewhere else

Try put back it:

    #define TOUCH_BUTTONS_HW_SPI
    #define TOUCH_BUTTONS_HW_SPI_DEVICE      2

@Miraculix200
Copy link

Miraculix200 commented Aug 8, 2020

Oh I didn't see you changed it to device 1. I still got this: #define TFT_DRIVER ILI9488
#define TFT_BUFFER_SIZE 14400
#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 2

I'm not using your branch but looking at your commits and then changing my code. I'll try changing it to 1.

edit: nvm, was confusing it with robin nano v2

@rhapsodyv
Copy link
Sponsor Member Author

Ahhh remove that so.

remove it:

#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 2

In my branch I removed. I was trying things... but the problem was the missing return

@Miraculix200
Copy link

Recv: Touch screen calibration completed
Recv: TOUCH_CALIBRATION_X 18797
Recv: TOUCH_CALIBRATION_Y -11823
Recv: TOUCH_OFFSET_X -75
Recv: TOUCH_OFFSET_Y 344
Recv: TOUCH_ORIENTATION TOUCH_LANDSCAPE

@rhapsodyv
Copy link
Sponsor Member Author

Thanks! I will put it in the defaults.

Your TFT is mirrored yet?

@Miraculix200
Copy link

Yes, it's still mirrored.

But when it says "top left", I actually touch the top left corner, not the corner where the cursor is

@rhapsodyv
Copy link
Sponsor Member Author

Ok. Give some minute, I will update my branch with a test for the mirror issue.

@rhapsodyv
Copy link
Sponsor Member Author

@Miraculix200 try it now in the branch robin-nano-1-color-ui

@Miraculix200
Copy link

That sort of worked. But now it's upside down :D

@Miraculix200
Copy link

Actually it's now mirrored horizontally AND vertically

@rhapsodyv
Copy link
Sponsor Member Author

Just pushed the last one :-)

@Miraculix200
Copy link

Miraculix200 commented Aug 8, 2020

Now it's not mirrored anymore. Can be pushed

@rhapsodyv
Copy link
Sponsor Member Author

Check if the calibration values changed. I dont think, but is best to check

@Miraculix200
Copy link

Actually M995 doesn't work anymore now. Says "calibration failed" after touching the 4 corners. I'll compile it again with the values I found during the previous calibration

@rhapsodyv
Copy link
Sponsor Member Author

Actually M995 doesn't work anymore now. Says "calibration failed" after touching the 4 corners. I'll compile it again with the values I found during the previous calibration

Try with a pen. Its very sensible :-/

@Miraculix200
Copy link

Miraculix200 commented Aug 8, 2020

That worked. Got different values now:

Recv: TOUCH_CALIBRATION_X 17880
Recv: TOUCH_CALIBRATION_Y -12234
Recv: TOUCH_OFFSET_X -45
Recv: TOUCH_OFFSET_Y 349
Recv: TOUCH_ORIENTATION TOUCH_LANDSCAPE

And now my touch screen probably has Covid-19 :D

@rhapsodyv
Copy link
Sponsor Member Author

Thanks!!!

Speaka pushed a commit to Speaka/Marlin that referenced this pull request Aug 13, 2020
albertogg pushed a commit to albertogg/Marlin that referenced this pull request Aug 31, 2020
@rhapsodyv rhapsodyv mentioned this pull request Sep 24, 2020
30 tasks
@rhapsodyv rhapsodyv deleted the new-marlin-ui-stm32f1-fsmc branch October 25, 2020 00:27
vgadreau pushed a commit to vgadreau/Marlin that referenced this pull request Dec 9, 2020
kageurufu pushed a commit to CR30-Users/Marlin-CR30 that referenced this pull request Apr 30, 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.

4 participants