From 2add4d4712901b65b012ff29c12489da9384db7d Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 25 Apr 2022 12:03:53 +0200 Subject: [PATCH] Workaround HWCDC exception --- tasmota/support.ino | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tasmota/support.ino b/tasmota/support.ino index 75f461fe5..c89c6f237 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -1898,14 +1898,17 @@ void SetSerialBegin(void) { SetSerialSwap(); #endif // ESP8266 #ifdef ESP32 +#ifdef ARDUINO_USB_CDC_ON_BOOT +// Serial.end(); +// Serial.begin(); + // Above sequence ends in "Exception":5,"Reason":"Load access fault" + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_SERIAL "HWCDC supports 115200 bit/s only")); +#else delay(10); // Allow time to cleanup queues - if not used hangs ESP32 Serial.end(); delay(10); // Allow time to cleanup queues - if not used hangs ESP32 -#ifdef ARDUINO_USB_CDC_ON_BOOT - Serial.begin(TasmotaGlobal.baudrate); -#else Serial.begin(TasmotaGlobal.baudrate, ConvertSerialConfig(Settings->serial_config)); -#endif // ARDUINO_USB_CDC_ON_BOOT +#endif // Not ARDUINO_USB_CDC_ON_BOOT #endif // ESP32 }