You need to First send command M502 to clear EEPROM and reset to factory settings, then Make sure to save those changes with M500. once reset you will be able to flash the firmware. Remember to measure your Z offset, run a G29, then SAVE all those values with M500 again so they persist in the EEPROM. Hope this helps.