MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.3k stars 19.25k forks source link

[BUG] PINS_DEBUGGING conflicts with DUAL_STEPPER_DRIVERS #15399

Closed Kurolox closed 5 years ago

Kurolox commented 5 years ago

Description

It seems that if you try to enable PINS_DEBUGGING and Z_DUAL_STEPPER_DRIVERS (I haven't checked for X and Y, or triple Z) at the same time, the firmware won't compile due to the following errors:

In file included from Marlin/src/gcode/config/M43.cpp:29:0:
Marlin/src/gcode/config/../../inc/../pins/pins.h:964:21: error: 'E1_MS1_PIN' was not declared in this scope
 #define __EPIN(p,q) E##p##_##q##_PIN

Marlin/src/gcode/config/../../inc/../pins/pins.h:964:21: error: 'E1_MS2_PIN' was not declared in this scope
 #define __EPIN(p,q) E##p##_##q##_PIN

Marlin/src/gcode/config/../../inc/../pins/pins.h:964:21: error: 'E1_MS3_PIN' was not declared in this scope
 #define __EPIN(p,q) E##p##_##q##_PIN

It seems like the firmware is trying to access to the extruder E1 pins, which should've been redefined as Z1, and since they aren't defined it's refusing to compile.

Steps to Reproduce

  1. Clone the repository and checkout the 2.0.0 branch (at commit https://github.com/MarlinFirmware/Marlin/commit/a6b0223eead964237e7920c35bb3c7757b722139 when writing this)
  2. on adv_configuration.h, uncomment //#define Z_DUAL_STEPPER_DRIVERS and //#define PINS_DEBUGGING
  3. Attempt to compile the firmware Expected behavior: The firmware should compile

Actual behavior: The firmware fails to compile with the errors mentioned previously

Additional Information

InsanityAutomation commented 5 years ago

I can confirm this, I ran into it the other day and didnt have time to chase further.

sjasonsmith commented 5 years ago

As a workaround, you can define the following somewhere. I can't promise it won't cause problems somewhere, but I assume if you aren't using SPI drivers, these will never be used.

#define Z2_CS_PIN 0
#define Z2_MS1_PIN 0
#define Z2_MS2_PIN 0
#define Z2_MS3_PIN 0

If you have three Z steppers, do the same for Z3 as well.

otherguy commented 5 years ago

@sjasonsmith thanks! I just ran into this as well.

The thing is, I do have SPI drivers (TMC5160). What's the correct workaround here? Will it work with PINS_DEBUGGING disabled? It compiles, but will Z2 (E1) actually work?

boelle commented 5 years ago

@sjasonsmith @otherguy any idea on how we could solve this one?

otherguy commented 5 years ago

@boelle I wish I knew what the problem is.

I did not go for the workaround mentioned by @sjasonsmith because, as I expected, my SPI drivers didn’t work.

For now I have Z_DUAL_STEPPER_DRIVERS enabled and PINS_DEBUGGING disabled and this works.

sjasonsmith commented 5 years ago

I think somebody fixed this. It seems to build fine for me.

@Kurolox or @otherguy, can one of you try it out with the latest commit from bugfix-2.0.x?

otherguy commented 5 years ago

@sjasonsmith can confirm it works! Thank you!

boelle commented 5 years ago

will close

add @ in front of my username if we should reopen

github-actions[bot] commented 4 years ago

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.