-
-
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
[BUG] Stepper recursion with ESP32 I2s expanders & laser #26873
Comments
All chipsets that use ESP32 have this problem. In particular, this problem occurs when performing operations such as updating ROM data, where dynamic mechanisms cannot be executed, so stopping one operation and resuming another will result in the loss of previous operation values. This appears to be a limitation of the EPS32 I2C system. In the case of 3D printers, a layer shift phenomenon is discovered when G-code reading stops momentarily. It seems like you'll need some kind of groundbreaking system to use this chipset properly. Something like a separate system buffer for I2C. |
Turned out to be nothing to do with recursion, task switching or interrupts - just a simple sequencing issue! |
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. |
Marlin.zip
Did you test the latest
bugfix-2.1.x
code?Yes, and the problem still exists.
Bug Description
ESP32 exception generated at the end of a laser move in dynamic mode (G4 I).
Fully described here:
#22690 (comment)
I can confirm that the issue is caused by
current_block
being null. The only way I can see this happening is ifblock_phase_isr()
(called from I2SstepperTask()
) gets called again (as it does every 4uS) before the previousblock_phase_isr()
has completed. That could happen ifblock_phase_isr
takes longer than 4uSec asstepperTask()
is running on a separate thread. On the last block move,pulse_phase_isr()
(called just beforeblock_phase_isr()
) has completed the last step then, because steps are complete, the 2nd call discards the block - the first call hasn't completed at this point butcurrent_block
is now null.The fix in the above link does appear to work but doesn't really solve the issue properly if code trying to accessing the block gets added after that line in future. A
busy
flag on entry/exit toblock_phase_isr()
would also work at preventing recursion but I am reluctant to mess with the stepper code (unforeseen consequences and all that!). Anyone got a better idea?Bug Timeline
#22690 (comment)
Expected behavior
No exception!
Actual behavior
Exception.
Steps to Reproduce
LASER_FEATURE
G4I
thenG1Xnnn
at terminal and an exception will be thrown. If you use a long distance move at a slow feed rate you will see the exception always occurs at the end of the move.Version of Marlin Firmware
bugfix2-2.1.x
Printer model
Custom
Electronics
MKS TinyBee
LCD/Controller
No response
Other add-ons
No response
Bed Leveling
None
Your Slicer
None
Host Software
None
Don't forget to include
Configuration.h
andConfiguration_adv.h
.Additional information & file uploads
No response
The text was updated successfully, but these errors were encountered: