-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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] enabling #define PSU_CONTROL with TMC2130 drivers causes Marlin not to start #24263
Comments
TMC2130 is a stepper driver with SPI communications.
Edit It turns out the Ramps 1.6 Plus does indeed use hardware SPI ports for SPI communications to stepper drivers. |
Thanks for the help |
Presuming it is using hardware SPI In Marlin/src/MarlinCore.cpp is
powerManager.init(); looks like this
power_on looks like this
This calls restore_stepper_drivers(); But this code uses SPI which has not been setup yet Back to Marlin/src/MarlinCore.cpp we find
We need this to be called before
So... --- a/Marlin/src/MarlinCore.cpp
+++ b/Marlin/src/MarlinCore.cpp
@@ -1241,6 +1241,13 @@ void setup() {
SETUP_RUN(tmc_serial_begin());
#endif
+ #if HAS_TMC_SPI
+ #if DISABLED(TMC_USE_SW_SPI)
+ SETUP_RUN(SPI.begin());
+ #endif
+ SETUP_RUN(tmc_init_cs_pins());
+ #endif
+
#if ENABLED(PSU_CONTROL)
SETUP_LOG("PSU_CONTROL");
powerManager.init();
@@ -1258,13 +1265,6 @@ void setup() {
SETUP_RUN(disableStepperDrivers());
#endif
- #if HAS_TMC_SPI
- #if DISABLED(TMC_USE_SW_SPI)
- SETUP_RUN(SPI.begin());
- #endif
- SETUP_RUN(tmc_init_cs_pins());
- #endif
-
SETUP_RUN(hal.init_board());
SETUP_RUN(esp_wifi_init()); This doesn't lockup, but once again I cannot test it (I could if I had some tmc2130's and some wires,,) , Please try this, |
Hi |
I have created a PR to fix this in marlin going forward. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Did you test the latest
bugfix-2.0.x
code?Yes, and the problem still exists.
Bug Description
If I use #define PSU_CONTROL with TMC2130 drivers Marlin does not start up.
On the serial terminal i get start and then nothing else. (No LCD etc..)
If #define PSU_CONTROL is commented out then Marlin starts as normal.
Mainboard is a MEGA2650
Bug Timeline
Not sure only noticed once the TMC2130's were fitted
Expected behavior
Work as normal
Actual behavior
Hangs on start
Steps to Reproduce
Version of Marlin Firmware
02000903
Printer model
RepRap
Electronics
Ramps 1.6 Plus and MEGA2650
Add-ons
No response
Bed Leveling
No response
Your Slicer
Cura
Host Software
No response
Additional information & file uploads
Configfiles.zip
The text was updated successfully, but these errors were encountered: