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.65k forks source link

[BUG] No response displayed for M503 in Terminal (Response ~2500 characters) #1267

Closed kisslorand closed 3 years ago

kisslorand commented 3 years ago

Description

When an M503 gcode is issued in Terminal there's no response shown. Actually only the last few characters are shown: cho: M410 S1 OK P:15 B:15

Steps to reproduce

  1. [Open Terminal]
  2. [Type M503]
  3. [Press Send]

Expected behavior

The full response for M503

Actual behavior

Only the last few characters are shown: Rcv: cho: M410 S1 Rcv: OK P:15 B:15

Hardware Variant

MKS TFT clone on Artillery Sidewinder X1 with SKR 1.4Turbo mainboard

TFT Firmware Version & Main Board Firmware details

TFT FW: 0.0.26.1, Marlin 2.7.2

Additional Information

When M503 S0 is issued the response is full.

radek8 commented 3 years ago

I can confirm this behavior.

@digant73 Was the output on the M503 command terminal suppressed in your last PR?

radek8 commented 3 years ago

Comment on these 3 lines. It might help ....

image

thus

image

But I don't recommend doing it. You will still be bothered by unnecessary notifications.

kisslorand commented 3 years ago

Would be easier to allow "knownEcho" to be shown in Terminal, I just cannot find a way to do it. I cannot find where are they suppressed from "dmaL2Cache".

radek8 commented 3 years ago

I wrote that to you

kisslorand commented 3 years ago

In "menu.c" "parseACK()" is called where "syncL2CacheFromL1(SERIAL_PORT)" fills "dmaL2Cache". The "knownEcho" elements must be removed somewhere from "dmaL2Cache" since they are not shown in terminal (except "echo:busy: processing" that is not supposed to get to Terminal). ...or I might be utterly wrong...

BTW, just issue a G28 in Terminal, and you will see "echo:busy: processing" so I am not sure about that list ("knownEcho") elements not visible in Terminal.

Later edit: in the meantime tested your solution, not working. I get a ton of message/popup beeps without any visual on the screen and the Terminal doesn't show the full response for M503, only the last few characters. I think it has to do something with the length of the M503 response. I tested ACK_MAX_SIZE 4096 but the only change was that I got Rcv: o: M410 S1 Rcv: OK P:15 B:15 instead of Rcv: cho: M410 S1 Rcv: OK P:15 B:15

The character count of M503 response is ~2500 characters, the count of M503 S0 is ~1500 characters

radek8 commented 3 years ago

Unfortunately, I won't help you anymore.

kisslorand commented 3 years ago

It is not about me but thx for your preciuos time.

radek8 commented 3 years ago

I can't help, this is where my knowledge ends :-(

digant73 commented 3 years ago

no changes were made on Terminal related to gcode handling. Also M503 correctly works on my side (5 pages of output)

kisslorand commented 3 years ago

M503 S0 works for me too, the plain M503 gives me trouble. Radek8 also confirmed this behaviour. M503 gives a larger response than the "ACK_MAX_SIZE", M503 S0 gives a smaller response than "ACK_MAX_SIZE".

oldman4U commented 3 years ago

Looks like this on my TFT. image

image

image

kisslorand commented 3 years ago

From the pictures I can see it has much less response characters than in my situation. Also this TFT uses different MCU than mine. This one is with STM32F207 and mine has STM32F107. My TFT has no issue to display the response from M503 S0 which has around 1500 characters opposed to the ~2500 characters it gets from the simple M503 gcode (no S0 parameter).

oldman4U commented 3 years ago

So there is a problem with your TFT and others like mine work well. What is your screen size?

kisslorand commented 3 years ago

It is the original 2.8" TFT (STM32F107VC) on the Artillery Sidewinder X1. Radek8 also confirmed the behaviour I described.

radek8 commented 3 years ago

I can confirm the same behavior as kisslorand. But my HW is a TFT 35 E3 V3.0 like Oldman4U. Therefore, the error does not bind to a specific type of TFT

radek8 commented 3 years ago

If I send the M503 command from the PC via Wifi, the response is correct and complete.

oldman4U commented 3 years ago

Can u send a picture?

Radek notifications@github.com schrieb am Mi. 18. Nov. 2020 um 15:03:

If I send the M503 command from the PC via Wifi, the response is correct and complete.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/issues/1267#issuecomment-729697942, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM6XKZCTDASRA2A6A3KYGJLSQPH4XANCNFSM4TZDYL7Q .

radek8 commented 3 years ago

I'll send in the evening

oldman4U commented 3 years ago

Not sure how many characters it is, but on my TFT28 M503 gives me 6 pages IMG_7445.HEIC.zip

radek8 commented 3 years ago

M503 IMG_20201118_163020_resized_20201118_061130856

radek8 commented 3 years ago

M503 S0 IMG_20201118_163053_resized_20201118_061130505 IMG_20201118_163058_resized_20201118_061129921 IMG_20201118_163105_resized_20201118_061130672 IMG_20201118_163112_resized_20201118_061130315 IMG_20201118_163121_resized_20201118_061130997 IMG_20201118_163131_resized_20201118_061130132

kisslorand commented 3 years ago

M503 Disregard the SmileyFace, it's from my phone.

oldman4U commented 3 years ago

Strange. So it works on my machine, but not on yours. I will test another machine and let you know...

oldman4U commented 3 years ago

Thats my SKR E3 DIP TFT35 E3 v3 based Ender 3.

IMG_7446 IMG_7447 IMG_7448 IMG_7449

kisslorand commented 3 years ago

What Marlin version are you on? I am on 2.0.7.2 bugfix. I went as far with debugging as checking the "infoHost.rx_ok[SERIAL_PORT] " after sending "M503". It gets "true" only two times. I checked it in "parseACK.c" after "syncL2CacheFromL1(SERIAL_PORT);" (line 263). Since it gets "true" only two times (before "echo: wait" starts to kick in), it is no surprise the terminal shows only two lines of response.

infoHost.rx_ok[SERIAL_PORT] should be set to "true" in "Serial.c" -> "void USART_IRQHandler(uint8_t port)" if "(dmaL1Data[port].cache[wIndex-1] == '\n')".

oldman4U commented 3 years ago

Marlin 2.0.7.2 from Oct. 22nd. I guess this is the date where this firmware version has been released officially.

I must say that I always use 115200 baud rate and set the TFT connection as the first serial connection and -1 or nothing as the second serial connection.

Let me know in case I can help somehow but must add, that I am no developer. So may it is more work for you to explain to me what I have to do, than the amount of work I can do;-)

kisslorand commented 3 years ago

Problem solved, the size of the response for M503 didn't fit the DMA and Terminal buffer. Solved it by enlarging those buffers.

radek8 commented 3 years ago

May I ask a solution to the problem? Thank you

oldman4U commented 3 years ago

@kisslorand

Are you going to make a PR for this?

kisslorand commented 3 years ago

I fixed it for my printer, others might check if it is OK with theirs. Here's the PR: https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/pull/1276

radek8 commented 3 years ago

Good job. It already works as it should :-)

IMG_20201121_183144_resized_20201121_063406055 IMG_20201121_183214_resized_20201121_063406287

github-actions[bot] commented 6 months 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.