Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] "Serial status mismatch" on MKS TinyBee (ESP32 based) #27450

Open
1 task done
fermino opened this issue Oct 2, 2024 · 0 comments
Open
1 task done

[BUG] "Serial status mismatch" on MKS TinyBee (ESP32 based) #27450

fermino opened this issue Oct 2, 2024 · 0 comments

Comments

@fermino
Copy link

fermino commented Oct 2, 2024

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

I have a BOARD_MKS_TINYBEE that I started recently configuring. When printing through the USB port (The board has a CH341 onboard so it is actually printing thorugh UART0). At some point this line gets triggered and from there on it keeps throwing that error regularly.

If the software ignores it the printer otherwise goes well (1 print has failed but I don't know if it is related, though), but if the software "understands" the error, as octoprint does, it aborts the print as a safety measure.

In the print that failed the PID was operating normally (I don't remember if the LCD UI was responsive) and pronterface just stopped sending messages.

I currently have two uart endpoints enabled, UART0 for the USB, and UART1 with remapped pins for the TMC2209 drivers I'm using. I will try disabling UART1 to see if that changes anything, and for now will start adding some serial info throughout near code to see if I can find someting.

Anyways, I think it might be related to #21010, but that's just a guess.

Configuration:
serial-status-mismatch-bugfix-2.1.x.zip

Other patches I'm using:

--- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h    2024-09-22 22:09:28.109830303 -0300
+++ Marlin/src/pins/esp32/pins_MKS_TINYBEE.h    2024-09-22 22:09:06.535984141 -0300
@@ -118,7 +118,7 @@
 //
 // ADC Reference Voltage
 //
-#define ADC_REFERENCE_VOLTAGE                  2.565  // 2.5V reference VDDA
+#define ADC_REFERENCE_VOLTAGE                  2.498  // TL431 VDDA mod

 /**
  *                ------                                 ------
--- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h  2024-09-26 16:42:39.214112486 -0300
+++ Marlin/src/pins/esp32/pins_MKS_TINYBEE.h  2024-09-25 03:08:29.000000000 -0300
@@ -199,3 +199,29 @@
     #define BOARD_ST7920_DELAY_3             600
   #endif
 #endif // HAS_WIRED_LCD
+
+//
+// TMC2209 stepper drivers
+//
+#if HAS_TMC_UART
+  //
+  // Hardware serial 1
+  //
+  #define X_HARDWARE_SERIAL              Serial1
+  #define Y_HARDWARE_SERIAL              Serial1
+  #define Z_HARDWARE_SERIAL              Serial1
+  #define E0_HARDWARE_SERIAL             Serial1
+
+  #define TMC_BAUD_RATE 115200
+#endif
+
+/**
+ * Hardware serial pins
+ *  We will be using UART1, with reassigned pins to leave TX2 and RX2
+ *  available for the display.
+ *  See https://microcontrollerslab.com/esp32-uart-communication-pins-example/
+ *  This pins are connected (by default) to BTN_EN1 and BTN_EN2, if you didn't
+ *  change any of the zero-ohm bridges (particularly R2, R3, R4 and R5).
+ */
+#define HARDWARE_SERIAL1_TX                  EXP2_03_PIN
+#define HARDWARE_SERIAL1_RX                  EXP2_05_PIN
--- Marlin/src/HAL/ESP32/HAL.cpp      2024-09-25 03:08:29.000000000 -0300
+++ Marlin/src/HAL/ESP32/HAL.cpp      2024-09-25 19:14:13.579775444 -0300
@@ -250,6 +242,7 @@
   TERN_(HAS_TEMP_COOLER,       adc1_set_attenuation(get_channel(TEMP_COOLER_PIN), ADC_ATTEN_11db));
   TERN_(HAS_TEMP_BOARD,        adc1_set_attenuation(get_channel(TEMP_BOARD_PIN), ADC_ATTEN_11db));
   TERN_(FILAMENT_WIDTH_SENSOR, adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db));
+  TERN_(HAS_ADC_BUTTONS,       adc1_set_attenuation(get_channel(ADC_KEYPAD_PIN), ADC_ATTEN_11db));

   // Note that adc2 is shared with the WiFi module, which has higher priority, so the conversion may fail.
   // That's why we're not setting it up here.

--- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h    2024-09-21 19:24:15.000000000 -0300
+++ Marlin/src/pins/esp32/pins_MKS_TINYBEE.h    2024-09-24 17:54:31.802649080 -0300
@@ -187,6 +187,17 @@
     #if ALL(MKS_MINI_12864_V3, HAS_MEDIA)
       #define PAUSE_LCD_FOR_BUSY_SD
     #endif
+  #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
+    CONTROLLER_WARNING("BOARD_MKS_TINYBEE", "ZONESTAR_LCD")
+
+     // Todo: check beeper
+     // #undef BEEPER_PIN
+      #define LCD_PINS_D4            EXP1_05_PIN
+      #define LCD_PINS_D5            EXP1_06_PIN
+      #define LCD_PINS_D6            EXP1_07_PIN
+      #define LCD_PINS_D7            EXP1_08_PIN
+
+     #define ADC_KEYPAD_PIN                 TEMP_1_PIN  // IO34, REMEMBER TO CHANGE THE REFERENCE FOR THE BOARD and make appropiate circuit changes!
   #else
    #define LCD_PINS_D4               EXP1_05_PIN
     #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)

Bug Timeline

I do not know

Expected behavior

I expect no serial issues and the printing to go normal

Actual behavior

The printer starts throwing a "Serial status mismatch" error and the printing stops (because of the detected error, from the host).

Steps to Reproduce

  1. Flash the config.
  2. Print anything.

Version of Marlin Firmware

bugfix-2.1.x

Printer model

Anet A6

Electronics

MKS TinyBee, 4x TMC2209 drivers w/ UART, HD44780 LCD w/ ADC buttons

LCD/Controller

LCD_ZONESTAR with appropiate wiring changes

Other add-ons

No response

Bed Leveling

ABL Bilinear mesh

Your Slicer

Cura

Host Software

OctoPrint

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant