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

[Fixed Probe Min and Dual Z Endstops Max] (Compile Error) #22774

Closed
SafChand opened this issue Sep 14, 2021 · 4 comments
Closed

[Fixed Probe Min and Dual Z Endstops Max] (Compile Error) #22774

SafChand opened this issue Sep 14, 2021 · 4 comments

Comments

@SafChand
Copy link

SafChand commented Sep 14, 2021

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

Yes, and the problem still exists.

Bug Description

Using an older version of marlin 2.0x Bugfix Inductive sensor for Z Min and Dual Z Endstops at Z Max were working. Latest Bugfix 2.0x gives me a compile error.

On G28 Printer should go to Z Max to level out the gantry then use the probe when going to print at Z Min.

I AM Using the Inductive Probe on Z_MIN Endstop,

Z_MAX and Y_MAX endstops are being used for the Microswitches.

I have attached both Configs, the ones that work on an older branch of marlin and the ones not functioning on the newset bugfix

Log Output
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/megaatmega2560.html
PLATFORM: Atmel AVR (3.4.0) > Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)
HARDWARE: ATMEGA2560 16MHz, 8KB RAM, 248KB Flash
DEBUG: Current (avr-stub) On-board (avr-stub, simavr)
PACKAGES:
 - framework-arduino-avr 5.1.0
 - toolchain-atmelavr 1.70300.191015 (7.3.0)
Converting Marlin.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 6 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <LiquidCrystal> 1.5.1
|   |-- <Wire> 1.0
|-- <Wire> 1.0
|-- <SPI> 1.0
|-- <EEPROM> 2.0
|-- <SoftwareSerial> 1.0
Building in release mode
Compiling .pio\build\mega2560\src\src\module\endstops.cpp.o
In file included from Marlin\src\module\../inc/../HAL/./AVR/HAL.h:22:0,
                 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:932:60: error: 'Z2_MIN' was not declared in this scope   
     #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX)
                                                            ^
Marlin\src\module\../inc/../HAL/./AVR/../shared/Marduino.h:42:25: note: in definition of macro '_BV'
 #define _BV(b) (1UL << (b))
                         ^
Marlin\src\module\endstops.cpp:860:34: note: in expansion of macro 'TEST'
   #define TEST_ENDSTOP(ENDSTOP) (TEST(state(), ENDSTOP))
                                  ^~~~
Marlin\src\module\endstops.cpp:884:64: note: in expansion of macro 'TEST_ENDSTOP'       
     const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(A, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(A##2, MINMAX)) << 1); \
                                                                ^~~~~~~~~~~~
Marlin\src\module\endstops.cpp:607:32: note: in expansion of macro '__ENDSTOP'
 #define _ENDSTOP(AXIS, MINMAX) __ENDSTOP(AXIS, MINMAX)
                                ^~~~~~~~~
Marlin\src\module\endstops.cpp:884:77: note: in expansion of macro '_ENDSTOP'
     const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(A, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(A##2, MINMAX)) << 1); \
                                                                             ^~~~~~~~   
Marlin\src\module\endstops.cpp:932:39: note: in expansion of macro 'PROCESS_DUAL_ENDSTOP'
     #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX)
                                       ^~~~~~~~~~~~~~~~~~~~
Marlin\src\module\endstops.cpp:1023:13: note: in expansion of macro 'PROCESS_ENDSTOP_Z' 
           ) PROCESS_ENDSTOP_Z(MIN);
             ^~~~~~~~~~~~~~~~~
Marlin\src\module\endstops.cpp:932:60: note: suggested alternative: 'Z_MIN'
     #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX)
                                                            ^
Marlin\src\module\../inc/../HAL/./AVR/../shared/Marduino.h:42:25: note: in definition of macro '_BV'
 #define _BV(b) (1UL << (b))
                         ^
Marlin\src\module\endstops.cpp:860:34: note: in expansion of macro 'TEST'
   #define TEST_ENDSTOP(ENDSTOP) (TEST(state(), ENDSTOP))
                                  ^~~~
Marlin\src\module\endstops.cpp:884:64: note: in expansion of macro 'TEST_ENDSTOP'       
     const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(A, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(A##2, MINMAX)) << 1); \
                                                                ^~~~~~~~~~~~
Marlin\src\module\endstops.cpp:607:32: note: in expansion of macro '__ENDSTOP'
 #define _ENDSTOP(AXIS, MINMAX) __ENDSTOP(AXIS, MINMAX)
                                ^~~~~~~~~
Marlin\src\module\endstops.cpp:884:77: note: in expansion of macro '_ENDSTOP'
     const byte dual_hit = TEST_ENDSTOP(_ENDSTOP(A, MINMAX)) | (TEST_ENDSTOP(_ENDSTOP(A##2, MINMAX)) << 1); \
                                                                             ^~~~~~~~   
Marlin\src\module\endstops.cpp:932:39: note: in expansion of macro 'PROCESS_DUAL_ENDSTOP'
     #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX)
Marlin\src\module\endstops.cpp:1023:13: note: in expansion of macro 'PROCESS_ENDSTOP_Z' 
           ) PROCESS_ENDSTOP_Z(MIN);
             ^~~~~~~~~~~~~~~~~
*** [.pio\build\mega2560\src\src\module\endstops.cpp.o] Error 1
============================== [FAILED] Took 5.62 seconds ==============================
Environment    Status    Duration
-------------  --------  ------------
mega2560       FAILED    00:00:05.616
======================== 1 failed, 0 succeeded in 00:00:05.616 ======================== 

Bug Timeline

Newest Bugfix 2.0x

Expected behavior

It will compile

Actual behavior

It did not compile

Steps to Reproduce

compile

Version of Marlin Firmware

bugfix-2.0.x

Printer model

Custom Cartesian

Electronics

MKS Gen L

Add-ons

Inductive Probe for ZMin and dual Z Endstop for Z Max

Bed Leveling

ABL Bilinear mesh

Your Slicer

IdeaMaker

Host Software

OctoPrint

Additional information & file uploads

Marlin-New Configs.zip
Marlin OLD Configs.zip

@sjasonsmith
Copy link
Contributor

There do seem to be some problems in there. It seems like the code looks for USE_ZMIN_PLUG and assumes you have endstops connected, even though you have Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN enabled.

I think you can work around this for now by disabling USE_ZMIN_PLUG and set Z_MIN_PROBE_PIN to the same value as Z_MIN_PIN for your board:

// #define USE_ZMIN_PLUG
// #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
#define Z_MIN_PROBE_PIN 18

I'm not sure about actually fixing the code. There are a LOT of different ways endpoints can be configured and I'm afraid that fixing one use-case will break another.

It does seem like the probe should be treated the same whether on Z_MIN_PIN or Z_MIN_PROBE_PIN.

@SafChand
Copy link
Author

I'm not sure why it stopped working to be honest. Either way the 1.1x is working fine and for now it will be fine until I go to a 32 bit board. Their is a post somewhere on guthub for a fix - I tried replacing just the file in question endstop.cpp i think, but it just broke the whole build until I replaced it back for the original.

@github-actions
Copy link

This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.

@github-actions
Copy link

github-actions bot commented Mar 3, 2022

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 Mar 3, 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

2 participants