Shop OBEX P1 Docs P2 Docs Learn Events
Load EEPROM from SD card. — Parallax Forums

Load EEPROM from SD card.

mynet43mynet43 Posts: 644
edited 2009-06-06 00:26 in Propeller 1
I'm looking for a way to easily upgrade firmware in a product that's in the field.

I'd like to be able to send out an SD card, plug it into a socket and have the Propeller automatically copy new firmware to the EEPROM. So it will boot the new code the next time it is powered up.

Does anyone have propeller code to do this?

Thanks for the help.

Jim

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-06 00:21
    FemtoBasic (from the Propeller Exchange) has code to do this. The COPY statement is used. The code is roughly from lines 1078 to 1108 in FemtoBasic.spin

    This won't "automatically" copy the code, but it can be made part of your program. If you wire up the Card Detect switch, your program can tell if there's an SD card in place and see if there's a file with a particular name on the card, then copy the file to EEPROM if present. I recommend completely reading the file and maybe doing a checksum on the data before copying it to EEPROM. If there's some kind of error on the SD card, your good EEPROM version won't be overwritten until you're reasonably sure that the new copy is ok.

    Post Edited (Mike Green) : 6/6/2009 12:27:53 AM GMT
  • mynet43mynet43 Posts: 644
    edited 2009-06-06 00:26
    Hi Mike,

    Thanks so much for the quick reply.

    I'll take a look at the code.

    Jim
Sign In or Register to comment.