JAndrassy / ArduinoOTA

Arduino library to upload sketch over network to Arduino board with WiFi or Ethernet libraries
GNU Lesser General Public License v2.1
435 stars 89 forks source link

SD2Flash2BootAVRHex not working on Arduino Mega ADK (2560) #242

Open proasnet opened 6 months ago

proasnet commented 6 months ago

Dear @JAndrassy , I am trying example from ArduinoOTA Library SD2Flash2BootAVRHex.ino for update program in Arduino Mega ADK, with Ethernet Shield.

  1. Downloaded your myboard - ok
  2. Files from folder myboard copied to hardware folder of Arduino - ok
  3. Selected Arduino Mega 2560 (Optiboot) - ok
  4. Bootloader loaded to Arduino ADK - ok
  5. Return to select Arduino Mega ADK as board - ok ( is right? )
  6. Upload example sketch - ok
  7. Blink LED example export as hex from Arduino IDE and copy as update.hex to a SD card - ok
  8. To a while loop, I added a Serial.print("."); to see loops of copy
    while (hexFile.available() && !ihex2binError) {
      Serial.print(".");
      int length = hexFile.readBytesUntil('\n', buffer, sizeof(buffer));
      lineNumber++;
      ihex_read_bytes(&ihex, buffer, length);
    }
  9. Example is not working. I see in console periodically
    12:50:39.578 -> Initializing SD card...
    12:50:39.578 -> Update HEX file found. Performing update...
    12:50:39.578 -> 
    12:50:39.578 -> .

    That see, that only the first loop was executed. Please help me for run an update. Thank you