0.92 JAM_PIN, Azteeg Pro X3 Pin 19 compile failure...

Hi All,

I'm new here, have done a deep search to no avail. I've been using and lightly modifying my printer's Repetier v0.92 firmware for some time. I'm stuck on 0.92 due to the nature of the support and warrantee validity from the printer company, and lack of programming knowledge on my part to upgrade on my own. Hoping greatly someone here can help. I have a Dyze Filament Sentinel connected to the Z-Max pins of the Azteeg X3 Pro (Arduino/Genuino Mega 2560).

Panacutt's documentation calls out the proper analog pin assignment as "19".

For Extruder 1, in Configuration.h I've set:

#define EXT1_JAM_PIN ORIG_Z_MAX_PIN
#define EXT1_JAM_PULLUP 0
#define JAM_ACTION 1
#define JAM_METHOD 3

...in pins.h under the Azteeg X3 Pro section:

#define ORIG_Z_MAX_PIN 19

Problem: Setting EXT1_JAM_PIN to anything by -1 (disabled) caused a compiler error (attached). 

Compiler error file, verbose, attached
Screen Shot of the board and where it's been connected attached
Screen Shot of the Panacutt pin assignments attached

Thanks for reading and for the effort!

Dan


Comments

  • edited August 2018

    Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\foouser\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\foouser\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\foouser\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10805 -build-path C:\Users\foouser\AppData\Local\Temp\arduino_build_843138 -warnings=none -build-cache C:\Users\foouser\AppData\Local\Temp\arduino_cache_356167 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.arduinoOTA.path=C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -verbose C:\Users\foouser\Desktop\STACKER Firmware 92.8 (S4-X3PRO-5984XY)\Repetier\Repetier.ino
    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\foouser\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\foouser\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\foouser\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10805 -build-path C:\Users\foouser\AppData\Local\Temp\arduino_build_843138 -warnings=none -build-cache C:\Users\foouser\AppData\Local\Temp\arduino_cache_356167 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.arduinoOTA.path=C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -verbose C:\Users\foouser\Desktop\STACKER Firmware 92.8 (S4-X3PRO-5984XY)\Repetier\Repetier.ino
    Using board 'mega' from platform in folder: C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21
    Using core 'arduino' from platform in folder: C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21
    Detecting libraries used...
    "C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\mega" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Repetier.ino.cpp" -o "nul"
    "C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\mega" "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SPI\src" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Repetier.ino.cpp" -o "nul"
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\BedLeveling.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Commands.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Communication.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Drivers.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Eeprom.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Extruder.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\HAL.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Printer.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\SDCard.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\SdFat.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\gcode.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\motion.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\ui.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\uilang.cpp
    Using cached library dependencies for file: C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SPI\src\SPI.cpp
    Generating function prototypes...
    "C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\mega" "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SPI\src" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Repetier.ino.cpp" -o "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\preproc\ctags_target_for_gcc_minus_e.cpp"
    "C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\preproc\ctags_target_for_gcc_minus_e.cpp"
    Compiling sketch...
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\BedLeveling.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Commands.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Communication.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Drivers.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Eeprom.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Extruder.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\HAL.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Printer.cpp.o
    "C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\mega" "-IC:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SPI\src" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Repetier.ino.cpp" -o "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Repetier.ino.cpp.o"
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\SDCard.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\SdFat.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\gcode.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\motion.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\ui.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\uilang.cpp.o
    Compiling libraries...
    Compiling library "SPI"
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\libraries\SPI\SPI.cpp.o
    Compiling core...
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\wiring_pulse.S.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\WInterrupts.c.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\hooks.c.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\wiring.c.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\wiring_analog.c.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\wiring_digital.c.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\wiring_pulse.c.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\wiring_shift.c.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\CDC.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\HardwareSerial.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\HardwareSerial0.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\HardwareSerial1.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\HardwareSerial2.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\HardwareSerial3.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\IPAddress.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\PluggableUSB.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\Print.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\Stream.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\Tone.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\USBCore.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\WMath.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\WString.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\abi.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\main.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\new.cpp.o
    Using previously compiled file: C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\core\core.a
    Archiving built core (caching) in: C:\Users\foouser\AppData\Local\Temp\arduino_cache_356167\core\core_arduino_avr_mega_cpu_atmega2560_726f71b41f5861c7700456992a75c8dc.a
    Linking everything together...
    "C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560  -o "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138/Repetier.ino.elf" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\BedLeveling.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Commands.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Communication.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Drivers.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Eeprom.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Extruder.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\HAL.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Printer.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\Repetier.ino.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\SDCard.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\SdFat.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\gcode.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\motion.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\ui.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\sketch\uilang.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138\libraries\SPI\SPI.cpp.o" "C:\Users\foouser\AppData\Local\Temp\arduino_build_843138/core\core.a" "-LC:\Users\foouser\AppData\Local\Temp\arduino_build_843138" -lm
    C:\Users\foouser\AppData\Local\Temp\cccBDkC7.ltrans17.ltrans.o: In function `setTimer(unsigned long)':

    cccBDkC7.ltrans17.o:(.text+0x16): undefined reference to `stepperWait'

    cccBDkC7.ltrans17.o:(.text+0x1a): undefined reference to `stepperWait'

    cccBDkC7.ltrans17.o:(.text+0x1e): undefined reference to `stepperWait'

    cccBDkC7.ltrans17.o:(.text+0x4e): undefined reference to `stepperWait'

    cccBDkC7.ltrans17.o:(.text+0x52): undefined reference to `stepperWait'

    C:\Users\foouser\AppData\Local\Temp\cccBDkC7.ltrans17.ltrans.o:cccBDkC7.ltrans17.o:(.text+0x56): more undefined references to `stepperWait' follow

    collect2.exe: error: ld returned 1 exit status

    Using library SPI at version 1.0 in folder: C:\Users\foouser\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SPI 
    exit status 1
    Error compiling for board Arduino/Genuino Mega or Mega 2560.


  • Not really a compile error more a linker problem. stepperWait seems not to be defined. It should be in HAL.cpp like this:

    long __attribute__((used)) stepperWait = 0;

    and I see you compiled HAL.cpp. Interestingly it is defined directly before the setTimer function which is missing this.

    long __attribute__((used)) stepperWait = 0;


    // ================== Interrupt handling ======================


    /** \brief Sets the timer 1 compare value to delay ticks.


    This function sets the OCR1A compare counter  to get the next interrupt

    at delay ticks measured from the last interrupt. delay must be << 2^24

    */

    inline void setTimer(uint32_t delay) {

        __asm__ __volatile__ (

            "cli \n\t"

            "tst %C[delay] \n\t" //if(delay<65536) {


    So as first step I would check if the code is there and not somehow deleted. If it is there try deleting the tmp directory Arduino uses to compile and retry.
  • edited August 2018
    Thanks for the quick response! My HAL.cpp has something similar but doesn't match what you've pasted. Here's my HAL.cpp code. 

    https://pastebin.com/embed_iframe/wP3uyAzu


  • In line 666 you have

    long stepperWait = 0;

    try replacing it with

    long __attribute__((used)) stepperWait = 0;

    It is the same, but since it only gets used in the assembler part the C++ compiler does not see it and optimizes it away causing the problem.

  • edited August 2018
    Such timing! I just found your previous post about this:

    https://forum.repetier.com/discussion/2389/stepperwait-referenced-in-section-text-compiliation-issues

    ...and the change worked for linking.

    After all of that work, no log file debug information for my jam sensor with M302, M602 S0 P0 :( 

    https://pastebin.com/embed_iframe/hX8Zjwyt

    ...but that's perhaps my issue with board connection. 

  • I think it is
    M602 S1 P1
    to enable and debug jam.
  • It sure is, thanks. 1=on.

    If I get the output working, will post details here for others. Currently, no magic.
  • edited August 2018

    For reference, here's how the sensor is hooked up. Looks right to me... With #define ORIG_Z_MAX_PIN 19 set in pins.h, I should be seeing some messages in the printer log (full debug enabled) - but nothing. Perhaps ORIG_Z_MAX_PIN is being redefined somehow?




  • Ok, so some progress. Setting EXT1_JAM_PIN ORIG_Z_MIN_PIN works perfectly. However, now when I home my Z axis, it homes downward (reverse direction). Weird.
  • Maybe you trapped into a frequent error I see. Using z max pin does NOT mean you define z max endstop! That would activate z max endstop as well and you would seee z max when sending M119 - that is not what you want. You ONLY define it as EXT1_JAM_PIN!

  • So, problem solved. It turns out that for the Azteeg X3 Pro, Dyze has the wrong instructions. They say to set JAM_METHOD 3. That would be Signal;Ground;Power. I changed it to JAM_METHOD 2, which is Ground; Signal; Power as the pins are laid out on the board. So, to conclude for others:

    1_ Modify pins.h and add "#define <Extruder>_ORIG_Z_MAX_PIN  19” to the Azteeg X3 Pro section. I have four extruders, so I did #define  EXT1_ORIG_Z_MAX_PIN 19" 

    2_ In Configuration.h, add “#define JAM_METHOD 2” and “#define JAM_ACTION 2” to whatever extruder section, EXT0, EXT1 etc.

    In HAL.cpp, line 666 replace

    long stepperWait = 0;

    …with:

    long __attribute__((used)) stepperWait = 0;

    3_ Compile, upload, done.

    One note: If users set “JAM_ACTION 1”, the LCD displays the correct message, but the screen freezes and the printer must be reset. JAM_ACTION 2 seems to work properly.

    Now back to printing; thanks again for all of the help!
Sign In or Register to comment.