luc-github/ESP3DLib

FYSECT e4 ESP3D TMC2209 UART driver error

yoroboticscolombia opened this issue · 28 comments

Hi, I have a fysect board, but I upload Marlin without esp3d support enabled, the connection works good, however if I enable esp3d support I get driver error, Im not sure if its related to esp3d, please guide me.

18:58:52.344 : E (5870) uart: uart_get_buffered_data_len(1342): uart driver error

image

image

what can be causing this.
I have already knowledge of marlin and esp3d.

ESP3D Firmware:

ESP3D FW version: [3.0]
ESP3D-WebUI Version:[3.0]
Wifi mode:STA]
Flash method: PlatformIO

Name: [Marlin]
Version [bugfix-2.1.x]
Board used

MCU:[e.g. ESP32]
Name:[e.g. fysect e4]
Flash size: [16M]

thanks.

Thank your for submiting, please be sure you followed template or your issue may be dismissed. if you deleted the template it is here

ESP3D is not supposed to be used with FYSECT e4, Marlin mainstream use ESP3DLib V1 so I do not understand your configuration

The TMC Uart configuration is not easy - did you tried standalone configuration ?

Also please try Marlin latest release version also - not bug fix

ESP3DLib V1

Thank you so much, yes Im trying yo use it with marlin, can you tell me wich is the best marlin file to use, now Im confused with the repositories, since some wont compile with visual studio,

Thanks.

what issue did you get with released version of Marlin ?

it happens, that the fysect has the tmc2209, with uart, so its not possible to change the current, when enable esp3d support in advanced.h, i get this:

uart: uart_get_buffered_data_len(1342): uart driver error

when I disable the esp3d, the connection to the driver is ok,

do you think its something related to the serial that handles the steppers with the esp3d?

yes the configuration may be incorrect because esp3dlib does not use any uart, it use fake serial but use SERIAL_PORT_2 - so you may wrongly configure SERIAL_PORT_2 as the one used by TMCDrivers also
I am not expert sorry for TMC drivers

thanks, that clarify more for me, but esp3d does not connect to marlin if I dont enable serial port 1, in configuration.h,

did you checked how FYSETC configure the board ?
https://github.com/FYSETC/FYSETC-E4/tree/main/firmware/Marlin/Marlin

Thanks, Yes, its the same, however that marlin does not compile, it has a lot of errors in visual, but the pinout is the same, it looks that something is conflicting, if I disable tmc driver, it works, but the motors get too hot, but the marlin in the fystect repository has all features,

Is there any way to change the esp3d baud rate for the fake serial port? because i see the baud of the tmc is 115200, but the baud rate of teh esp3d is 250.000, may be thats something to do.

esp3d does not use real serial change Marlin serial baudrate to change baudrate

Thanks, I tried somehow the tmc are making the esp32 to fail, can you tell me for the esp32 of fysetc e4, which is the best firmware using esp3d, thanks.

should be latest release of Marlin , bugfix is not supposed to be stable but test version
because it is Marlin configuration issue, did you asked on Marlin discord ?

Yes, and they closed it, since said I have to search my own, Im still trying to compile the firmware that was uploaded by fysetc, but it looks like it was compiled in ubuntu, its kind of frustrating,

I used the latest Marlin release https://github.com/MarlinFirmware/Marlin/releases/tag/2.1.2.1
configured board same as https://github.com/FYSETC/FYSETC-E4/tree/main/firmware/Marlin/Marlin for board, SD and TMC drivers (there are several settings to change)
applied the patch I suggested here to pass the compilation issue : MarlinFirmware/Marlin#25743 (comment)

 *  Executing task: C:\Users\luc\.platformio\penv\Scripts\platformio.exe run --environment FYSETC_E4 

Processing FYSETC_E4 (platform: espressif32@2.1.0; board: esp32dev; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (2.1.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.10004.210126 (1.0.4) 
 - tool-esptoolpy @ 1.30000.201119 (3.0.0) 
 - toolchain-xtensa32 @ 2.50200.97 (5.2.0)
Converting Marlin.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 32 compatible libraries
Scanning dependencies...
Dependency Graph
|-- TMCStepper @ 0.7.3
|-- AsyncTCP @ 1.1.1
|-- ESP Async WebServer @ 1.2.3
|-- ESP3DLib @ 1.0.12
|-- WebSockets @ 2.3.4
|-- ESP32SSDP @ 1.1.1
|-- SPI @ 1.0
|-- EEPROM @ 1.0.3
|-- ArduinoOTA @ 1.0
|-- ESPmDNS @ 1.0
|-- WiFi @ 1.0
|-- FS @ 1.0
|-- SPIFFS @ 1.0
|-- Wire @ 1.0.1
Building in release mode
Compiling .pio\build\FYSETC_E4\src\src\inc\Warnings.cpp.o
Marlin/src/inc/Warnings.cpp:67:4: warning: #warning "Your Configuration provides no method to acquire user feedback!" [-Wcpp]
   #warning "Your Configuration provides no method to acquire user feedback!"
    ^
cc1plus.exe: warning: unrecognized command line option '-Wno-register'
Retrieving maximum program size .pio\build\FYSETC_E4\firmware.elf
Checking size .pio\build\FYSETC_E4\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  15.5% (used 50664 bytes from 327680 bytes)
Flash: [==        ]  15.7% (used 1029804 bytes from 6553600 bytes)
========================================================================================== [SUCCESS] Took 13.23 seconds ==========================================================================================

Environment    Status    Duration
-------------  --------  ------------
FYSETC_E4      SUCCESS   00:00:13.229
=========================================================================================== 1 succeeded in 00:00:13.229 ===========================================================================================
 *  Terminal will be reused by tasks, press any key to close it.

and I get :

⸮⸮@y=⸮/⸮ƭ@⸮�B⸮J⸮�Y⸮9@c⸮⸮⸮#y⸮!ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5828
entry 0x400806ac
start
 External Reset
 Brown out Reset
 Watchdog Reset
Marlin 2.1.2.1
echo: Last Updated: 2023-05-16 | Author: (none, default config)
echo: Compiled: Dec  8 2023
echo: Free Memory: 297736  PlannerBufferBytes: 1280
echo:AP started 
echo:192.168.0.1
echo:HTTP server started
echo:Hardcoded Default Settings Loaded
echo:; Linear Units:
echo:  G21 ; (mm)
echo:; Temperature Units:
echo:  M149 C ; Units in Celsius
echo:; Filament settings (Disabled):
echo:  M200 S0 D1.75
echo:; Steps per unit:
echo:  M92 X80.00 Y80.00 Z400.00 E500.00
echo:; Max feedrates (units/s):
echo:  M203 X300.00 Y300.00 Z5.00 E25.00
echo:; Max Acceleration (units/s2):
echo:  M201 X3000.00 Y3000.00 Z100.00 E10000.00
echo:; Acceleration (units/s2) (P<print-accel> R<retract-accel> T<travel-accel>):
echo:  M204 P3000.00 R3000.00 T3000.00
echo:; Advanced (B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate> J<junc_dev>):
echo:  M205 B20000.00 S0.00 T0.00 J0.01
echo:; Home offset:
echo:  M206 X0.00 Y0.00 Z0.00
echo:; Hotend PID:
echo:  M301 P22.20 I1.08 D114.00
echo:; Stepper driver current:
echo:  M906 X650 Y650 Z800
echo:  M906 T0 E600

echo:; Driver stepping mode:
echo:  M569 S1 X Y Z
echo:  M569 S1 T0 E
Testing X connection... OK
Testing Y connection... OK
Testing Z connection... OK
Testing E connection... OK
echo:192.168.0.1
echo:SD card ok

So your issue is definitly your configuration settings

Thank you so much for your guidance, I was able to flash the board, couple changes I had to make is that I changed the esp32 module from the board, so it kept resetting, so I put board_build.partitions = huge_app.csv
board_build.f_flash = 40000000L, and it worked, good, tmc connection good, and esp3d portal working, however usb works good, but the control from the esp3d webui, it does not do nothing, and it cannot open the printer settings, can you check if this happen to you too,

image

image

what could be causing it,

you did not configured ESP3D in Marlin : https://esp3d.io/esp3dlib/v1.x/installation/index.html

I did not changed anything in platformio.ini because it is correct - I do not understand why you had to change the values you mentionned :
image

Hello, after many attempts, I finally got it flashed, Thank you so much, its a shame the esp3d v3 version is not yet implemented in marlin, since de current one sometimes crashes, along with the serial port freezes the printer if the usb is being used, however if you have some to test, Id like to do it, since the board, is very powerful,

image

I made the changes because I desoldered the current chip, and replaced it with a 16MB flash chip.

I made the changes because I desoldered the current chip, and replaced it with a 16MB flash chip.

why did you do that ? The E4 is already a 16MB flash ESP32

The board I received, had a 4MB chip,

The E4 ? you should return it
image

So your serial issue may be an hardware issue also

I bought it like 6 months ago, so I was testing until now, thats why.
But why marlin has not made the changes to the original repository? so It can be build,
I saw in your repository marlin with esp3d v3, thats the one I tested at the beggining, but I got the serial messages,

Hmm current version of Marlin already have 16MB for E4: https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.1.x/ini/esp32.ini#L29 not sure to understand your meaning

ESP3D 3.0 is not yet ready to be released so I did not pushed to Marlin yet, it is usable for sure but I did not tested all config yet

yes that my fork - I modified them to test ESP3Dlib v3 because it use different platformio/arduino core than current one so it also affect Marlin code, so I had to modify some part of Marlin

I close issue - I managed to fix my fork of Marlin for ESP3DLib 3.0 to make it work :
Here the config files for the bugfix-2.1.x
https://github.com/luc-github/MarlinConfigurations/tree/bugfix-2.1.x/config/examples/FYSETC/E4

And my fork based on latest bugfix-2.1.x : https://github.com/luc-github/Marlin/tree/ESP3DLib-V3-bugfix-2.1.x

Thank you so much, I tested in the fystect board, and it works very well, the only thing is that the sd files are not listed, is sd printing not supported in the v3 version?
sd support is enabled and the files are listed with the m20 command, but they dont show in the panel, do you need to open a new issue?
image

Thanks, good job.

SD is working on my side :
image

Check the setting for the sd speed factor
image

And yes please open new issue with all informations of webui version and sd card caracteristics

Thank you, I changed that already and the sd card was recognised, but not all files are shown, if I choose sd, no more than 15 files are shown, but if i choose extra sd, all files come

image