From 004bed8a7fc3ff9feb73a0ea9794635b50073c27 Mon Sep 17 00:00:00 2001 From: Chris Pepper Date: Fri, 5 Feb 2021 22:43:36 +0000 Subject: [PATCH] Mitigate RPi hosts kernel panic on M997 Work around M997 sometimes causing a kernel panic on the host when sent from a Raspbery Pi, the root cause is currently unknown. --- Marlin/src/HAL/LPC1768/HAL.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Marlin/src/HAL/LPC1768/HAL.cpp b/Marlin/src/HAL/LPC1768/HAL.cpp index 27aa569fae..eddd61af7d 100644 --- a/Marlin/src/HAL/LPC1768/HAL.cpp +++ b/Marlin/src/HAL/LPC1768/HAL.cpp @@ -63,7 +63,11 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) { return ind > -1 ? ind : dval; } -void flashFirmware(const int16_t) { NVIC_SystemReset(); } +void flashFirmware(const int16_t) { + USB_Connect(FALSE); // USB clear connection + delay(2000); // Give OS time to notice + NVIC_SystemReset(); +} void HAL_clear_reset_source(void) { TERN_(USE_WATCHDOG, watchdog_clear_timeout_flag());