-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
M410 out of the UART IQR #19752
M410 out of the UART IQR #19752
Conversation
… an IRQ dont work, because all other IRQ will stay blocked until that code returns, and it will prevent temp timer to run, that M410 depends to finish.
With this fix, if you send a M410 while homing it only cancels the current homing move. I'm not sure if this is an existing problem or specific to this PR due to this issue #19490 |
The bug is: M410 crash board. Reason: it was executed inside a IRQ. Fix: execute out of a IRQ. With my fix, M410 will run properly, always. Now, if M410 don't work with homing, it is not related with my fix, neither with the original issue report. It's M410 that never worked with homing (I didn't tested homing+M410). |
I moved M410 to run in the same place as M112. So, if M112 run, M410 will run. |
I observed the same M410 crash issue, but I have solved it in another way (before to find this pull request). I have suspected a stack overflow due to the call of the idle command. Thus I have protected the get_serial_commands in this way:
And it seems to solve it. |
Some menu screens do something similar, if they call idle() which may in-turn try to process the same screen again. |
Emergency Parser don’t use The problem with M410 and Emergency Parser is that it was running inside the serial IRQ handler, blocking others IRQ to run. And the M410 will only return after 1000 temperature timer run. But as irq are blocked, the temperature timer never run, and it stay forever in loop. Seems that M410 don’t work while homing to. I didn’t tested my self. Anyway, this PR make M410 work exactly as M112. |
Here is a log of the new code, with EP enabled. I added a lot to show how many times the M410 was called (to check if is there any stacked call).
|
Now M410 without EP. It is not stacking calls too. It only gives a strange
|
In resume: I could not simulate the stacked calls and everything is working for me. I didn't see any new behaviour. |
I did some debugging, and the |
in endstop.cpp you can add at line 319 to solve homming failed problem
|
No, the M410+Homing is a lot tricker. Sure it can be solve with a few ifs in the middle of the code. But the problem seems a bit deeper than that, as M410 just stop one move, and the control will get back to the current task, generating a undefined behaviour, possibly, in more cases. And, it's subject for another issue, specific for that, as we may need a bigger rework and testing, very different from what this PR is addressing. |
Description
The Emergency Parser run inside the UART IRQ. So, the others IRQ (like temperature timer) will only run when EP returns.
For this reason, EP cannot run any command that depends on other IRQ.
As
quickstop_stepper()
, that depends on temperature timer, to finish and return.This PR makes M410 exec in a async way (moved to idle), as other EP commands. This will allow the
quickstop_stepper()
run, while keep all other IRQ enabled and running too.Benefits
Fix #19490
Configurations
Any board with EP enabled.
Related Issues
#19490