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

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

Closed
kisslorand opened this issue Nov 17, 2020 · 32 comments · Fixed by kisslorand/BIGTREETECH-TFT#1 or #1276
Labels
bug Something isn't working

Comments

@kisslorand
Copy link
Contributor

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.

@kisslorand kisslorand added the bug Something isn't working label Nov 17, 2020
@radek8
Copy link
Contributor

radek8 commented Nov 17, 2020

I can confirm this behavior.

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

@radek8
Copy link
Contributor

radek8 commented Nov 17, 2020

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
Copy link
Contributor Author

kisslorand commented Nov 17, 2020

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
Copy link
Contributor

radek8 commented Nov 17, 2020

I wrote that to you

@kisslorand
Copy link
Contributor Author

kisslorand commented Nov 17, 2020

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
Copy link
Contributor

radek8 commented Nov 17, 2020

Unfortunately, I won't help you anymore.

@kisslorand
Copy link
Contributor Author

kisslorand commented Nov 17, 2020

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

@radek8
Copy link
Contributor

radek8 commented Nov 17, 2020

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

@digant73
Copy link
Contributor

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

@kisslorand
Copy link
Contributor Author

kisslorand commented Nov 18, 2020

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
Copy link
Contributor

Looks like this on my TFT. image

image

image

@kisslorand
Copy link
Contributor Author

kisslorand commented Nov 18, 2020

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).

@kisslorand kisslorand changed the title [BUG] No response for M503 in Terminal [BUG] No response for M503 in Terminal (Response ~2500 characters) Nov 18, 2020
@kisslorand kisslorand changed the title [BUG] No response for M503 in Terminal (Response ~2500 characters) [BUG] No response displayed for M503 in Terminal (Response ~2500 characters) Nov 18, 2020
@oldman4U
Copy link
Contributor

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

@kisslorand
Copy link
Contributor Author

kisslorand commented Nov 18, 2020

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

@radek8
Copy link
Contributor

radek8 commented Nov 18, 2020

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
Copy link
Contributor

radek8 commented Nov 18, 2020

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

@oldman4U
Copy link
Contributor

oldman4U commented Nov 18, 2020 via email

@radek8
Copy link
Contributor

radek8 commented Nov 18, 2020

I'll send in the evening

@oldman4U
Copy link
Contributor

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

@radek8
Copy link
Contributor

radek8 commented Nov 18, 2020

M503
IMG_20201118_163020_resized_20201118_061130856

@radek8
Copy link
Contributor

radek8 commented Nov 18, 2020

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
Copy link
Contributor Author

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

@oldman4U
Copy link
Contributor

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

@oldman4U
Copy link
Contributor

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

IMG_7446
IMG_7447
IMG_7448
IMG_7449

@kisslorand
Copy link
Contributor Author

kisslorand commented Nov 19, 2020

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
Copy link
Contributor

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
Copy link
Contributor Author

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

@radek8
Copy link
Contributor

radek8 commented Nov 20, 2020

May I ask a solution to the problem?
Thank you

@oldman4U
Copy link
Contributor

@kisslorand

Are you going to make a PR for this?

@kisslorand
Copy link
Contributor Author

I fixed it for my printer, others might check if it is OK with theirs.
Here's the PR: #1276

@radek8
Copy link
Contributor

radek8 commented Nov 21, 2020

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

IMG_20201121_183144_resized_20201121_063406055
IMG_20201121_183214_resized_20201121_063406287

Copy link

github-actions bot commented Apr 3, 2024

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.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.