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
15.97k stars 19.09k forks source link

HC32: fix WDT reset when saving UBL mesh #27084

Closed shadow578 closed 2 weeks ago

shadow578 commented 2 weeks ago

Description

While setting up UBL, i found that the WDT would reset the printer when trying to save a the mesh.

After some debugging, i've found the auto-configuration function in the IWatchdog library to fail configuring when a 5s timeout, instead configuring a timeout after ~2s.

to mitigate this issue, 2 changes were implemented:

  1. lower the PCLK3 clock to 25MHz (in this PR)
  2. update the auto-config function of the IWatchdog library (in https://github.com/shadow578/framework-arduino-hc32f46x/pull/26)

Either of these would be sufficient to fix the reset "symptom", but both are necessary to get the watchdog to behave as expected.

Requirements

Any HC32 based board

Benefits

Fixes unexpected watchdog timeouts when saving UBL mesh data.

Configurations

N/A

Related Issues

N/A