RuRamps V1.3 and Repetier V1.0.4DEV: work only without the eeprom enabled

edited October 2018 in Bug Reports
Hi team, i've this big problem only with Repetier firmware.
If i come from Marlin 2 or MK4Duo to Repetier firmware after flashing i can't see anything on the LCD display, and the Arduino Due go in to boot loop.
I've tried "EEPROM 1" and "EEPROM 2", same result, the firmware work fine only if i disable the eeprom with "EEPROM 0".
With Marlin 2 and MK4Duo no issue, M500 correctly saves the parameters in the eeprom.
The eeprom on RuRamps is not dead, it's only Repetier that goes haywire when it tries to access it during boot.
What I ask is a simple change, that is, if the firmware fails to read the eeprom (corruption or not for Repetier firmware) should erase it and then reboot, or if another solution is possible as long as I can make it functional again.
I think the problem is because Repetier finds some values at "00" in eeprom and does not interpret them correctly.
So now i've EEprom Set 1 and 2 both corrupted, adios Repetier! :-)
I wait your fix, thanks!
Regards,

Marco



Comments

  • The video that show the problem...



  • That is not how eeprom works. Changing 1 to 2 or back will make it work, except if there is no communication using I2C. Here are the settings used for ruramps

    #define TWI_CLOCK_FREQ          400000
    // see eeprom device data sheet for the following values these are for 24xx256
    #define EEPROM_SERIAL_ADDR      0x50   // 7 bit i2c address (without R/W bit)
    #define EEPROM_PAGE_SIZE        64     // page write buffer size
    #define EEPROM_PAGE_WRITE_TIME  7      // page write time in milliseconds (docs say 5ms but that is too short)
    // specify size of eeprom address register
    // TWI_MMR_IADRSZ_1_BYTE for 1 byte, or TWI_MMR_IADRSZ_2_BYTE for 2 byte
    #define EEPROM_ADDRSZ_BYTES     TWI_MMR_IADRSZ_2_BYTE
    #define EEPROM_AVAILABLE 1


    Tried to find the board in mk4due but could not find it by the name.  What board id is used there and which timing settings do they use?

    You could try TWI_CLOCK_FREQ 100000 instead. Maybe that will work. Unfortunately I have no ruramps board so I can not test which setting will work. Here I need your help to find what that problem is. It is quite clear that I2C never succeeds reading which is when it gets no answer from the device. Posiible reasons are wrong serial addr or wrong speed. Don't think it is the page size/write time.
  • edited October 2018
    The board in MK4Due is "1550.h":

    // I2C EEPROM with 32K of space
    #define EEPROM_I2C
    #define E2END 0x7FFF
    #define MAX31855_SS0_PIN            5
    #define MAX31855_SS1_PIN            6



  • edited October 2018
    #define TWI_CLOCK_FREQ          100000
    it does not solve the problem.
    The only way I found it working is to erase (with all FF)  the eeprom with a simple program.

  • edited October 2018
    To reproduce the issue:

    1) put all the parameters in the Repetier eeprom with the value "0" (with the server or the host)
    2) flash Marlin 2.0 bugfix (the latest github version)
    3) in this situation the M500 command it doesn't work and shows a "Writing Eeprom" in loop, after some unsuccessful attempts he resets the board
    4) remove and replace the power supply to the board
    5) flash the board with Repetier and it doesn't boot

    I think the only solution is to do as I suggested above, perhaps with a counter, if it fails to load the eeprom must erase it.
  • edited October 2018
    This is the program for erase the whole eeprom, and after this Repetier start without any issue, so please check where is the  bug in your firmware:

    #include <Wire.h>

    #define EEPROM_ADDR  0                    // Slave Address 0 (A0=0,A1=0,A2=0)
    #define EEPROM_CMD   (0x50 | EEPROM_ADDR) // Eeprom command for starting read/write action
    #define EEPROM_WAIT  7                    // 7ms because 5ms seems to less
    #define EEPROM_START 0x0000               // Eeprom start address
    #define EEPROM_END   0x8000               // Eeprom end address

    #define EEPROM_CLEAR_VAL 0xFF

    void EEPROM_write (unsigned int addr,byte data)
    {
      int rdata = data;
      Wire.beginTransmission (EEPROM_CMD);
      Wire.write ((int)(addr >> 8));       // MSB
      Wire.write ((int)(addr & 0xFF));     // LSB
      Wire.write (rdata);
      Wire.endTransmission ();
      delay (EEPROM_WAIT);
    }

    byte EEPROM_read (unsigned int addr)
    {
      byte data = 0xFF;
     
      Wire.beginTransmission (EEPROM_CMD);
      Wire.write ((int)(addr >> 8));       // MSB
      Wire.write ((int)(addr & 0xFF));     // LSB
      Wire.endTransmission ();
      Wire.requestFrom (EEPROM_CMD,1);

      if ( Wire.available() )
        data = Wire.read ();
       
      delay(EEPROM_WAIT);
     
      return data;
    }

    // Arduino Program Setup
    void setup ()
    {
      Wire.begin ();
      Serial.begin (115200);
    }


    // Arduino Program Loop
    void loop()
    {

      Serial.println ("Starting clear EEPROM");

      for (int addr=EEPROM_START; addr<EEPROM_END; addr++ )
      {
            EEPROM_write (addr, EEPROM_CLEAR_VAL);

            if ( (addr % 10) == 0 )
              Serial.print(".");
      }
     
      Serial.println(" ");
      Serial.println("EEPROM cleared, verifying");

      for (int addr=EEPROM_START; addr<EEPROM_END; addr++ )
      {
        byte data = EEPROM_read(addr);

        if ( data != EEPROM_CLEAR_VAL )
        {
          Serial.println("There was errors during eeprom clear. Abort!");
          for ( ;; );
        }

        if ( (addr % 10) == 0 )
          Serial.print(".");

        delay (10);
      }

      Serial.println("Eeprom cleared correctly. Reset Arduino.");
      for ( ;; );
    }


  • Ok, have uploaded Marlin 2 to my RADDS board (same eeprom type) and afterwards the repetier firmware and it was no problem. Until now if I had a problem I just changed eeprom mode between 1 and 2 and it worked always. Checkum can only match one of the modes. There is a slight chance (0,39%) that checksum matches between marlin and repetier causing a problem with one of the modes.

    Another thing that also leads to a reset loop is if you use e.g. Repetier-Server with autodetect and connection fails due to different baud rate.


  • Try again with MarlinKimbra...
Sign In or Register to comment.