TronXY with Melzi V2.05 hex file too big - what do you recommend I remove. Thanks

Well after a long road I almost have my Tronxy 3X 3D printer with the Melzi V2.05 controller board upgraded to V0.92.9. I used the configuration.h file from a person in Germany who has the same printer I do. I seem to run into this problem. The hex file is too big. 

See the messages below..
Warning: Board arduino:avr:atmega664p doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA664P
Warning: Board arduino:avr:atmega1284p doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA1284P
Warning: Board arduino:avr:atmega1284p16 doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA1284P16
Warning: Board arduino:avr:ADABoot1284Pst doesn't define a 'build.board' preference. Auto-set to: AVR_ADABOOT1284PST
Sketch uses 130584 bytes (100%) of program storage space. Maximum is 130048 bytes.

Global variables use 4394 bytes (26%) of dynamic memory, leaving 11990 bytes for local variables. Maximum is 16384 bytes.
Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
Error compiling for board Sanguino.
The Sanguino controller board has a Atmega1284P chip on it. Again I used the configuration.h from 

https://pastebin.com/apPtJPDS
as a starting point. 

What do you recommend. 

«1

Comments

  • Looks like you only need to reduce 600 byte.
    #define ARC_SUPPORT 0
    should give you that much. Slicers do not generate arcs anyway.
  • Did that and it that problem is solved.. any idea how I can figure out what would cause this problem?
    Using library SPI at version 1.0 in folder: C:\Arduino_1.8.8_IDE\arduino-1.8.8-windows\arduino-1.8.8\hardware\arduino\avr\libraries\SPI 
    "C:\\Arduino_1.8.8_IDE\\arduino-1.8.8-windows\\arduino-1.8.8\\hardware\\tools\\avr/bin/avr-size" -A "C:\\TMP\\AppData\\Local\\Temp\\arduino_build_738306/Repetier.ino.elf"
    Sketch uses 127340 bytes (97%) of program storage space. Maximum is 130048 bytes.
    Global variables use 4394 bytes (26%) of dynamic memory, leaving 11990 bytes for local variables. Maximum is 16384 bytes.
    C:\Arduino_1.8.8_IDE\arduino-1.8.8-windows\arduino-1.8.8\hardware\tools\avr/bin/avrdude -CC:\Arduino_1.8.8_IDE\arduino-1.8.8-windows\arduino-1.8.8\hardware\tools\avr/etc/avrdude.conf -v -patmega1284p -cusbasp -Pusb -Uflash:w:C:\TMP\AppData\Local\Temp\arduino_build_738306/Repetier.ino.hex:i 

    avrdude: Version 6.3-20171130
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2014 Joerg Wunsch

             System wide configuration file is "C:\Arduino_1.8.8_IDE\arduino-1.8.8-windows\arduino-1.8.8\hardware\tools\avr/etc/avrdude.conf"

             Using Port                    : usb
             Using Programmer              : usbasp
    An error occurred while uploading the sketch

    Thanks.... Note I am using an ISP connected to the Melzi V2.05 board with the USB printer cable connected to it also. 
    Almost there....

    Richard



  • Normally the bootloader protects the last 2 or 4kb of ram preventing it from overwrite by some fuse settings. It might be that the sketch comes into that region, so you need to delete the bootloader and set fuses to unprotect the memory. Do this only if you do not need a bootloader to upload. As a simple test disable eeprom (EEPROM_MODE 0) and upload. Sketch will be a good part shorter so it will fit even with bootloader. If it works you know problem is size dependent.
  • Found that and did it.. - changed configuration.h file.. did not work.. looking at using eXtreme Electronics IDE and asked how to put in a Atmega1284P chip.. I think I am almost there.. Keep you informed.. If you have any other ideas please let me know.. Note I have a cheap avr programmer from where-else.. with an 6 pin adapter and I mave the USB power plugged into the board with the jumper set to USB power.. there is a reset jumper next to the ISP connector that is connected.. I think this is the reset jumper.. 
  • Yes unusual way to upload a script. And if small sketches also do not work it is not the bootloader protection. Then it sounds more like the method it self is the problem. Either wrong configured or connected. Make sure ISP connector is correct. Normally MOSI -> MISO and MISO->MOSI and not with same name here! Like serial where RX is TX of the other device.
  • edited March 2019
    Yes that is done.. You know.. I can update the board using Sketch 1.06. with the compiled Repetier 0.91. I can not compile 0.92.9 under sketch 1.06. Maybe I should try to compile under Sketch 1.06 and then erase the chip and reprogram it with Sketch 1.06. I will  need help doing that.. as I looked into it and got errors on the SD and other files. What do you think?? Thanks Richard 
  • Ok look at this .. for the most part two errors.. that is all after being compiles with Sketch 1.06. Here it is: ....

    C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega1284p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -IC:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino -IC:\Users\Administrator\Documents\Arduino\hardware\Sanguino\variants\sanguino -IC:\Program Files (x86)\Arduino\libraries\SPI C:\TMP\AppData\Local\Temp\build6200970795496528423.tmp\BedLeveling.cpp -o C:\TMP\AppData\Local\Temp\build6200970795496528423.tmp\BedLeveling.cpp.o 
    In file included from BedLeveling.cpp:107:
    /Repetier.h:1:16: warning: SD.h: No such file or directory
    In file included from /Repetier.h:214,
                     from BedLeveling.cpp:107:
    /Configuration.h:628:1: warning: "NUM_TEMPS_USERTHERMISTOR0" redefined
    /Configuration.h:160:1: warning: this is the location of the previous definition
    /Configuration.h:629:1: warning: "USER_THERMISTORTABLE0" redefined
    /Configuration.h:161:1: warning: this is the location of the previous definition
    /Configuration.h:638:1: warning: "NUM_TEMPS_USERTHERMISTOR1" redefined
    /Configuration.h:162:1: warning: this is the location of the previous definition
    /Configuration.h:639:1: warning: "USER_THERMISTORTABLE1" redefined
    /Configuration.h:163:1: warning: this is the location of the previous definition
    In file included from BedLeveling.cpp:107:
    /Repetier.h:631:29: error: src/SdFat/SdFat.h: No such file or directory
    In file included from /Repetier.h:1123,
                     from BedLeveling.cpp:107:
    /DisplayList.h:1691:1: warning: "UI_DISPLAY_ENABLE_PIN" redefined
    In file included from /Repetier.h:214,
                     from BedLeveling.cpp:107:
    /Configuration.h:608:1: warning: this is the location of the previous definition
    In file included from /Repetier.h:1123,
                     from BedLeveling.cpp:107:
    /DisplayList.h:1692:1: warning: "UI_DISPLAY_RS_PIN" redefined
    In file included from /Repetier.h:214,
                     from BedLeveling.cpp:107:
    /Configuration.h:606:1: warning: this is the location of the previous definition
    In file included from /Repetier.h:1123,
                     from BedLeveling.cpp:107:
    /DisplayList.h:1694:1: warning: "UI_DISPLAY_D4_PIN" redefined
    In file included from /Repetier.h:214,
                     from BedLeveling.cpp:107:
    /Configuration.h:613:1: warning: this is the location of the previous definition
    In file included from /Repetier.h:1123,
                     from BedLeveling.cpp:107:
    /DisplayList.h:1695:1: warning: "UI_DISPLAY_D5_PIN" redefined
    In file included from /Repetier.h:214,
                     from BedLeveling.cpp:107:
    /Configuration.h:614:1: warning: this is the location of the previous definition
    In file included from /Repetier.h:1123,
                     from BedLeveling.cpp:107:
    /DisplayList.h:1696:1: warning: "UI_DISPLAY_D6_PIN" redefined
    In file included from /Repetier.h:214,
                     from BedLeveling.cpp:107:
    /Configuration.h:615:1: warning: this is the location of the previous definition
    In file included from /Repetier.h:1123,
                     from BedLeveling.cpp:107:
    /DisplayList.h:1697:1: warning: "UI_DISPLAY_D7_PIN" redefined
    In file included from /Repetier.h:214,
                     from BedLeveling.cpp:107:
    /Configuration.h:616:1: warning: this is the location of the previous definition
    In file included from /Repetier.h:1123,
                     from BedLeveling.cpp:107:
    /DisplayList.h:1709:1: warning: "UI_DELAYPERCHAR" redefined
    In file included from /Repetier.h:214,
                     from BedLeveling.cpp:107:
    /Configuration.h:621:1: warning: this is the location of the previous definition
    In file included from /Repetier.h:963,
                     from BedLeveling.cpp:107:
    /Printer.h: In static member function 'static void Printer::setColdExtrusionAllowed(uint8_t)':
    /Printer.h:763: warning: only initialized variables can be placed into program memory area
    /Printer.h:765: warning: only initialized variables can be placed into program memory area
    /Printer.h: In static member function 'static void Printer::setAutoretract(uint8_t)':
    /Printer.h:783: warning: only initialized variables can be placed into program memory area
    /Printer.h: In static member function 'static void Printer::setDebugJam(uint8_t)':
    /Printer.h:834: warning: only initialized variables can be placed into program memory area
    /Printer.h: In static member function 'static void Printer::setJamcontrolDisabled(uint8_t)':
    /Printer.h:847: warning: only initialized variables can be placed into program memory area
    In file included from BedLeveling.cpp:107:
    /Repetier.h: At global scope:
    Repetier.h:991: error: 'SdFat' does not name a type
    Repetier.h:996: error: 'SdFile' does not name a type
    Repetier.h:1009: error: 'SdBaseFile' does not name a type
    Repetier.h:1037: error: expected ',' or '...' before '&' token
    Repetier.h:1037: error: ISO C++ forbids declaration of 'dir_t' with no type
    Repetier.h:1045: error: 'SdBaseFile' has not been declared
    /Repetier.h: In member function 'void SDCard::setIndex(uint32_t)':
    Repetier.h:1025: error: 'file' was not declared in this scope
    In file included from BedLeveling.cpp:107:
    /Repetier.h: In member function 'void PlaneBuilder::createPlane(Plane&, bool)':
    /Repetier.h:1108: warning: only initialized variables can be placed into program memory area
    /Repetier.h:1109: warning: only initialized variables can be placed into program memory area
    /Repetier.h:1110: warning: only initialized variables can be placed into program memory area

    ========
    src/SdFat/SdFat.h: No such file or directory I need to find a place to put these files.. checked Google and there were not real answers.. Your thoughts? I think this should take care of the SdFat problem. 

     
  • You need Arduino IDE 1.8.x to compile recent versions. 1.0.6 is way too old and does nur support sub directories.

    I also see you have defined some symbols twice in configuration.h - last wins but it confusing to have it twice.
  • Ok but I can install 0.91 with 1.06. interesting I can not install with 1.88! 
  • Maybe. Haven't computed 0.91 for some years. But when it was the latest version arduino IDE was somewhere around that version.
  • I have asked the Arduino people is there is some reason 1.0.6 works and 1.8.8 does not.. Let you know the answer and I will try a few other tests.. Have a great weekend. Richard 
  • edited March 2019
    Ok interesting. I can upload using avrdude and a hex file. as below
    Repetier.ino.sanguino.hex: 117,786 / 131,072 Bytes (89.86%)
    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

    avrdude.exe: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.00s

    avrdude.exe: Device signature = 0x1e9705
    avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
                 To disable this feature, specify the -D option.
    avrdude.exe: erasing chip
    avrdude.exe: reading input file "C:\Murrieta_Inovation_Center_01A\3D_Printer_Software_Upgrade_01A\Repetier_092_9_Firmware_Web_Config_H _NEW_UNZIP\Repetier-Firmware-_NEW_UNZIP\Repetier-Firmware\Repetier\Repetier.ino.sanguino.hex"
    avrdude.exe: writing flash (117786 bytes):

    Writing | ################################################## | 100% 72.08s

    avrdude.exe: 117786 bytes of flash written
    avrdude.exe: verifying flash memory against C:\Murrieta_Inovation_Center_01A\3D_Printer_Software_Upgrade_01A\Repetier_092_9_Firmware_Web_Config_H _NEW_UNZIP\Repetier-Firmware-_NEW_UNZIP\Repetier-Firmware\Repetier\Repetier.ino.sanguino.hex:
    avrdude.exe: load data flash data from input file C:\Murrieta_Inovation_Center_01A\3D_Printer_Software_Upgrade_01A\Repetier_092_9_Firmware_Web_Config_H _NEW_UNZIP\Repetier-Firmware-_NEW_UNZIP\Repetier-Firmware\Repetier\Repetier.ino.sanguino.hex:
    avrdude.exe: input file C:\Murrieta_Inovation_Center_01A\3D_Printer_Software_Upgrade_01A\Repetier_092_9_Firmware_Web_Config_H _NEW_UNZIP\Repetier-Firmware-_NEW_UNZIP\Repetier-Firmware\Repetier\Repetier.ino.sanguino.hex contains 117786 bytes
    avrdude.exe: reading on-chip flash data:

    Reading | ################################################## | 100% 53.94s

    avrdude.exe: verifying ...
    avrdude.exe: 117786 bytes of flash verified

    avrdude.exe done.  Thank you.
    --------------------------------------

    I tried to upload the EEProm values via Avrdude and Repetier-Host but nothing took. 

    I use Repetier-Host to connect to the board and under Printer information I get 
    Mendel
    Repetier 1.0.3

    yet under Firmware configuration I do not get any values.. Any Thoughts????
    .. I am looking into it.. and going to upload 0.91 to see if the process if correct. ie I get eeprom values from 0.91. 

    Note 0.91 load and I see the values... with out any additional uploading.. 

  • Ok listen to this.. I downloaded the software again.. this time I just uploaded the configuration.h file, looked at the first page and then went download, unzipped the file, and compiled it.. uploaded it ... AND IT LOOKs like it worked.. I will plug it in tomorrow... to test it.. Keep you informed.. also I will compare the eeprom data from v.91 to v.92.9 to see if there are any big differences.. again keep you informed.. 
  • edited March 2019
    The X, Yand Z axis seem to work but there is not bed heating and no extruder heating along with the extruder servo not working.. any thoughts???? Also when I start a print the display says heating bed.. then goes to Idle... i HAVE NOT install any bed leveling device. I just wanted to test out the board. 

    https://www.dropbox.com/sh/moz7tdp3nl4ajop/AAADJJvI2bLv_4D7DM2RDbToa?dl=0

    This is the link to the files I have been using. Please look at  Repetier-Firmware-2019-03-11. if you need any additional information Thanks .. Richard 
  • Oh a few more things.. we looked at the voltages and they seem to be ok.. but we are not that knowledge on what to check. and the display seems to work just fine.... Do you need some pictures.. Richard 
  • Check log and make sure dry run is disabled. Sounds like you have enabled it or an error you would see in the log enabled it.
  • edited March 2019
    Ok think I did that.. anyway, I did downloaded the latest Repetier_Host and installed it. I did three test runs and the bed did not heat. I did play with the controls and got the extruder to heat! Here are the log files. The bed did not heat at any time and the extruder did not heat using the software.  Thanks for your help. I think this is just some setting that has to be changed and is a easy fix.. Just my thoughts.. Best to you Richard 

    I do not see the log files.. aren't they saves when the comments are saved???? Here are links from DropBox..please take a look at them.. they are small files..... Thanks 

    https://www.dropbox.com/s/lhiui328ztcfwhx/Repetier_Log_Cura_Engine_01A.txt?dl=0

    https://www.dropbox.com/s/cif8qmusvvwjgag/Repetier_Log_Prusa_slicer_01A.txt?dl=0

    https://www.dropbox.com/s/cunhd6ndezy1ycq/Repetier_Log_File_Test_01A.txt?dl=0




  • Logs show you try to preheat bed but it does not heat. Firmware sees it is heating and output is set to 100%.
    Does printer have main power enabled? Is here a separate fuse for heater outputs? Don't know the melzi boards so well, but I can see that firmware wants to heat bed and no temperature rise is present. I also saw that pin names were good, so you should measure if outputs get power when heating or not. If they are heating test if bed heater is maybe broken/shorted. If it gets no power test other outputs if they get power instead. Also check if you have a fan using same output pin. This is with RAMPS a problem as fan output and heater 2 output are the same pin.
  • edited March 2019
    Ok from my testing this is what I have discovered. If I manually turn on the extruder heat and check the voltages on both pins one side is 12V and the other is about zero, which tells me that the FET has turned on and is allowing the flow of current which heats the exruder.. Now if I manually turn on the heater for the bed, I still get 12 Volts on both sides.. so the FET is NOT turning on ..... So.... it could be a bad FET, Could be bad code, Looking into it and will compare with 0.91 code... Your thoughts.... More to come... Richard   

    Ok both .091 and 092.9 have pin 12 as the heater pin.. I will pull the board and check the Mosfet. give me a few days to get a new one.. Keep you informed.. Richard 
  • Shouldn't one side always be gnd/0V?
    You can try a simple sketch just setting the pins to output and high or low to verify hardware. Then you know no other code interferes.
  • No when you want to heat the extruder the Mosfet is turned on and one side will be Zero and the other plus 12V. That means there is 12V across the heating element... so it heats.. Just like a big resister.. gets hot.. The Mosfet for the heat bed is not turning on.... so it does not heat.. I will try to load a simple bed warming sketch.. 
  • edited March 2019
    Ok I reloaded V.91 on the board.. and the bed works just fine.... So do extruder, X, Y and Z axis...... Now I upgraded the firmware to V.92.9 because of bed leveling.....I did not install any bed leveling device because I wanted to test the system first... Do I need to turn off bed leveling first to get the bed to heat up????? Thanks Richard.. Oh, so the it it not the board.. we can rule that out.... 
  • Bed leveling and heating are separate. So that is not the reason. On RAMPS the reason is often that a fan is using same output since there only so few power outputs. Maybe you also assigned a fan to bed output?
  • I will check it out.. Thanks.. Let you know.. 
  • ok still working on it.. tried a few things.. and nothing seemed to work.. I loaded 1.0.3 and it worked except the bed heating.. i tried .92.9 and messed up the display where it shows Centigrade instead of Fahrenheit. but I think I can fix that.. interesting I tried using pin 10 and pin 12.. i am getting my data from the web and comparing i to what is in boards.h layout.. and I am using board 63..  which is what .91 used.. If you have any ideas please let me know.. and the fan is pin 4. Always on.. .  
  • pins are the same I guess for bed?

    We have no farenheit view and never had, so that is ok. Did you check eeprom after upload of 1.0.3? It might be that bad values for bed PID prevent it from heating. That is the last idea except dry run, but then extruder will also not run.
  • Ok a few things making progress....got the bed to work...  here are a few things:
    1)   
    in the pins.h melzi code there is a line that has -2 as a value.. I think it should be-1 as in....
    #define ORIG_X_STEP_PIN         15
    #define ORIG_X_DIR_PIN          21
    #define ORIG_X_MIN_PIN          18
    // RWB Changed to -1.. per V0.91 pins.h. file 
    //#define ORIG_X_MAX_PIN           -2
    #define ORIG_X_MAX_PIN           -1

    2)
    Ok the bed works now..I do not know it that was the problem... but the bed works now.... I will test 1.0.3 later in the day and see what happens... 

     HOWEVER...

     the reason I thought there was a Fahrenheit problem was because the values on the display were zero... I have now figured out...when I use the Repetier host software and manually turn on the bed and extruder heater, the values on the display become active and change to zero when that item is turned off/deselected.. This did not happen in version 0.91... Quite a change.. I think V.91 did it better..The question is .. Is that Normal????

    Also the temperature values may not be right. I am getting a temperature device and hope to test is soon.  

    So, let me know at the values going to zero when the bed or extruder is turned off in the Repetier host software. I will test V1.0.3 and get a temperature gun/laser to see if the temperature being display is correct.. this may take a few days.. 
  • edited March 2019
    OK installed 1.0.3 and it seemed to work OK.. I made the calibration cube and looked... well quite good for a first try.. NOTE: The extruder came back with a JAM error code.. I pressed OK and the calibration cube was made.. I still have jam on the extruder temperature display area. Also the max temps are zero because Repetier-Host has them turned off. Hope I can fix that in a configuration someplace. I did not test out V.92.9 with a calibration cube. I will print a few more calibration cubes. IS THERE SOMETHING THAT I SHOULD PRINT TO TEST 1.0.3? After that I will install a bed leveling device.. I will send you links to the one I purchased from banggood.com. I saw it used on a TronXY 3S and was told it came with the printer.. That printer as I understand it.. had a Melzi board.. Talk to you tomorrow.. Thanks Let me know what you find out about the -2 from above.. Best to you Richard 

    OH, on the display, Z: is flashing ?.?? then 0.00.... any idea why that is???? on one page of the displays it list X,Y and Z with flashing ?.?? and then 0.00 mm with a open or closed dot next to them.... Any Idea what this is for??? 
  • -1 or -2 should not matter I think, but for consistency I change it to -1 for next update and in case there exists the one function testing -1 instead of < 0.

    Target temperature 0 is off that is right. Not sure where you see it. If it is the top status bar, you can edit the contents there and alternatively show current temperature. It just depends on the format string in the configuration. 0 was always off, so guess you are just confused by seeing the set temperature instead somewhere.

    Test prints mainly depend on what you want to print in the end or what needs to be tested. Cubes are nice to see steps per mm is right and see how much ghosting you get at the letters. It also shows if extrusion is more or less good. For printing Visual objects that is already enough. If you want technical stuff with printed gaps to separate gears or hinges you need to calibrate extrusion and slicer much more to get the gaps as expected. This is quite tricky since some samples use bigger gaps then others just because the creators had better or worse settings.

    A nice test for testing if you have not too much extrusion is printing a 20x20x10 Cube completely solid 100% infill. If you have too much it has no way to flow somewhere and it gets messy with all the extra filament. So if you see that you know extrusion multiplier for that filament must be lower. Normally it is better to have a slight underextrusion then overextrusion. Only if slight gets big underextrusion you get problems.
  • I will test those prints.. and let you know how it goes.. Tomorrow I will install the bed leveling device I purchased from Banggood (China)  - TRONXY® 6-38V Auto Leveling Heated Bed Sensor For Tronxy P802M P802E 3D Printer.
Sign In or Register to comment.