MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.18k stars 19.21k forks source link

[BUG] ILI9328 TFT No longer functions MKS Robin #16159

Closed sakza closed 4 years ago

sakza commented 4 years ago

Uncertain which update caused the display to stop functioning, however an older MKS Robin only build also no longer works, which makes me suspicious of some sort of platformio update that has broken support for the ILI9328 based TFT1.1 display/touchscreen present on the MKS Robin. Backlight etc seems to function, as well as the touch buttons (when pressing the screen near where the buttons should display produces the click sound). Uncommenting the reset pin line present in the pins_MKS_robin.h file causes the screen to be 100% white, while leaving it commented nothing is displayed past the booting... message, which is generated by the bootloader and not Marlin.

This issue is generated with a fresh clone of the current Marlin 2.0 repository as of 2019-12-08, compiled with platformio and vscode, windows 10.

Unfortunately my knowledge of these components runs out about there, and I have no idea how to find the potential update/culprit responsible for the display not generating an image.

Thanks!

sakza commented 4 years ago

Configuration.txt

Configuration.h is attached, however I don't believe it is likely a configuration issue as a previously working build no longer functions without config.h changes

boelle commented 4 years ago

tried to do an update all in vscode? what if using arduino ide 1.9 beta (if that can be used)

image

sakza commented 4 years ago

PIO Update all didn't make any difference - I've compiled it on Debian too with no luck hence I don't believe it's my environment causing the issue

tpruvot commented 4 years ago

I don't think there is a difference between the 1.1 and the 2.0 except for the touchscreen orientation.

the TFT 2.0 which is a ILI9328 is currently ok with the Robin v2.4 (16 dec. build)... with the sample config

tpruvot commented 4 years ago

rmm, now ive a doubt if its a ILI9328 or a ST7789V ... erk i need to double check

try to comment LCD_USE_DMA_FSMC in Marlin/src/pins/stm32/pins_MKS_ROBIN.h

yep ST7789V : cf #15532

Maybe the ILI9328 is not supported at all, cf the comment i made in #15675 when i was tracing the code. Sorry i reversed the 2 refs in my head.

I dont have this tft... but ive some code related to that on my repo : https://github.com/tpruvot/Marlin/blob/master/Marlin/src/feature/touch/ili9328.cpp

tpruvot commented 4 years ago

so title is incorrect, ILI9328 was never supported in Marlin, only in MKS repo

sakza commented 4 years ago

Ah, good point - any idea how straightforward it would be to implement? I'll give it a crack regardless and hopefully I'll make some progress

jmz52 commented 4 years ago

ili9328 is quite different from from st7789 and ili9341 Main problem is init sequence that requires 16-bit values while U8g only works with 8-bit U8G_ESC sequences. There is an 11 months old code that supports ili9328 via custom 16-bit escape sequences - MKS-Robin-Touch-POC Implementation details can be found in this commit - https://github.com/jmz52/Marlin/commit/0cc2feec66ca6886251260299e07c6c6ca2fd0c9

Also touch screen calibration tool was updated at about the same time to support ili9328. Compiled firmware to be used with vendor's bootloader - Touch_Screen_Calibration

jmz52 commented 4 years ago

Calibration data for MKS Robin TFT 1.1 (ili9328) are in commented section of config/examples/Mks/Robin/Configuration.h /* MKS Robin TFT v1.1 */

Data source: https://imgur.com/a/pRdGEVa

jmz52 commented 4 years ago

@sakza I've pieced together some code for ili9328 but I have no hardware to test it. Could you please check if this code works for your MKS Robin TFT v1.1 ? https://github.com/jmz52/Marlin/tree/MKS-Robin-ILI9328

Two tests required, one with enabled #define LCD_USE_DMA_FSMC line in pins_MKS_ROBIN.h file and another one with disabled FSMC

Also please enable following line in pins_MKS_ROBIN.h for bother tests to validate initialization sequence for ILI9328. #define LCD_RESET_PIN PF6

sakza commented 4 years ago

Awesome, I'm away at the moment, but I'll get back to you when I can - I've got it to the point where I can make it display a white screen instead of the bootloader text so anything last that will be a worthwhile!

mattdog01 commented 4 years ago

@jmz52 First of all thank you so much for all your work getting the MKS-Robin working with Marlin. Totally awesome. I don't mean to jump in and hijack your work with @sakza but I did the tests on my TFT v1.1 and it is the closest that I have been to getting Marlin working. I get the Marlin home screen and then the status screen with #define LCD_USE_DMA_FSMC enabled and with it commented out. I had #define LCD_RESET_PIN PF6 enabled for both tests. But the wonderful news is that the v1.1 tft does display in Marlin. Thank you.

I have a different issue that is preventing further progress and that my board goes into flashing blue LED mode (I think it is a protective mode). This is likely the reason I can't get the touch buttons to work. Any thoughts there? I have had this problem since the beginning of my Marlin adventure (but without the awesome Marlin screens working).

sakza commented 4 years ago

Good timing @mattdog01, I finally was able to test it and I have 100% functionality @jmz52, including the touch screen buttons. I've absolutely butchered my marlin fork trying to get it working, so I really don't know what aspect of mine has helped the buttons, but I'd recommend having a look at my configuration at the top of the issue and see if anything is different regarding the touch screen

mattdog01 commented 4 years ago

@sakza Thanks I'll have a look at your config file. Any idea why my board is going into the error sensing / self protection mode (flashing blue LED)? It doesn't happen with stock firmware which makes me think it something in my settings. Thanks again to all of you for working on this.

sakza commented 4 years ago

Not sure about that one, I don't think I've run into it at all - If you can't get it working, I'll put my whole fork back up on github so you can make sure it's not your hardware

jmz52 commented 4 years ago

@sakza Flashing blue LED is a heartbeat, is indicates that Marlin is fine.

Default touch screen calibration data are for MKS Robin TFT 2.0 and they are not suitable for v1.1 There is a commented section in config/examples/Mks/Robin/Configuration.h with touch screen calibration data for v1.1

You need to disable/remove v2.0 values and use v1.1 values instead. Alternatively you can use calibration tool to get these values for your touch screen.

//
// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
//
#define TOUCH_BUTTONS
#if ENABLED(TOUCH_BUTTONS)
  #define BUTTON_DELAY_EDIT  75 // (ms) Button repeat delay for edit screens
  #define BUTTON_DELAY_MENU 100 // (ms) Button repeat delay for menus

  /* MKS Robin TFT v2.0 */
  #define XPT2046_X_CALIBRATION    12013
  #define XPT2046_Y_CALIBRATION    -8711
  #define XPT2046_X_OFFSET           -32
  #define XPT2046_Y_OFFSET           256

  /* MKS Robin TFT v1.1 */
  //#define XPT2046_X_CALIBRATION -11792
  //#define XPT2046_Y_CALIBRATION   8947
  //#define XPT2046_X_OFFSET         342
  //#define XPT2046_Y_OFFSET         -19
#endif
jmz52 commented 4 years ago

And there is no need to enable #define LCD_RESET_PIN PF6 anymore. It was needed to test initialization sequences and now when we know that initialization works you can leave LCD_RESET_PIN disabled.

mattdog01 commented 4 years ago

@jmz52 @sakza Thanks for the help. Assuming the flashing blue LED is the "heart beat" then the only issue I have is the touch feature doesn't work on the four buttons at the bottom of the display. I have confirmed that I have the config files the same as provided in the examples, except where there is an obvious difference (eg bed size, personal preferences, etc.) Is there a thread that you can point me too to help sort this out?

3Dangel commented 4 years ago

@jmz52 Man... you've away for so long!!!! missed your "brain"...... again, THANK YOU for your talent and support for this old board! (mine was never used and wanted to use it) will give a try and hope the main MARLIN could include your work in it!!!

sakza commented 4 years ago

@mattdog01 I do remember a couple of other things I changed, although it's almost a month ago at this point - I'll do some digging when I've got some time and I'll see if I can find anything specific

3Dangel commented 4 years ago

confirmed. MKS-Robin V2.1 TFT V1.1 ili9328 processor is fully functional. @sakza your config shows you are using the defaul one and not the one from the sample config folder for MKS as jmz52 pointed out, you must use the right x,y coordinate for the bottoms to work: / MKS Robin TFT v1.1 /

define XPT2046_X_CALIBRATION -11792

define XPT2046_Y_CALIBRATION 8947

define XPT2046_X_OFFSET 342

define XPT2046_Y_OFFSET -19

endif

mattdog01 commented 4 years ago

@sakza thank you so much for any help you can offer. You have already given me hope that Marlin will one day be fully functional on my printer.

@3Dangel I am not using the default config. I'm using the one provided by @jmz52. I even ran the screen config and my numbers are almost exactly the same. My config is attached Config files.zip

mattdog01 commented 4 years ago

@3Dangel 20191230_232331 I think my numbers are close enough to just go with provided numbers.

3Dangel commented 4 years ago

you missed

define NUM_SERIAL 2

On Tue, Dec 31, 2019 at 11:22 AM mattdog01 notifications@github.com wrote:

@3Dangel https://github.com/3Dangel [image: 20191230_232331] https://user-images.githubusercontent.com/34989664/71630316-4b9d1880-2bd0-11ea-91a4-cd3eb1861e0d.jpg I think my numbers are close enough to just go with provided numbers.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/16159?email_source=notifications&email_token=AFYWWXNOIF3PRSJILR5B2J3Q3OEXNA5CNFSM4JYEZBS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH4QZ7A#issuecomment-569969916, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFYWWXJDHZ7D6X5F3GYXQ2LQ3OEXNANCNFSM4JYEZBSQ .

3Dangel commented 4 years ago

IMG-5614 IMG-5615 IMG-5617

3Dangel commented 4 years ago

last picture shows my SD card's info. SD cards used 2Gb. FAT

mattdog01 commented 4 years ago

@3Dangel Way to go eagle eye. Thanks.

you missed #define NUM_SERIAL 2

It didn't help my situation though. Still no touch function. So sad.

Your screen looks awesome. You must be happy.
I'm glad that it will be able to see folders on the sd card. That is how I like to arrange my stuff.

I'm wondering if you would be so kind as to compile my config files and send me the bin file? I'm suspecting that is is my compilers environment. Everyone seems to be able to get it figured out but I'm still stuck with dysfunctional touch buttons.

tpruvot commented 4 years ago

try to click on the top of the screen, the v1.0 touchscreen orientation may be different than v1.1 one

3Dangel commented 4 years ago

It will stop to work as soon as you start to enabling functions. Mine stopped working when tried advanced pause for filament changes. Or other staffs I have enabled.

Try the bare bones from the jmz52’s repository and without changing things and try.

On Tue, Dec 31, 2019 at 17:54 Tanguy Pruvot notifications@github.com wrote:

try to click on the top of the screen, the v1.0 touchscreen orientation may be different than v1.1 one

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/16159?email_source=notifications&email_token=AFYWWXMUNMUJ3CVZOBLUALTQ3PSTHA5CNFSM4JYEZBS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH422LY#issuecomment-570010927, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFYWWXKQQU23X36TJOKZOILQ3PSTHANCNFSM4JYEZBSQ .

mattdog01 commented 4 years ago

@3Dangel @jmz52 @tpruvot

Hey Guys, Happy New Year!!! Thank you to all of you. I allowed my VS code to update (I have been holding it at 1.39.2). So now I'm at Version: 1.41.1 (user setup) and PlatformIO home 3.0.1 and core 4.1.0. This is just FYI as there are some out there that say the newer versions of vscode have caused some of the issues with compiling but I have not idea about those wonderful things. (I fix aircraft not code)

I tried the fresh config files as provided from jmz52’s repository without any changes. The buttons worked but at the top of the screen and in a different order. I was able to navigate the menus and perform different functions. Victory at last!!!!!!

I went into the the config files and commented the v2.0 defaults and uncommented the v1.1 defaults. the buttons and image where together at last and worked correctly.

Then I went in and configured for my machine. corexy, x, y and e directions, accelerations and speeds. Worked great, homed.

"No media" was display in the menus. Changed the advanced features to add a feature to the menus to check the SD card and now I can read the card, navigate the folders and select jobs to print.

Added fun features like baby stepping and tried to add filament change but I'm still working on that.

I still need to learn where everything is normally located in the menus.

I have some replacement parts printing now and everything seems to be working perfectly.

I think I will be able to increase movement speeds now that I have better more accurate control over them (as an example in the stock firmware I needed to double the steps per mm to get the travel correct)

20200101_131308 20200101_131325

3Dangel commented 4 years ago

Very happy to see another successful revival of the Robin with TFT on Marlin!!!

@jmZ52 again thank you for your The great coding and sharing it with us.

Also to every contributors of Marlin, big thanks and best wishes and greater success in 2020.

I believe in open source and people around the world will continue to contribute and push the boundary of Marlin FW and make it to be even greater !

On Wed, Jan 1, 2020 at 11:19 mattdog01 notifications@github.com wrote:

@3Dangel https://github.com/3Dangel @jmz52 https://github.com/jmz52 @tpruvot https://github.com/tpruvot

Hey Guys, Happy New Year!!! Thank you to all of you. I allowed my VS code to update (I have been holding it at 1.39.2). So now I'm at Version: 1.41.1 (user setup) and PlatformIO home 3.0.1 and core 4.1.0. This is just FYI as there are some out there that say the newer versions of vscode have caused some of the issues with compiling but I have not idea about those wonderful things. (I fix aircraft not code)

I tried the fresh config files as provided from jmz52’s repository without any changes. The buttons worked but at the top of the screen and in a different order. I was able to navigate the menus and perform different functions. Victory at last!!!!!!

I went into the the config files and commented the v2.0 defaults and uncommented the v1.1 defaults. the buttons and image where together at last and worked correctly.

Then I went in and configured for my machine. corexy, x, y and e directions, accelerations and speeds. Worked great, homed.

"No media" was display in the menus. Changed the advanced features to add a feature to the menus to check the SD card and now I can read the card, navigate the folders and select jobs to print.

Added fun features like baby stepping and tried to add filament change but I'm still working on that.

I still need to learn where everything is normally located in the menus.

I have some replacement parts printing now and everything seems to be working perfectly.

I think I will be able to increase movement speeds now that I have better more accurate control over them (as an example in the stock firmware I needed to double the steps per mm to get the travel correct)

[image: 20200101_131308] https://user-images.githubusercontent.com/34989664/71644601-0395f880-2c99-11ea-9285-ac21a2a5dc1c.jpg [image: 20200101_131325] https://user-images.githubusercontent.com/34989664/71644602-0395f880-2c99-11ea-91ef-19064060e4ea.jpg

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/16159?email_source=notifications&email_token=AFYWWXNNK6B4NCIEZGAR3HLQ3TNCVA5CNFSM4JYEZBS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH5J5KY#issuecomment-570072747, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFYWWXI67PF4ESOJJJTHIYLQ3TNCVANCNFSM4JYEZBSQ .

tpruvot commented 4 years ago

@boelle issue can be closed i think

mattdog01 commented 4 years ago

@boelle issue can be closed i think

@tpruvot I think you are right sir. Marlin 2.0 is working perfectly on my MKS-Robin v2.3 with the TFT v1.1. The ILI9328 TFT works great on the MKS Robin.

I'm so thankful that you guys are support the Marlin project. I can't do it so it is great to have you doing it. Thank you. If you ever need any help with MKS-Robin v2.3 with the TFT v1.1 firmware testing I'll be happy to help. I would like to give back.

kindest regards, Matt and his Hypercube

sakza commented 4 years ago

Thanks everyone for the input and hard work! Looks like everything is working 100%, and merged!

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.