Bootloading from SD card

Would it be possible to develop a bootloader that could load a program from an SD card or Thumb drive (via usb host controller)?

With the SD I don't see why not, it's just getting the data from a different source. Don't know about the USB options though, that's effectively what's happening with the standard bootloader albeit not directly from a thumb drive. To get data directly from a drive you would have to be a USB master (or whatever it's called).


Rob

SD has been done:

It does however use the uMMC which does the heavy lifting as putting all the code for the SD card inside the bootloader space would be tricky.

USB drive would also be possible probably with the USB host shield but again you might need an extra processor to control it as it requires quite a bit of code to control the USB shield.

Thank you, but that wasn't what I was asking, I meant so that if you had a 512 MB SD card, you could have a 512 MB program code (as opposed to transferring a hex file to the internal flash memory.). Again thank you for answering as best as you could.

Ahh, the answer to that unfortunately is no as the chips are the wrong type of architecture to be able to load programs from an external source.
You could however write programs which an interpreter running on the arduino could understand.
Bitlash (an arduino interpreter shell) has also been used with the uMMC where it reads the commands from the SD card. This has its limitations though due to the limitations of what the bitlash interpreter can understand and perform.

This could no doubt be done from any SD card reading module/device as well.

Just around at the right time:

Is it possible to use this bitlash to upload a new sketch to the arduino, so I could offer firmware updates to my finished product?

You can upload new Bitlash code easily to change behavior in the field. That is, really, what it is for. :slight_smile:

Uploading new Arduino sketch code, not so easy.

-br

Is it possible to use this bitlash to upload a new sketch to the arduino, so I could offer firmware updates to my finished product?

That's what the uMMC implementation was coded for - someone wanted to provide updates from SD card to the product. If your project has no other uses for SD storage then that's probably not an ideal solution. Perhaps write a simple GUI hex uploader for your device (assuming it's got USB still) so the customer can plug it into their computer to upload a new firmware update.

mowcius:
That’s what the uMMC implementation was coded for - someone wanted to provide updates from SD card to the product. If your project has no other uses for SD storage then that’s probably not an ideal solution.

Ok thanks, I will check that out.

mowcius:
Perhaps write a simple GUI hex uploader for your device (assuming it’s got USB still) so the customer can plug it into their computer to upload a new firmware update.

Lost me at perhaps :smiley:

That said, I don’t plan to have USB on the final device (if I ever get that far) but SD storage will be included so not really an issue.

Going a little off topic now but speaking of USB, I wondered about putting a connector on the finished board to allow me to connect my ft232r breakout board if I happened to be on-site and needed to upload a new sketch. Anyone have thoughts on that?

Well you could add all manner of proprietary/unusual connectors or just put one inside the case so you have to take it apart to upload a new sketch but I don't see why not.

I am using 2boots - embedded/avr/2boots at master · thseiler/embedded · GitHub

Works very well. I have used it on various Arduino Platforms.

Description - Quoting Author "

This is a dual bootloader for Atmel AVR atmega chips. It combines
a serial bootloader and a mmc/sd card based one in the same 2kb of flash
memory that is normally used by the arduino serial loader alone.

You might ask Why? Well, I have quite a few arduino "in the field".
I can simply drag a .hex file to an SD card, insert it in an SD shield,
and field-upgrade my boards without additional hardware. At the same time,
I can connect the serial port and start developping with the normal Arduino
IDE.

Features:

  • Uses just 2kb of flash, so it fits into the normal boot block of most atmegas
  • Serial bootloader is arduino compatible (avrdude / stk500v1)
  • MMC bootloader can read directly a *.hex file
  • Supported are FAT16 formatted cards up to 1GB in size
  • All of ladyada's fixes to the original bootloader are included "

Perhaps this is what you were looking for.