RuRamps V1.3 and Repetier V1.0.4DEV: work only without the eeprom enabled
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!
Marco
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,
Comments
https://forum.repetier.com/discussion/663/cant-acces-to-my-firmware-eeprom-configuration
#define TWI_CLOCK_FREQ 400000
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.
// I2C EEPROM with 32K of space
#define EEPROM_I2C
#define E2END 0x7FFF
#define MAX31855_SS0_PIN 5
#define MAX31855_SS1_PIN 6
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.
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.
#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 ( ;; );
}
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.