MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.27k stars 19.23k forks source link

[BUG] Writing ABL mesh with M500 causes board reset (Ender 3 v2) #20307

Closed kyraxyg closed 3 years ago

kyraxyg commented 3 years ago

Bug Description

In the latest bugfix, I have activated the ABL bed leveling in the configuration files. When I try to activate ABL in the G28-G29-M500 sequence, the printer gets restarted end gets a DWIN handshake error. I can not save a mesh. It seems the issue is also applicable to UBL case. As seen from my research beforehand to diagnose the issue. https://www.reddit.com/r/ender3v2/comments/jxuskb/bltouch_ubl_saving_mesh_crashes_the_printer/

Send: M500 Recv: echo:start Recv: PowerUp Recv: Marlin bugfix-2.0.x Recv: Recv: echo: Last Updated: 2020-11-27 | Author: YcLn Recv: echo:Compiled: Nov 27 2020 Recv: echo: Free Memory: 49079 PlannerBufferBytes: 1600 Recv: Recv: DWIN handshake error. Recv: echo:EEPROM Initialized Recv: BL24CXX Check succeeded! Recv: echo:SD card ok

Configuration Files

Required: Include a ZIP file containing Configuration.h and Configuration_adv.h.

Marlin.zip

If you've made any other modifications describe them in detail here.

Steps to Reproduce

  1. [First Step] Execute G28
  2. [Second Step] Execute G29
  3. [and so on...] Execute M500

Expected behavior: Saving the mesh in eprom

Actual behavior: Printer soft reboots and gives DWIN Handshake error. I can not determine whether the DWIN hasnshake is the cause or the result

Additional Information

kyraxyg commented 3 years ago

serial.log.txt .Here is an serial log file from octo print. The printer soft reboots after M500. This is also the case if I level from the LCD screen.

sjasonsmith commented 3 years ago

I believe this is happening because the watchdog timer is expiring while writing to the EEPROM. The EEPROM write is optimized to skip unchanged bytes, which is why you only see this when storing your large 10x10 mesh after updating it.

kyraxyg commented 3 years ago

The thing is I was writing 15x15 UBL mesh with success previously. But I tried 10x10 UBL and UBL also seems to fail . Is there a way for me to increase watchdog timeout and try. I don't want to disable watchdog as this might be dangerous.

sjasonsmith commented 3 years ago

I am working on a fix that will service the watchdog during long writes.

kyraxyg commented 3 years ago

Thanks

sjasonsmith commented 3 years ago

@kyraxyg can you test the change from the pull request above to see if it fixes your issue?

kyraxyg commented 3 years ago

I will check when I get back home from work. Thanks

kyraxyg commented 3 years ago

I have tested with this commit and test was successful. I have sucessfully saved my 10x10 mesh to eprom.

kyraxyg commented 3 years ago

Thanks for the support

github-actions[bot] commented 3 years 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.