bigtreetech / BIGTREETECH-TouchScreenFirmware

support TFT35 V1.0/V1.1/V1.2/V2.0/V3.0, TFT28, TFT24 V1.1, TFT43, TFT50, TFT70
GNU General Public License v3.0
1.3k stars 1.64k forks source link

[FR] New Artillery not flashing LCD on GD32F305 #2391

Closed Help3D-Padova closed 6 months ago

Help3D-Padova commented 2 years ago

Description

There some Artillery Genius PRO or X2 that are not able to flash the LCD firmware.

Steps to reproduce

Try to flash as usual

Actual behavior

MKSTFT28.bin is not detected and the flash is not able to start

Hardware Variant

It seems that the new microcontroller is based on GD32F305 - VERIFIED

TFT Firmware Version & Main Board Firmware details

The bootloader is V3.0.4

Additional Information

https://github.com/artillery3d/genius-pro-tft-firmware this firmware can be flashed without issue

@digant73 i'm not able to reproduce this issue because i have an older lcd but i have some user that can try some beta firmware.

ciotto commented 1 year ago

But @ciotto said there is also

211381540-b043c8a8-2802-43c4-a5a5-24f22b17fa57 (1)

Which is a 64 pins package

Me I compared with the v1.0 version of the board and not the 1.2 stm version vs 1.2 gd version

Sorry, for sure is my error. Unfortunately I don't have the STM32 version of the board and I searched the image on internet.

gagipro commented 1 year ago

@ciotto I managed to bypass boot logo with your repo and changing in platformio.ini

Try it if you have time, we are still probably missing something.

MirakelPrints commented 1 year ago

I cloned @ciotto repo and updated github workflows to auto-build by github. no need to compile it yourself now 🙂 also disabled boot logo. should now be the state @gagipro & @ciotto are working on if anyone wants to test: mkstft28evo.bin

gagipro commented 1 year ago

I cloned @ciotto repo and updated github workflows to auto-build by github. no need to compile it yourself now 🙂 also disabled boot logo. should now be the state @gagipro & @ciotto are working on if anyone wants to test: mkstft28evo.bin

I confirm : same result as me

Ricky1966 commented 1 year ago

@MirakelPrints for upload to tft I've to download all dir SD cardin your repo or only mkstft28evo.bin?

gagipro commented 1 year ago

@MirakelPrints for upload to tft I've to download all dir SD cardin your repo or only mkstft28evo.bin?

I take the directory from @ciotto branch release like I explained few posts ago and copy the evo firmware

gagipro commented 1 year ago

If someone have a good quality picture of the previous board please, where we can follow xpt to stm lines...

gagipro commented 1 year ago

20230219_135309

Like this one

gagipro commented 1 year ago

20230219_135833

gagipro commented 1 year ago

IMG_20221029_140741 jpg 46446f57413eaa2ab0863223236b6339

Found one !

MirakelPrints commented 1 year ago

@Ricky1966

@MirakelPrints for upload to tft I've to download all dir SD cardin your repo or only mkstft28evo.bin?

I take the directory from @ciotto branch release like I explained few posts ago and copy the evo firmware

or just copy contents of /mkstft28evo to sd card. (mkstft28evo.bin will be copied there on build automatically)

@gagipro

I confirm : same result as me

thanks for confirmation

gagipro commented 1 year ago

I found those pinouts but still no touchscreen :

define XPT2046_CS PB5

define XPT2046_SCK PE4

define XPT2046_MISO PE5

define XPT2046_MOSI PE6

define XPT2046_TPEN PD12

Ricky1966 commented 1 year ago

@gagipro Miso e Mosi for STM32 pin number? Maybe is SPI2 or SPI3!

gagipro commented 1 year ago

@gagipro Miso e Mosi for STM32 pin number? Maybe is SPI2 or SPI3!

I followed each pin with continuity tester and refered to 100 pins package documentation for gd32f305

Ricky1966 commented 1 year ago

@gagipro Maybe could try with other SPI pins

Ricky1966 commented 1 year ago

https://www.gigadevice.com/datasheet/gd32f305xxxx-datasheet/

Ricky1966 commented 1 year ago

@gagipro look pages 28-34 this is pinout of V series

gagipro commented 1 year ago

@gagipro look pages 28-34 this is pinout of V series

And page 12 the 100 pins package. That´s exactly where I looked to get pins numbering when following traces current continuity from xpt2046 integrated component.

gagipro commented 1 year ago

and with the IC in the right orientation ... I found those pinouts but still no touchscreen :

define XPT2046_CS PC9

define XPT2046_SCK PC10

define XPT2046_MISO PC11

define XPT2046_MOSI PC12

define XPT2046_TPEN PC5

MirakelPrints commented 1 year ago

@gagipro are you using the mks gd v2 environment? platformio.ini only v2 uses board gd32f305, the other one still uses stm maybe that has an impact

gagipro commented 1 year ago

@gagipro are you using the mks gd v2 environment? platformio.ini only v2 uses board gd32f305, the other one still uses stm maybe that has an impact

Yes I´m using mks gd v2 in platformio.ini, there is probably an issue in system_gd32f30x.c

@ciotto has begun to debug by adding missing functions it seems but still something is missing but I´m not good enough to debug.

https://stackoverflow.com/questions/72202279/incorrect-1ms-delay-at-gd32vf103

Ricky1966 commented 1 year ago

Finally hamming Artillery's technical support, I've the email address of Engeneers Chief. I wrote him if is possible to have some help, as schematics or other. Who know if the address don't be of the cleaner staff!

gagipro commented 1 year ago

Finally hamming Artillery's technical support, I've the email address of Engeneers Chief. I wrote him if is possible to have some help, as schematics or other. Who know if the address don't be of the cleaner staff!

or the source code :p

Ricky1966 commented 1 year ago

@gagipro I hope! But depending how much honey I've used to write him! 🤣🤣🤣

reynol3232 commented 1 year ago

I've been following your progress and I'm hoping you're successful. I've given up on Artillery long ago and although I love my Artillery printers I'm planning to change them out for Sovol. I was soured by my experience with the unsupported TFT. I wish you luck.

gagipro commented 1 year ago

I've been following your progress and I'm hoping you're successful. I've given up on Artillery long ago and although I love my Artillery printers I'm planning to change them out for Sovol. I was soured by my experience with the unsupported TFT. I wish you luck.

sure if we manage to do it, you will try it on your Artillery ^^

gagipro commented 1 year ago

Hi all ! I was wondering if there is any way of going into console mode on the LCD screen and simply debug by printing values of some variables ? If anyone knows how to do it? thanks in advance

ciotto commented 1 year ago

Hi @gagipro, using this branch you can debug by printing on screen in an easy way by changing this line.

This version skip also update-related steps in order to speed up the debug.

It's also possible to debug directly variables on the board memory using an ST-Link (you must solder a header), this is my setup: IMG_20230221_222224

gagipro commented 1 year ago

@ciotto ok thanks for all those precious informations. Did you made any progress in isolating the failing code? for you eveything's working except the PEN get ?

In this mode, is the touchscreen working or not?

thanks again

ciotto commented 1 year ago

In my opinion, working on the touchscreen is useless due to the fact that everything is based on OS_GetTimeMs that return always 0 if the interrupts don't work.

gagipro commented 1 year ago

In my opinion, working on the touchscreen is useless due to the fact that everything is based on OS_GetTimeMs that return always 0 if the interrupts don't work.

yes you are right, OS_GetTimeMs always returns 0 and now I can see it with your help. Thanks for that. when bypassing the bootlogo : you can see that there is a function that probes sd card insertion and that it do work, it calls OS_GetTimeMs + fixed value 2000 : this do work the rest of the system works but this function.

Ricky1966 commented 1 year ago

Unfortunately it seems that the Artillery technicians cannot/will not share anything! I thought of an alternative. try to debug the original Artillery firmware? I think maybe we could figure out some mechanisms that maybe Artillery got around or solved in some way. Maybe it's a stupid idea! But as @ciotto said, I thought I could help, but I don't have the necessary skills, I know Arduino programming, I know what interrupts are and a little more, but debugging and retro engineering are dark matter for me! Excuse me!

gagipro commented 1 year ago

Unfortunately it seems that the Artillery technicians cannot/will not share anything! I thought of an alternative. try to debug the original Artillery firmware? I think maybe we could figure out some mechanisms that maybe Artillery got around or solved in some way. Maybe it's a stupid idea! But as @ciotto said, I thought I could help, but I don't have the necessary skills, I know Arduino programming, I know what interrupts are and a little more, but debugging and retro engineering are dark matter for me! Excuse me!

unfortunately I don't see how is can be possible to decompile the binary.

reynol3232 commented 1 year ago

If I were to buy the older supported Touch Screen could I replace the current unsupported screen with that one?

gagipro commented 1 year ago

If I were to buy the older supported Touch Screen could I replace the current unsupported screen with that one?

That´s what i was about to do but too expensive, I prefere to give a chance to the community instead, and probably some time...

Ricky1966 commented 1 year ago

if this is comparible € 32,04 35%di SCONTO | Forniture LCD per stampa 3d MKS TFT28 V4.0 controller RepRap touch screen pannello da 2.8 pollici display colorato monitor dello schermo splash https://a.aliexpress.com/_EIUFe2H

Ricky1966 commented 1 year ago

But @gagipro you are right, is possible to modding the original one

ciotto commented 1 year ago

I bought this one (the original one) just to debug it in a more straightforward way.

reynol3232 commented 1 year ago

@ciotto Please let me know if that TFT works for you. I would really like to flash with ANY other firmware like @digant73.

Ricky1966 commented 1 year ago

@ciotto Chip? Stm o Gd?

gagipro commented 1 year ago

For stm one ask vendor blchtech 3dprinters store

ciotto commented 1 year ago

@ciotto Chip? Stm o Gd?

GD

Ricky1966 commented 1 year ago

Hi, this is the old STM32? Is possible to wiring with Ruby? P.S.; While my TFT, I don't know if is common issue, is not fine calibrated,the old one was more accurate or not?

https://it.aliexpress.com/item/1005001265745065.html?spm=a2g0o.productlist.main.21.4a6e4c7e31fWV2&algo_pvid=8e20ed02-17e0-4e4c-bcdd-d32edae10cd8&algo_exp_id=8e20ed02-17e0-4e4c-bcdd-d32edae10cd8-10&pdp_ext_f=%7B%22sku_id%22%3A%2212000015519107077%22%7D&pdp_npi=3%40dis%21EUR%2139.98%2135.98%21%21%21%21%21%402100b1a616771359047934982d0707%2112000015519107077%21sea%21IT%210&curPageLogUid=eV3PMXEwwQdK

MirakelPrints commented 1 year ago

from my understanding the tft controller is always the same for x1, x2, genius & genius pro. therefore also the x1 & genius controllers currently sold could use the gd32. you should be aware of that.

btw the touch behaviour in general seems to be crap when using fingers. I personally use a pen for the inputs, works much better

subst4nc3 commented 1 year ago

Unfortunately it seems that the Artillery technicians cannot/will not share anything! I thought of an alternative. try to debug the original Artillery firmware? I think maybe we could figure out some mechanisms that maybe Artillery got around or solved in some way. Maybe it's a stupid idea! But as @ciotto said, I thought I could help, but I don't have the necessary skills, I know Arduino programming, I know what interrupts are and a little more, but debugging and retro engineering are dark matter for me! Excuse me!

unfortunately I don't see how is can be possible to decompile the binary.

hello you can try to use ghidra to decompile binary, but it require lot of knowledge. anyway i'm trying to follow this article https://blog.feabhas.com/2022/12/disassembling-a-cortex-m-raw-binary-file-with-ghidra/ and this one https://blog.attify.com/analyzing-bare-metal-firmware-binaries-in-ghidra/ and also this video: https://www.youtube.com/watch?v=q4CxE5P6RUE that seems somehow promising. but as said it nedd a lot of time (at least to me) to understand how it works and how to interprete the output

gagipro commented 1 year ago

Unfortunately it seems that the Artillery technicians cannot/will not share anything! I thought of an alternative. try to debug the original Artillery firmware? I think maybe we could figure out some mechanisms that maybe Artillery got around or solved in some way. Maybe it's a stupid idea! But as @ciotto said, I thought I could help, but I don't have the necessary skills, I know Arduino programming, I know what interrupts are and a little more, but debugging and retro engineering are dark matter for me! Excuse me!

unfortunately I don't see how is can be possible to decompile the binary.

hello you can try to use ghidra to decompile binary, but it require lot of knowledge. anyway i'm trying to follow this article https://blog.feabhas.com/2022/12/disassembling-a-cortex-m-raw-binary-file-with-ghidra/ and this one https://blog.attify.com/analyzing-bare-metal-firmware-binaries-in-ghidra/ and also this video: https://www.youtube.com/watch?v=q4CxE5P6RUE that seems somehow promising. but as said it nedd a lot of time (at least to me) to understand how it works and how to interprete the output

Hi,

very interresting we can compare compiled binaries now. Thanks for sharing this with us!

Ricky1966 commented 1 year ago

@subst4nc3 As said by @gagipro , tks. One thingh is sure, diffently as think Artillery, the power of open source is that the comunity, could help them to evolve!

gagipro commented 1 year ago

@subst4nc3 As said by @gagipro , tks. One thingh is sure, diffently as think Artillery, the power of open source is that the comunity, could help them to evolve!

The thing is that Artillery uses opensource Marlin firmware but doesn't want to share in return. Ok the code of the TFT isn't opensource, but they are selling a product that uses opensource. By not sharing their TFT implementation, users are loosing the opensource aspect of their product.

Ricky1966 commented 1 year ago

If we'll arrive to a new firmware, the rigth thingh to doing is but an antifroud logo, so if Artillery want to use it every users will knows it is not them job!

subst4nc3 commented 1 year ago

hey guys just a curiosity, is only an impression or mostly the people involved are from italy?