Trouble compiling Repetier

Preamble

I was having trouble compiling Repetier, without a Z-probe, whereby I disabled both the Z-probe and the distortion correction, but ended up with a slew of compile errors… which turned out to have nothing to do with the Z-probe, nor the distortion correction whatsoever (see Reason for the compile errors below).

However, I had already typed in the question, so here it is anyway, see The Question below, with the raw markdown posted just below it, see The Markdown below.

See also

  • Setting up Sanguinololu on OS X for Arduino 1.8.6 (random issues, trying to install the Sanguino drivers for the, ridiculously named, Sanguinololu board. However, it does point out a few issues, and how to get around them)
  • Selecting the right motherboard in Repetier (this is a bit of a red herring, as I was trying to determine how to get the pin definition for DIOORIG_FAN2_PIN_WPORT. However, it does list the motherboards supported and the necessary settings for the Arduino IDE)
  • DIOORIG_FAN2_PIN_WPORT error (this article get to the crux of the matter and how to resolve the compilation errors)

Reason for the compile errors

However, the problem, with the slew of compile errors, ended up being that I had the wrong configuration (“boards pin definition”), for the motherboard (# define MOTHERBOARD) selected in configuration.h. I discovered this by setting a dummy Z_PROBE_PIN, from -1 to 63

#define Z_PROBE_PIN 63

and then still getting the same error(s). The first error was

fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope

Googling this error led me to Can’t compile firmware, with the answer:

You are using ORIG_FAN2_PIN in your configuration but apparently your boards pin definition does not define that pin. In that case check board description and use the digital pin number instead for that function.

Independently, it, also, turned out that, being lazy, I hadn’t configured any of the #defines that were set to -1 ( and there are a lot of them), so I set them all to a dummy pin 65, except for the following line, which I set to 1

 #define BLUETOOTH_SERIAL 1.

I still get the error, but the compile goes further:

 fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope

I still haven’t managed to compile Repetier, as I am unable to figure out which setting for MOTHERBOARD actually works (1, 2, 33, 34, 35), see Selecting the right motherboard in Repetier, I even ended up trying to select Sanguino (21) as theMOTHERBOARD, but that lead to another disaster. See Setting up Sanguinololu on OS X for Arduino 1.8.6.

I am not even sure if theMOTHERBOARDselection is the source of the DIOORIG_FAN2_PIN_WPORT compile error, see DIOORIG_FAN2_PIN_WPORT error.

I’ve never had a problem compiling Marlin… funny that.

UPDATE: Eventually, I did manage to resolve the compile issues, see DIOORIG_FAN2_PIN_WPORT error.

The Question

I am trying to compile Repetier, from here, Repetier-Firmware-2017-06-09, without the Z-probe feature1.

My first attempt at compiling gives me:

Arduino: 1.8.2 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from /Volumes/Home/Users/user/Documents/Arduino/mj/Repetier-20170609T162557Z-001/Repetier/Repetier.ino:151:0:
Repetier.h:265: error: #error You need to define Z_PROBE_PIN to use z probe!
 #error You need to define Z_PROBE_PIN to use z probe!
  ^
exit status 1
#error You need to define Z_PROBE_PIN to use z probe!

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

As there is no Z-probe, I can not define Z_PROBE_PIN, so to clear the above error, I thought that I could disable the Z-probe feature, thusly:

#define FEATURE_Z_PROBE 0

First, I get an error about distortion correction,

Arduino: 1.8.2 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from /Volumes/Home/Users/user/Documents/Arduino/mj/Repetier-20170609T162557Z-001/Repetier/Repetier.ino:151:0:
Repetier.h:270: error: #error Distortion correction requires the z probe feature to be enabled and configured!
 #error Distortion correction requires the z probe feature to be enabled and configured!
  ^
exit status 1
#error Distortion correction requires the z probe feature to be enabled and configured!

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

so I set DISTORTION_CORRECTION to 0, it was set to 1

#define DISTORTION_CORRECTION 0

However, then I get a slew of errors:

Arduino: 1.8.2 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from sketch/HAL.h:83:0,
                 from sketch/Repetier.h:539,
                 from sketch/HAL.cpp:1:
sketch/HAL.cpp: In function 'void __vector_22()':
fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope
 #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                       ^
sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'
 #define  WRITE(IO, v)   _WRITE(IO, v)
                         ^
sketch/HAL.cpp:823:85: note: in expansion of macro 'WRITE'
         if((pwm_cooler_pos_set[1] = (extruder[1].coolerPWM & COOLER_PWM_MASK)) > 0) WRITE(EXT1_EXTRUDER_COOLER_PIN, 1);
                                                                                     ^
fastio.h:29: error: 'DIOORIG_FAN2_PIN_PIN' was not declared in this scope
 #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                    ^
sketch/fastio.h:17:30: note: in definition of macro 'MASK'
  #define  MASK(PIN)    (1 << PIN)                               ^ sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'  #define  WRITE(IO, v)   _WRITE(IO, v)                          ^ sketch/HAL.cpp:823:85: note: in expansion of macro 'WRITE'          if((pwm_cooler_pos_set[1] = (extruder[1].coolerPWM & COOLER_PWM_MASK)) > 0) WRITE(EXT1_EXTRUDER_COOLER_PIN, 1);
                                                                                     ^
fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope
 #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                                                ^
sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'
 #define  WRITE(IO, v)   _WRITE(IO, v)
                         ^
sketch/HAL.cpp:823:85: note: in expansion of macro 'WRITE'
         if((pwm_cooler_pos_set[1] = (extruder[1].coolerPWM & COOLER_PWM_MASK)) > 0) WRITE(EXT1_EXTRUDER_COOLER_PIN, 1);
                                                                                     ^
fastio.h:29: error: 'DIOORIG_FAN2_PIN_PIN' was not declared in this scope
 #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                                                                              ^
sketch/fastio.h:17:30: note: in definition of macro 'MASK'
  #define  MASK(PIN)    (1 << PIN)                               ^ sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'  #define  WRITE(IO, v)   _WRITE(IO, v)                          ^ sketch/HAL.cpp:823:85: note: in expansion of macro 'WRITE'          if((pwm_cooler_pos_set[1] = (extruder[1].coolerPWM & COOLER_PWM_MASK)) > 0) WRITE(EXT1_EXTRUDER_COOLER_PIN, 1);
                                                                                     ^
fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope
 #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                       ^
sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'
 #define  WRITE(IO, v)   _WRITE(IO, v)
                         ^
sketch/HAL.cpp:883:95: note: in expansion of macro 'WRITE'
     if(pwm_cooler_pos_set[1] == pwm_count_cooler && pwm_cooler_pos_set[1] != COOLER_PWM_MASK) WRITE(EXT1_EXTRUDER_COOLER_PIN,0);
                                                                                               ^
fastio.h:29: error: 'DIOORIG_FAN2_PIN_PIN' was not declared in this scope
 #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                    ^
sketch/fastio.h:17:30: note: in definition of macro 'MASK'
  #define  MASK(PIN)    (1 << PIN)
                              ^
sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'
 #define  WRITE(IO, v)   _WRITE(IO, v)
                         ^
sketch/HAL.cpp:883:95: note: in expansion of macro 'WRITE'
     if(pwm_cooler_pos_set[1] == pwm_count_cooler && pwm_cooler_pos_set[1] != COOLER_PWM_MASK) WRITE(EXT1_EXTRUDER_COOLER_PIN,0);
                                                                                               ^
fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope
 #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                                                ^
sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'
 #define  WRITE(IO, v)   _WRITE(IO, v)
                         ^
sketch/HAL.cpp:883:95: note: in expansion of macro 'WRITE'
     if(pwm_cooler_pos_set[1] == pwm_count_cooler && pwm_cooler_pos_set[1] != COOLER_PWM_MASK) WRITE(EXT1_EXTRUDER_COOLER_PIN,0);
                                                                                               ^
fastio.h:29: error: 'DIOORIG_FAN2_PIN_PIN' was not declared in this scope
 #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                                                                              ^
sketch/fastio.h:17:30: note: in definition of macro 'MASK'
  #define  MASK(PIN)    (1 << PIN)                               ^ sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'  #define  WRITE(IO, v)   _WRITE(IO, v)                          ^ sketch/HAL.cpp:883:95: note: in expansion of macro 'WRITE'      if(pwm_cooler_pos_set[1] == pwm_count_cooler && pwm_cooler_pos_set[1] != COOLER_PWM_MASK) WRITE(EXT1_EXTRUDER_COOLER_PIN,0);                                                                                                ^ exit status 1 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

Why is there the line

#define FEATURE_Z_PROBE 0 | 1

if it is so hard to turn off?

Google isn’t much help, either. I found this auto level disable, but (ridiculously) you still have to have a Z-probe specified (along with a pin), in the firmware, just to be able to disable it later with:

  • M320 S<0/1> – Activate autolevel, S1 stores it in eeprom
  • M321 S<0/1> – Deactivate autolevel, S1 stores it in eeprom
  • M322 – Reset autolevel matrix

1 I have a delta printer, without a Z-probe, and I have manually configured it, in Marlin, following this video: #18: Calibration. I want to do the same in Repetier. Is it actually possible to manuallyconfigure Repetier, or is one obliged to have a bl**dy Z-probe?

The Markdown

This is the mardown:

I am trying to compile Repetier, from here, [Repetier-Firmware-2017-06-09][1], *without* the Z-probe feature1. 

My first attempt at compiling gives me:

    Arduino: 1.8.2 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
    
    In file included from /Volumes/Home/Users/user/Documents/Arduino/mj/Repetier-20170609T162557Z-001/Repetier/Repetier.ino:151:0:
    Repetier.h:265: error: #error You need to define Z_PROBE_PIN to use z probe!
     #error You need to define Z_PROBE_PIN to use z probe!
      ^
    exit status 1
    #error You need to define Z_PROBE_PIN to use z probe!
    
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

As there is no Z-probe, I can not define `Z_PROBE_PIN`, so to clear the above error, I thought that I could disable the Z-probe feature, thusly:

    #define FEATURE_Z_PROBE 0

First, I get an error about distortion correction, 

    Arduino: 1.8.2 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
    
    In file included from /Volumes/Home/Users/user/Documents/Arduino/mj/Repetier-20170609T162557Z-001/Repetier/Repetier.ino:151:0:
    Repetier.h:270: error: #error Distortion correction requires the z probe feature to be enabled and configured!
     #error Distortion correction requires the z probe feature to be enabled and configured!
      ^
    exit status 1
    #error Distortion correction requires the z probe feature to be enabled and configured!
    
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

so I set `DISTORTION_CORRECTION` to `0`, it was set to `1`

    #define DISTORTION_CORRECTION 0

However, then I get a slew of errors:

    Arduino: 1.8.2 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
    
    In file included from sketch/HAL.h:83:0,
                     from sketch/Repetier.h:539,
                     from sketch/HAL.cpp:1:
    sketch/HAL.cpp: In function 'void __vector_22()':
    fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope
     #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                           ^
    sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'
     #define  WRITE(IO, v)   _WRITE(IO, v)
                             ^
    sketch/HAL.cpp:823:85: note: in expansion of macro 'WRITE'
             if((pwm_cooler_pos_set[1] = (extruder[1].coolerPWM & COOLER_PWM_MASK)) > 0) WRITE(EXT1_EXTRUDER_COOLER_PIN, 1);
                                                                                         ^
    fastio.h:29: error: 'DIOORIG_FAN2_PIN_PIN' was not declared in this scope
     #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                        ^
    sketch/fastio.h:17:30: note: in definition of macro 'MASK'
      #define  MASK(PIN)    (1 << PIN)                                   ^     sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'      #define  WRITE(IO, v)   _WRITE(IO, v)                              ^     sketch/HAL.cpp:823:85: note: in expansion of macro 'WRITE'              if((pwm_cooler_pos_set[1] = (extruder[1].coolerPWM & COOLER_PWM_MASK)) > 0) WRITE(EXT1_EXTRUDER_COOLER_PIN, 1);
                                                                                         ^
    fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope
     #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                                                    ^
    sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'
     #define  WRITE(IO, v)   _WRITE(IO, v)
                             ^
    sketch/HAL.cpp:823:85: note: in expansion of macro 'WRITE'
             if((pwm_cooler_pos_set[1] = (extruder[1].coolerPWM & COOLER_PWM_MASK)) > 0) WRITE(EXT1_EXTRUDER_COOLER_PIN, 1);
                                                                                         ^
    fastio.h:29: error: 'DIOORIG_FAN2_PIN_PIN' was not declared in this scope
     #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                                                                                  ^
    sketch/fastio.h:17:30: note: in definition of macro 'MASK'
      #define  MASK(PIN)    (1 << PIN)                                   ^     sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'      #define  WRITE(IO, v)   _WRITE(IO, v)                              ^     sketch/HAL.cpp:823:85: note: in expansion of macro 'WRITE'              if((pwm_cooler_pos_set[1] = (extruder[1].coolerPWM & COOLER_PWM_MASK)) > 0) WRITE(EXT1_EXTRUDER_COOLER_PIN, 1);
                                                                                         ^
    fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope
     #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                           ^
    sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'
     #define  WRITE(IO, v)   _WRITE(IO, v)
                             ^
    sketch/HAL.cpp:883:95: note: in expansion of macro 'WRITE'
         if(pwm_cooler_pos_set[1] == pwm_count_cooler && pwm_cooler_pos_set[1] != COOLER_PWM_MASK) WRITE(EXT1_EXTRUDER_COOLER_PIN,0);
                                                                                                   ^
    fastio.h:29: error: 'DIOORIG_FAN2_PIN_PIN' was not declared in this scope
     #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                        ^
    sketch/fastio.h:17:30: note: in definition of macro 'MASK'
      #define  MASK(PIN)    (1 << PIN)
                                  ^
    sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'
     #define  WRITE(IO, v)   _WRITE(IO, v)
                             ^
    sketch/HAL.cpp:883:95: note: in expansion of macro 'WRITE'
         if(pwm_cooler_pos_set[1] == pwm_count_cooler && pwm_cooler_pos_set[1] != COOLER_PWM_MASK) WRITE(EXT1_EXTRUDER_COOLER_PIN,0);
                                                                                                   ^
    fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope
     #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                                                    ^
    sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'
     #define  WRITE(IO, v)   _WRITE(IO, v)
                             ^
    sketch/HAL.cpp:883:95: note: in expansion of macro 'WRITE'
         if(pwm_cooler_pos_set[1] == pwm_count_cooler && pwm_cooler_pos_set[1] != COOLER_PWM_MASK) WRITE(EXT1_EXTRUDER_COOLER_PIN,0);
                                                                                                   ^
    fastio.h:29: error: 'DIOORIG_FAN2_PIN_PIN' was not declared in this scope
     #define  _WRITE(IO, v)   do { if (v) {DIO ##  IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ##  IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)
                                                                                                                                  ^
    sketch/fastio.h:17:30: note: in definition of macro 'MASK'
      #define  MASK(PIN)    (1 << PIN)                                   ^     sketch/fastio.h:48:25: note: in expansion of macro '_WRITE'      #define  WRITE(IO, v)   _WRITE(IO, v)                              ^     sketch/HAL.cpp:883:95: note: in expansion of macro 'WRITE'          if(pwm_cooler_pos_set[1] == pwm_count_cooler && pwm_cooler_pos_set[1] != COOLER_PWM_MASK) WRITE(EXT1_EXTRUDER_COOLER_PIN,0);                                                                                                    ^     exit status 1     'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope          This report would have more information with     "Show verbose output during compilation"     option enabled in File -> Preferences.


Why is there the line 

    #define FEATURE_Z_PROBE 0 | 1

if it is so hard to turn off?

Google isn't much help, either. I found this [auto level disable][2], but (ridiculously) you still have to have a Z-probe specified (along with a pin), in the firmware, just to be able to disable it later with:

 - `M320 S<0/1>` - Activate autolevel, S1 stores it in eeprom
 - `M321 S<0/1>` - Deactivate autolevel, S1 stores it in eeprom
 - `M322` - Reset autolevel matrix

----------

1 I have a delta printer, *without* a Z-probe, and I have manually configured it, in *Marlin*, following this video: [#18: Calibration][3]. I want to do the same in Repetier. Is it actually possible to *manually* configure Repetier, or is one obliged to have a bl**dy Z-probe?


  [1]: https://drive.google.com/open?id=0Bwypz0ZN4X9RUXBhcjBRVUVDTWM
  [2]: http://forum.repetier.com/discussion/2938/auto-level-disable
  [3]: https://www.youtube.com/watch?v=QuEhQU8vGZk
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s