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] Two Problems with compiling bugfix-2.0.x #15106

Closed
NorxMAL opened this issue Aug 30, 2019 · 9 comments
Closed

[BUG] Two Problems with compiling bugfix-2.0.x #15106

NorxMAL opened this issue Aug 30, 2019 · 9 comments

Comments

@NorxMAL
Copy link

NorxMAL commented Aug 30, 2019

Description

Error Message 1 :

sketch\src\module\stepper\TMC26X.cpp:28:33: fatal error: ../inc/MarlinConfig.h: No such file or directory

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

Error Message 2 :

sketch\src\module\stepper_indirection.cpp.o (symbol from plugin): In function `restore_stepper_drivers()':

(.text+0x0): multiple definition of `restore_stepper_drivers()'

sketch\src\module\stepper\indirection.cpp.o (symbol from plugin):(.text+0x0): first defined here

d:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions

sketch\src\module\stepper_indirection.cpp.o (symbol from plugin): In function `restore_stepper_drivers()':

(.text+0x0): multiple definition of `reset_stepper_drivers()'

sketch\src\module\stepper\indirection.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

Got error on not finding a file, and multiple definitions of 'restore_stepper_drivers()'

Explanations to My FIX

Change line 28 in src\module\stepper\TMC26X.cpp to :
#include "../../inc/MarlinConfig.h"

This is not a fix, just a bandaid:
src\module\stepper_indirection.cpp
and
src\module\stepper\indirection.cpp

Yeah, the latter file has just has

  #if HAS_TRINAMIC
    restore_stepper_drivers();
  #endif

in restore_stepper_drivers(), which the former doesn't have.

And in reset_stepper_drivers(), the latter (indirection.cpp) has

  #if HAS_TRINAMIC
    reset_trinamic_drivers();
  #endif

And former (stepper_indirection.cpp has

  #if HAS_TRINAMIC
    static constexpr bool stealthchop_by_axis[] = {
      #if ENABLED(STEALTHCHOP_XY)
        true
      #else
        false
      #endif
      ,
      #if ENABLED(STEALTHCHOP_Z)
        true
      #else
        false
      #endif
      ,
      #if ENABLED(STEALTHCHOP_E)
        true
      #else
        false
      #endif
    };
  #endif

MY FIX

I just deleted both reset_stepper_drivers() and reset_stepper_drivers() code sections in indirection.cpp (The file is essentially empty) and added

  #if HAS_TRINAMIC
    restore_stepper_drivers();
  #endif

to stepper_indirection.cpp restore_stepper_drivers(); so it looks like this

¨void restore_stepper_drivers() {
  #if AXIS_IS_TMC(X)
    stepperX.push();
  #endif
  #if AXIS_IS_TMC(X2)
    stepperX2.push();
  #endif
  #if AXIS_IS_TMC(Y)
    stepperY.push();
  #endif
  #if AXIS_IS_TMC(Y2)
    stepperY2.push();
  #endif
  #if AXIS_IS_TMC(Z)
    stepperZ.push();
  #endif
  #if AXIS_IS_TMC(Z2)
    stepperZ2.push();
  #endif
  #if AXIS_IS_TMC(Z3)
    stepperZ3.push();
  #endif
  #if AXIS_IS_TMC(E0)
    stepperE0.push();
  #endif
  #if AXIS_IS_TMC(E1)
    stepperE1.push();
  #endif
  #if AXIS_IS_TMC(E2)
    stepperE2.push();
  #endif
  #if AXIS_IS_TMC(E3)
    stepperE3.push();
  #endif
  #if AXIS_IS_TMC(E4)
    stepperE4.push();
  #endif
  #if AXIS_IS_TMC(E5)
    stepperE5.push();
  #endif
  #if HAS_TRINAMIC
    restore_stepper_drivers();
  #endif
}

And didn't do anything to restore_stepper_drivers() in stepper_indirection.cpp

@Ludy87
Copy link
Contributor

Ludy87 commented Aug 30, 2019

#15102

@boelle
Copy link
Contributor

boelle commented Aug 31, 2019

please edit the title to be a bit mor meaningfull

@NorxMAL NorxMAL changed the title [BUG] (short description) [BUG] Problems with compiling bugfix-2.0.x Sep 1, 2019
@NorxMAL
Copy link
Author

NorxMAL commented Sep 1, 2019

#15102

Where does it say anything about src\module\stepper_indirection.cpp and src\module\stepper\indirection.cpp?

@NorxMAL
Copy link
Author

NorxMAL commented Sep 1, 2019

please edit the title to be a bit mor meaningfull

People find this through google anyhow :P

@NorxMAL NorxMAL changed the title [BUG] Problems with compiling bugfix-2.0.x [BUG] Two Problems with compiling bugfix-2.0.x Sep 1, 2019
@Ludy87
Copy link
Contributor

Ludy87 commented Sep 1, 2019

See and try #15111

@boelle
Copy link
Contributor

boelle commented Sep 24, 2019

@NorxMAL is this still a problem?

@NorxMAL
Copy link
Author

NorxMAL commented Sep 24, 2019

@boelle No, it is running fine on my Delta Ramps1.4 now :)

@boelle
Copy link
Contributor

boelle commented Sep 25, 2019

oki, will close then, we can always reopen

@boelle boelle closed this as completed Sep 25, 2019
@github-actions
Copy link

github-actions bot commented Jul 4, 2020

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 Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants