Skip to content

Hardware serial communication with first TMC driver not working after reset #23809

@fennermichael

Description

@fennermichael

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

Yes, and the problem still exists.

Bug Description

I am using a new BTT SKR 2.0 Rev. B board with the latest (and fast) STM32F429 MCU.
I tested with 4 or 5 TMC2209 drivers (single-Z or dual-Z).
I have re-wired the the board so that I can use Serial1 and Serial 3 for hardware serial communication to the TMC2209 drivers.
Y, Z are connected to Serial3
X, Z2, E0 are connected to Serial1

I have noticed that on first start (when the EEPROM will be initialized - EEPROM_INIT_NOW is defined, EEPROM_BOOT_SILENT is defined) everything works as expected. Every consecutive start (when the settings are loaded from EEPROM) the communication with the (first) TMC driver fails.

For debugging I have tried various assignments of addresses and serial ports to my X,Y,Z,E0,Z2 drivers - whatever I do I have issues with the first (X) axis on the second startup and later. At first start everything is always ok, but on any following reset or cold start the X-driver is not accessible on boot anymore. This only affects the first axis, independent of the socket the driver is plugged in and independent of the UART address that the X-driver is assigned to.

Here you see a start after flashing a new firmware (ok), followed by a software reset (X driver communication fails)

TMC_not_ready_issue2

As a work-around, the EEPROM_BOOT_SILENT can be undefined.
Then everything works fine, at first start and every later start.

EEPROM_issue_non_silent2

I suppose this is related to the fast MCU - if the communication to the TMC driver takes place too fast after power-up, the chip is not ready to respond. The initialization of the EEPROM or the printout of the values consume some time and introduce some startup delay. If this delay is present, the communication starts when the TMC chip is ready and everything is ok.

Bug Timeline

I tested Marlin 2.0.9.3 tag and later versions, the problem persists

Expected behavior

It is expected that all TMC drivers can be initialized upon start, regardles if settings are loaded from EEEPROM or not or debug messages are active or not

Actual behavior

Communication with first TMC driver is only posssible when there is some initial delay before accessing the TMC drivers

Steps to Reproduce

#define EEPROM_SETTINGS, #define EEPROM_BOOT_SILENT, start and reset.

Version of Marlin Firmware

2.0.9.3 tag and latest 2.0.9.3 (Feb 26 2022 13:20:15)

Printer model

Creality Ender-5

Electronics

Ender-5 with BTT SKR 2.0 Rev. B Mainboard and STM32F429 MCU

Add-ons

No response

Bed Leveling

No response

Your Slicer

Cura

Host Software

No response

Additional information & file uploads

configuration_pins_and_variant2.zip

(About a hint how I can avoid editing the variant.h to allow using the hardware serial ports I would be very happy.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions