shadow578 / Marlin-H32

Marlin for HC32F460 based printers (now in upstream)
http://marlinfw.org
GNU General Public License v3.0
13 stars 7 forks source link

[BUG] Temperature auto-reporting (+ others) fail after ~72 Minutes #54

Closed shadow578 closed 8 months ago

shadow578 commented 8 months ago

Bug Description

printer fails to send M155 temperature report after ~72 Minutes of printing. additionally, the DWIN screen freezes.

when re-enabling temperature report using M115, the reporting works again

shadow578 commented 8 months ago

seems to be caused by overflow of system uptime timer (https://github.com/shadow578/framework-arduino-hc32f46x/blob/6f19b41ea97260abb60e62bb361e3096bf929bcd/cores/arduino/drivers/sysclock/systick.cpp#L4)

changing the timer to uint64_t seems to fix the issue

shadow578 commented 8 months ago

fixed in arduino core by adapting STM32duino's solution. see https://github.com/shadow578/framework-arduino-hc32f46x/pull/7/commits/ce09dcfda896ec47169126fdee1c47c903d0d587

NOTE: millis() will still overflow after ~50 days, idk how to avoid this but other cores seem to have the same issue

shadow578 commented 8 months ago

official arduino docs mention that millis() will overflow after ~50 days, so assuming this is ok.

https://reference.arduino.cc/reference/en/language/functions/time/millis/