Skip to content
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] 2.0.9.3 Compile errors in module #23411

Closed
brosskgm opened this issue Jan 1, 2022 · 35 comments
Closed

[BUG] 2.0.9.3 Compile errors in module #23411

brosskgm opened this issue Jan 1, 2022 · 35 comments

Comments

@brosskgm
Copy link

brosskgm commented Jan 1, 2022

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
Copy link
Contributor

ellensp commented Jan 1, 2022

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
Copy link
Author

brosskgm commented Jan 1, 2022

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
Copy link
Contributor

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
Copy link
Contributor

Try commenting out #define Z_MULTI_ENDSTOPS for now.

@descipher
Copy link
Contributor

descipher commented Jan 1, 2022

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
Copy link
Author

brosskgm commented Jan 1, 2022

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
Copy link
Contributor

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

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

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
Copy link
Contributor

descipher commented Jan 1, 2022

- remove
+ add

@descipher
Copy link
Contributor

The warnings are not an issue.

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

Does not boot. "No Printer Attached"

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

#define MOTHERBOARD BOARD_BTT_SKR_V1_3

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

@descipher
Copy link
Contributor

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

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

Ok, I'll get it now.

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

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
Copy link
Author

brosskgm commented Jan 1, 2022

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

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

Same define. #define BOARD_BTT_SKR_V1_3 in boards.h

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

BTW I'm using Visual Studio for Ubuntu 20.4

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

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

@descipher
Copy link
Contributor

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

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

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
Copy link
Contributor

TFT24?
//// Changed Enabled
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

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
Copy link
Author

brosskgm commented Jan 1, 2022

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

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

The old setup 2.0.7.3 does fine with either screen.

@descipher
Copy link
Contributor

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

@brosskgm
Copy link
Author

brosskgm commented Jan 1, 2022

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
Copy link
Author

brosskgm commented Jan 1, 2022

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

@descipher
Copy link
Contributor

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
Copy link
Author

brosskgm commented Jan 1, 2022

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.

@brosskgm brosskgm closed this as completed Jan 1, 2022
@descipher
Copy link
Contributor

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
Copy link
Author

brosskgm commented Jan 1, 2022

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
Copy link
Member

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

@ahaddad91
Copy link

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

@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants