asikyle (Customer) asked a question.

Can't get SDU to work (update sketch from SD card).

The purpose of the work I'm doing is to eliminate the need for a USB connection to update the firmware. We need to be able to update via an always-available connection (e.g. ethernet) with no physically present intervention (by us or our customers) in the field, and we can't use the USB port for anything after our product is assembled and installed in a customer facility.

 

I'm using a sketch that blinks the LED at one rate in the original sketch, and then a different blink rate in the updated sketch. In both sketches, I have included the SDU.h that then includes the zero.h with the compiled sketch boot defined as a simple array. I have verified that the size of the sketch increases with SDU.h included.

 

I have exported the updated sketch and renamed it to UPDATE.bin. There is a bit of confusion here because it doesn't export one file--there's one "with_bootloader". I'm using the one without bootloader since this 2-file export / "with_bootloader" doesn't seem to be mentioned anywhere, so I guess that's new behavior from the IDE.

 

I copied the UPDATE.bin to an SD card (I've tried a 4GB card and a 16GB card, and I've tried reformatting with the "official" SD card formatting utility).

 

I don't see any difference booting with or without the SD card inserted. I've tried pressing the reset button next to the LEDs, and I've tried unplugging the USB and unplugging the power from the wall. In all cases, the system boots up normally with the original sketch.

 

Via an SD card sample, I have verified that the SD card slot is functional (the example lists the UPDATE.BIN file on the card).

 

I've pretty much run out of things to try. It seems like the SDU functionality does not work. I would greatly appreciate some suggestions for further testing. Thanks!


  • FACTS_KevinC (AutomationDirect)

    Hey Asikyle,

     

    Attached is a zip folder with an update to the SDU library. To use it you will need to:

    1. Delete the SDU library found here :C:\Users\[name]\AppData\Local\Arduino15\packages\P1AM-100\hardware\samd\1.6.21\libraries where [name] is your username on windows
    2. Unzip SDU.zip into that same folder.

     

    Also of note is that by default arduino setup the SDU library to delete the UPDATE.bin file. If you want to keep it after performing the update we added the option. You would need to uncomment line 23 in SDU.cpp (shown below).

    1. // #define SDU_NO_RM //Uncomment this line to stop program from deleting UPDATE.bin after

    Let me know how this works out for you.

     

    Kevin

    Expand Post
    Selected as Best
  • FACTS_KevinC (AutomationDirect)

    Hey Asikyle,

     

    I have been able to reproduce the issue you've seen and will begin working on getting a fix for it.

     

    Thanks,

     

    Kevin

  • FACTS_KevinC (AutomationDirect)

    Hey Asikyle,

     

    Attached is a zip folder with an update to the SDU library. To use it you will need to:

    1. Delete the SDU library found here :C:\Users\[name]\AppData\Local\Arduino15\packages\P1AM-100\hardware\samd\1.6.21\libraries where [name] is your username on windows
    2. Unzip SDU.zip into that same folder.

     

    Also of note is that by default arduino setup the SDU library to delete the UPDATE.bin file. If you want to keep it after performing the update we added the option. You would need to uncomment line 23 in SDU.cpp (shown below).

    1. // #define SDU_NO_RM //Uncomment this line to stop program from deleting UPDATE.bin after

    Let me know how this works out for you.

     

    Kevin

    Expand Post
    Selected as Best
    • FACTS_AdamC (AutomationDirect)

      Make sure to use the without bootloader .bin file as well.

  • asikyle (Customer)

    It's working with the update, thank you!