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.29k stars 19.24k forks source link

[BUG] 2.0.9.3 Compile errors in module #23411

Closed brosskgm closed 2 years ago

brosskgm commented 2 years ago

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

Yes, and the problem still exists.

Bug Description

Log Output ``` In file included from Marlin/src/module/../inc/../HAL/./LPC1768/HAL.h:39, from Marlin/src/module/../inc/../HAL/HAL.h:30, from Marlin/src/module/../inc/MarlinConfig.h:31, from Marlin/src/module/endstops.h:28, from Marlin/src/module/endstops.cpp:27: Marlin/src/module/endstops.cpp: In static member function 'static void Endstops::update()': Marlin/src/module/endstops.cpp:736:32: error: 'Z2_MAX' was not declared in this scope; did you mean 'Z_MAX'? 736 | COPY_LIVE_STATE(Z_MAX, Z2_MAX); | ^~~~~~ Marlin/src/module/../inc/../HAL/./LPC1768/../shared/Marduino.h:42:23: note: in definition of macro '_BV' 42 | #define _BV(b) (1 << (b)) | ^ Marlin/src/module/../inc/../core/macros.h:104:40: note: in expansion of macro 'SBI' 104 | #define SET_BIT_TO(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0) | ^~~ Marlin/src/module/endstops.cpp:618:45: note: in expansion of macro 'SET_BIT_TO' 618 | #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT)) | ^~~~~~~~~~ Marlin/src/module/endstops.cpp:736:9: note: in expansion of macro 'COPY_LIVE_STATE' 736 | COPY_LIVE_STATE(Z_MAX, Z2_MAX); | ^~~~~~~~~~~~~~~ Marlin/src/module/endstops.cpp:736:32: error: 'Z2_MAX' was not declared in this scope; did you mean 'Z_MAX'? 736 | COPY_LIVE_STATE(Z_MAX, Z2_MAX); | ^~~~~~ Marlin/src/module/../inc/../HAL/./LPC1768/../shared/Marduino.h:42:23: note: in definition of macro '_BV' 42 | #define _BV(b) (1 << (b)) | ^ Marlin/src/module/../inc/../core/macros.h:104:55: note: in expansion of macro 'CBI' 104 | #define SET_BIT_TO(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0) | ^~~ Marlin/src/module/endstops.cpp:618:45: note: in expansion of macro 'SET_BIT_TO' 618 | #define COPY_LIVE_STATE(SRC_BIT, DST_BIT) SET_BIT_TO(live_state, DST_BIT, TEST(live_state, SRC_BIT)) | ^~~~~~~~~~ Marlin/src/module/endstops.cpp:736:9: note: in expansion of macro 'COPY_LIVE_STATE' 736 | COPY_LIVE_STATE(Z_MAX, Z2_MAX); | ^~~~~~~~~~~~~~~ Marlin/src/module/endstops.cpp:933:60: error: 'Z2_MAX' was not declared in this scope; did you mean 'Z_MAX'? 933 | #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX) | ^ Marlin/src/module/../inc/../HAL/./LPC1768/../shared/Marduino.h:42:23: note: in definition of macro '_BV' 42 | #define _BV(b) (1 << (b)) | ^ Marlin/src/module/endstops.cpp:861:34: note: in expansion of macro 'TEST' 861 | #define TEST_ENDSTOP(ENDSTOP) (TEST(state(), ENDSTOP)) | ^~~~ Marlin/src/module/endstops.cpp:885:64: note: in expansion of macro 'TEST_ENDSTOP' 885 | const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(A, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(A##2, MINMAX)) << 1); \ | ^~~~~~~~~~~~ Marlin/src/module/endstops.cpp:608:32: note: in expansion of macro '__ENDSTOP' 608 | #define _ENDSTOP(AXIS, MINMAX) __ENDSTOP(AXIS, MINMAX) | ^~~~~~~~~ Marlin/src/module/endstops.cpp:885:77: note: in expansion of macro '_ENDSTOP' 885 | const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(A, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(A##2, MINMAX)) << 1); \ | ^~~~~~~~ Marlin/src/module/endstops.cpp:933:39: note: in expansion of macro 'PROCESS_DUAL_ENDSTOP' 933 | #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX) | ^~~~~~~~~~~~~~~~~~~~ Marlin/src/module/endstops.cpp:1044:13: note: in expansion of macro 'PROCESS_ENDSTOP_Z' 1044 | PROCESS_ENDSTOP_Z(MAX); | ^~~~~~~~~~~~~~~~~ *** [.pio/build/LPC1768/src/src/module/endstops.cpp.o] Error 1 ```

Bug Timeline

New. 8:00pm MST

Expected behavior

Compile

Actual behavior

Would not compile.

Old version 2.0.7.

Steps to Reproduce

Download and compile.

Version of Marlin Firmware

2.0.9.3

Printer model

i3 Mega

Electronics

SKR v1.3 TMC2208, No srtand off boards

Add-ons

No response

Bed Leveling

MBL Manual Bed Leveling

Your Slicer

No response

Host Software

No response

Additional information & file uploads

Configuration files.zip

ellensp commented 2 years ago

code seems to be making assumption that if you have dual Z, your second z endstop is on z-max if z-max is defined

If you comment out line 78 of Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h ie #define Z_MAX_PIN P1_24 // Z+

It will let you compile, at least get you going, but this is just a work around while issue is looked it

brosskgm commented 2 years ago

I do have dual z. I thought I enabled it just like I did in the old config. I have all changes marked //// Changed. I'll do another compare of my two config files and try again.

Thanks

descipher commented 2 years ago

Do you have 2 physical end stop switches on the Z axis? I'm certain you don't have to touch #define COOLER_AUTO_FAN_TEMPERATURE 18 It's a Laser cooler. I don't see a bug here yet.

descipher commented 2 years ago

Try commenting out #define Z_MULTI_ENDSTOPS for now.

descipher commented 2 years ago

Confirmed BUG!

_ES_ITEM MACRO not evaluating under the the correct conditions for ES PLUG usage.

22487

22525

diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h
index a35966a98c..00ad046a97 100644
--- a/Marlin/src/module/endstops.h
+++ b/Marlin/src/module/endstops.h
@@ -46,17 +46,28 @@ enum EndstopEnum : char {
   _ES_ITEM(HAS_K_MIN, K_MIN)
   _ES_ITEM(HAS_K_MAX, K_MAX)

+
   // Extra Endstops for XYZ
-  _ES_ITEM(HAS_X2_MIN, X2_MIN)
-  _ES_ITEM(HAS_X2_MAX, X2_MAX)
-  _ES_ITEM(HAS_Y2_MIN, Y2_MIN)
-  _ES_ITEM(HAS_Y2_MAX, Y2_MAX)
-  _ES_ITEM(HAS_Z2_MIN, Z2_MIN)
-  _ES_ITEM(HAS_Z2_MAX, Z2_MAX)
-  _ES_ITEM(HAS_Z3_MIN, Z3_MIN)
-  _ES_ITEM(HAS_Z3_MAX, Z3_MAX)
-  _ES_ITEM(HAS_Z4_MIN, Z4_MIN)
-  _ES_ITEM(HAS_Z4_MAX, Z4_MAX)
+  #if ENABLED(X_DUAL_ENDSTOPS)
+    _ES_ITEM(HAS_X_MIN, X2_MIN)
+    _ES_ITEM(HAS_X_MAX, X2_MAX)
+  #endif
+  #if ENABLED(Y_DUAL_ENDSTOPS)
+    _ES_ITEM(HAS_Y_MIN, Y2_MIN)
+    _ES_ITEM(HAS_Y_MAX, Y2_MAX)
+  #endif
+  #if ENABLED(Z_MULTI_ENDSTOPS)
+    _ES_ITEM(HAS_Z_MIN, Z2_MIN)
+    _ES_ITEM(HAS_Z_MAX, Z2_MAX)
+    #if NUM_Z_STEPPER_DRIVERS >= 3
+      _ES_ITEM(HAS_Z_MIN, Z3_MIN)
+      _ES_ITEM(HAS_Z_MAX, Z3_MAX)
+    #endif
+    #if NUM_Z_STEPPER_DRIVERS >= 4
+      _ES_ITEM(HAS_Z_MIN, Z4_MIN)
+      _ES_ITEM(HAS_Z_MAX, Z4_MAX)
+    #endif
+  #endif

   // Bed Probe state is distinct or shared with Z_MIN (i.e., when the probe is the only Z endstop)
   #if !HAS_DELTA_SENSORLESS_PROBING
brosskgm commented 2 years ago

Do you have 2 physical end stop switches on the Z axis? I'm certain you don't have to touch #define COOLER_AUTO_FAN_TEMPERATURE 18 It's a Laser cooler. I don't see a bug here yet.

Yes. It's a Mega S that I now have SKR v1.3 and no stand off boards, I re-wired it all to run straight off the SKR.

Ok, I wasn't sure about the cooler fan but only disabled it. It didn't say anything about ot being a laser cooler.

descipher commented 2 years ago

Ok just wanted to confirm, I have it compiling correctly with the posted diff, but there maybe more to deal with.

brosskgm commented 2 years ago

Only gave couple errors, nothing to prevent from trying it.

Marlin/src/inc/Warnings.cpp:179:4: warning: #warning "Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." [-Wcpp] 179 | #warning "Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs." | ^~~ Marlin/src/inc/Warnings.cpp:548:4: warning: #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled." [-Wcpp] 548 | #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled."

descipher commented 2 years ago
- remove
+ add
descipher commented 2 years ago

The warnings are not an issue.

brosskgm commented 2 years ago

Does not boot. "No Printer Attached"

brosskgm commented 2 years ago

define MOTHERBOARD BOARD_BTT_SKR_V1_3

Did they change the define for this one? I remeber that happening some time ago.

descipher commented 2 years ago

You need to pull the latest changes. A fix was applied for that issue very recently.

brosskgm commented 2 years ago

Ok, I'll get it now.

brosskgm commented 2 years ago

Most of the time I just keep old until new works, but I'm wanting the latest this time because I'm working to add BLTOUCH and keep dual Z and to get bltouch to run from Y+, but haven't been able to find anyone that has config information on it yet.

brosskgm commented 2 years ago

Downloaded the nightly, and just compiled. I have to check BTT file. Still no printer attached.

brosskgm commented 2 years ago

Same define. #define BOARD_BTT_SKR_V1_3 in boards.h

brosskgm commented 2 years ago

BTW I'm using Visual Studio for Ubuntu 20.4

brosskgm commented 2 years ago

The printer also shows, System Unknown, but that could be because the printer hasn't attached.

descipher commented 2 years ago

Is the backlight on? Does the Marlin logo come up?

brosskgm commented 2 years ago

When I plug in the TFT24 it does, and also shows eprom version error and will need to reset.

LEt me reset and see what it does.

descipher commented 2 years ago

TFT24? //// Changed Enabled

define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

brosskgm commented 2 years ago

Ok, here is an odd one. With the TFT35 V2.0 it does not connect to printer, the TFT24 after I initialized the eeprom it does.

brosskgm commented 2 years ago

I have it set up I can use both when I'm doing manual mesh level.

brosskgm commented 2 years ago

The old setup 2.0.7.3 does fine with either screen.

descipher commented 2 years ago

Ok, test it out. The EEPROM need to be reset.

brosskgm commented 2 years ago

I did, still same thing. Does not connect through the TFT35 but does fine with TFT24. Oh, the TFT24 is in Marlin mode sees the printer, but when I switch to touch on the TFT24 it says no printer attached also.

brosskgm commented 2 years ago

Somethign with the touch mode in this latest version is not connecting with the touch side of things.

descipher commented 2 years ago

you have set it up for Marlin Mode.. no touch screen etc .. //// Changed Enabled

define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

You need to work on the display config before continuing with the other issues. You can get help via https://discord.gg/DK6ss3ep see # support

brosskgm commented 2 years ago

Ok, old version does fine in either mode. Something different between the two setups.

I'll need to work on it.

Thanks for all your help.

descipher commented 2 years ago

Yes I understand but you are not clear on what display you have.
This may help understand the configuration elements. https://www.youtube.com/watch?v=DodRRgZf5Lo

brosskgm commented 2 years ago

Yes I understand but you are not clear on what display you have. This may help understand the configuration elements. https://www.youtube.com/watch?v=DodRRgZf5Lo

That picture in your link is TFT35V3.0 - It has the turner knob. Mine is V2.0 no turner knob.

I guess if they don't show this type in V2.0 everywhere without the truner knob I can see where someone would think one doesn't know their own equipment.

I took it out of it's housing to send you a photo.

TFT35V2 0

thinkyhead commented 2 years ago

Endstop handling needs a general overhaul, so that's happening over at #23425. It should be ready to test at some point today.

ahaddad91 commented 2 years ago

check if the reset pin is oriented correctly on the motherboard for the TFT

github-actions[bot] commented 2 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.