Melzi & Z-Probing

Hey, guys! in my Wanhao duplicator i3 (Melzi Board) is now working firmware 0.92.9. I want to use auto bedlevel by connecting the capacitive sensor instead of Zmin endstop. but as soon as I activate in the firmware the function Z-Probing, the Arduino IDE(1.6.9) gives: compile Error for the Board Sanguino. What am I doing wrong?

Comments

  • The error message would help here. Most probably you did not set a valid z probe pin number.
  • I installed the Z-probing to Zmin (17 pin)

    error:
    "C:\Users\Pavel\AppData\Local\Temp\build67bea547c846380bce4bf35248e69ff5.tmp/core\core.a" "-LC:\Users\Pavel\AppData\Local\Temp\build67bea547c846380bce4bf35248e69ff5.tmp" -lm
    c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/bin/ld.exe: C:\Users\Pavel\AppData\Local\Temp\build67bea547c846380bce4bf35248e69ff5.tmp/Repetier.ino.elf section `.text' will not fit in region `text'

    c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/bin/ld.exe: region `text' overflowed by 7610 bytes

    collect2.exe: error: ld returned 1 exit status

    Use the SPI library version 1.0 from the folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI 
    exit status 1
    Compilation error for board Sanguino.
  • Your text messages are longer the 64kb and that does not work on 8 bit hardware. This normally only happens if you have display with many languages enabled. Disable 1-2 languages and it should compile.

  • failed. now I only use English and still get the same error. I changed only the line

    c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/bin/ld.exe: region `text' overflowed by 7656 bytes

    also in the compilation process I get the message:

    In file included from C:\Users\Pavel\AppData\Local\Temp\build16c262d4d39113bda88d692449112143.tmp\sketch\Repetier.h:546:0,

                     from E:\Users\Pavel\Desktop\Repetier-Wanhao-i3-master\Repetier_929\Repetier\Repetier.ino:151:

    C:\Users\Pavel\AppData\Local\Temp\build16c262d4d39113bda88d692449112143.tmp\sketch\ui.h:507:22: warning: extra tokens at end of #ifndef directive [enabled by default]

     #ifndef SDCARDDETECT || SDCARDDETECT != -1 //if the motherboard has SDCARDDETECT defined do not override

                          ^

    C:\Users\Pavel\AppData\Local\Temp\build16c262d4d39113bda88d692449112143.tmp\sketch\ui.h:834:2: warning: #warning Duplicator I3 [-Wcpp]

     #warning Duplicator I3

    but compilation continues. is this normal?
  • I don't have these lines in my code. Are you using some form of the original code?

    Also it's only a warning it is at least wrong

     #ifndef SDCARDDETECT || SDCARDDETECT != -1
    must be
     #if !defined(SDCARDDETECT) || SDCARDDETECT != -1

    but that will not solve the text overflow problem. With only one language it is not possible to get 70kb of text/static data.
  • Yes this build is designed for my printer. but now I downloaded a clean firmware and got the error message:

    In file included from C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\HAL.h:83:0,

                     from C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Repetier.h:539,

                     from C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Printer.cpp:19:

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Printer.cpp: In static member function 'static void Printer::setup()':

    fastio.h:34: error: 'DIO49_DDR' was not declared in this scope

     #define  _SET_INPUT(IO)  do {DIO ##  IO ## _DDR &= ~MASK(DIO ## IO ## _PIN); } while (0)

                                  ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\fastio.h:54:26: note: in expansion of macro '_SET_INPUT'

     #define  SET_INPUT(IO)   _SET_INPUT(IO)

                              ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Printer.cpp:823:5: note: in expansion of macro 'SET_INPUT'

         SET_INPUT(SDCARDDETECT);

         ^

    In file included from C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\HAL.h:83:0,

                     from C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Repetier.h:539,

                     from C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Printer.cpp:19:

    fastio.h:34: error: 'DIO49_PIN' was not declared in this scope

     #define  _SET_INPUT(IO)  do {DIO ##  IO ## _DDR &= ~MASK(DIO ## IO ## _PIN); } while (0)

                                                              ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\fastio.h:17:30: note: in definition of macro 'MASK'

      #define  MASK(PIN)    (1 << PIN)

                                  ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\fastio.h:54:26: note: in expansion of macro '_SET_INPUT'

     #define  SET_INPUT(IO)   _SET_INPUT(IO)

                              ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Printer.cpp:823:5: note: in expansion of macro 'SET_INPUT'

         SET_INPUT(SDCARDDETECT);

         ^

    fastio.h:29: error: 'DIO49_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)

                                           ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\fastio.h:49:37: note: in expansion of macro '_WRITE'

     #define     PULLUP(IO,v)            _WRITE(IO, v)

                                         ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Printer.cpp:824:5: note: in expansion of macro 'PULLUP'

         PULLUP(SDCARDDETECT, HIGH);

         ^

    fastio.h:29: error: 'DIO49_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)

                                                                        ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\fastio.h:17:30: note: in definition of macro 'MASK'

      #define  MASK(PIN)    (1 << PIN)

                                  ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\fastio.h:49:37: note: in expansion of macro '_WRITE'

     #define     PULLUP(IO,v)            _WRITE(IO, v)

                                         ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Printer.cpp:824:5: note: in expansion of macro 'PULLUP'

         PULLUP(SDCARDDETECT, HIGH);

         ^

    fastio.h:29: error: 'DIO49_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)

                                                                                                    ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\fastio.h:49:37: note: in expansion of macro '_WRITE'

     #define     PULLUP(IO,v)            _WRITE(IO, v)

                                         ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Printer.cpp:824:5: note: in expansion of macro 'PULLUP'

         PULLUP(SDCARDDETECT, HIGH);

         ^

    fastio.h:29: error: 'DIO49_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)

                                                                                                                                  ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\fastio.h:17:30: note: in definition of macro 'MASK'

      #define  MASK(PIN)    (1 << PIN)

                                  ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\fastio.h:49:37: note: in expansion of macro '_WRITE'

     #define     PULLUP(IO,v)            _WRITE(IO, v)

                                         ^

    C:\Users\Pavel\AppData\Local\Temp\build5c8125c19a4bf5cf8355714a867c5469.tmp\sketch\Printer.cpp:824:5: note: in expansion of macro 'PULLUP'

         PULLUP(SDCARDDETECT, HIGH);

         ^

    Use the SPI library version 1.0 from the folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI 
    exit status 1
    'DIO49_DDR' was not declared in this scope

    what now? sorry, but I just started to learn the firmware, and my knowledge is not enough to solve this problem

  • I compared the old firmware. which is now in the printer with the new you just downloaded. the main differences in the UI file.h:
    my file:
    #undef SDCARDDETECT
    #if MOTHERBOARD == 37
    #define SDCARDDETECT ORIG_SDCARDDETECT
    #define SDCARDDETECT 49
    #undef SDCARDDETECTINVERTED
    #define SDCARDDETECTINVERTED 0
    #undef SDSUPPORT
    #define SDSUPPORT 1


    your:
    #ifndef SDCARDDETECT || SDCARDDETECT != -1 //if the motherboard has SDCARDDETECT defined do not override
      #undef SDCARDDETECT
      #define SDCARDDETECT 49
      #undef SDCARDDETECTINVERTED
      #define SDCARDDETECTINVERTED 0
      #undef SDSUPPORT
      #define SDSUPPORT 1
    (this is causing the error)

    also in my file added the line:

    #elif MOTHERBOARD == 63 //Metzli Duplicator I3
    #warning Duplicator I3
    #define UI_DISPLAY_TYPE DISPLAY_U8G
    #define U8GLIB_ST7920
    #define BEEPER_PIN             27
    #define UI_DISPLAY_RS_PIN      17  //28
    #define UI_DISPLAY_RW_PIN      -1
    #define UI_DISPLAY_ENABLE_PIN  16  //17
    #define UI_DISPLAY_D0_PIN      -1
    #define UI_DISPLAY_D1_PIN      -1
    #define UI_DISPLAY_D2_PIN      -1
    #define UI_DISPLAY_D3_PIN      -1
    #define UI_DISPLAY_D4_PIN      11  //30
    #define UI_DISPLAY_D5_PIN      -1
    #define UI_DISPLAY_D6_PIN      -1
    #define UI_DISPLAY_D7_PIN      -1
    #define UI_ENCODER_A           29
    #define UI_ENCODER_B           30
    #define UI_ENCODER_CLICK       28
    #define UI_RESET_PIN           10  //29

    in the end, if you disable Z-Probing I get: Sketch uses 129 490 bytes (99%) memory device. There are 130 048 bytes.
    Global variables use 4 bytes of 501 (27%) of dynamic memory, leaving 11 883 bytes for local variables. Maximum: 16,384 bytes. as I understand the sketch is too big for my Board. how can I ease the firmware?






  • fastio.h:34: error: 'DIO49_DDR' was not declared in this scope
    means you are using pin 49 but Melzi does not have it. You might have selected a display that has no pinout for your Melzi and get pins from RAMPS instead.

    Regarding size, yes Melzi has small memory compared to Mega 2560 or due boards. Disable sd card if you can spare it. It uses quite some place. Remove ui which also takes much or disbable animations and select only one language.
    EEPROM also is a memory eater but I'd leave it if you want probing. After all probing is stored in eeprom.

    All other features are rather small. Arc support could be disabled.
  • thanks for the help. disabling sd and g2\g3 I got a sketch 125 732 bytes (96%) memory of the device and this is still not enough for Z-probing. if you turn off and display, then it works. but the display to me is more important than auto level. so I might return to this topic when change Melzi to the Board with great features, or try to use Marlin
  • I guess that is th eproce we pay for all the features users want. It all cost memory. When starting firmware it even fitted on a 64kb sanguino.
Sign In or Register to comment.