Go Down

Topic: Flashing a sketch from SD card using 2boot bootloader (Read 14 times) previous topic - next topic


Apr 04, 2012, 01:32 pm Last Edit: Apr 04, 2012, 01:34 pm by martin_bg Reason: 1

I have been trying out this SD card bootloader


but was unable to get it working with the SD card part, the normal sketch upload over Arduino's IDE works fine but not the flashing from SD card.

Can someone else please try it and confirm? It may be me doing it wrong.. :)

I am testing it with "Arduino Ethernet", WIZnet CS is on Digital 4; Programmer is USBTiny

I am using a modified accordingly flash.sh to upload 2boots-arduino-atmega328p-16000000L-PD4.hex


Which file system is on the SD card?  2boots needs FAT16.


Apr 05, 2012, 02:54 pm Last Edit: Apr 05, 2012, 05:47 pm by osbock Reason: 1
Martin thanks for starting this topic and pointing out 2boots!
I have also been having difficulty getting it to work. My platform has a different chip select, so I added the appropriate targets. The serial part of the bootloader works fine, but it never loads anything from SD. I've tried both 1GB and 2GB cards, formatting from Windows 7 explorer, Storage Manager, and on Linux using mkdosfs -F16, and the SD association's official formatter.

I dug in a little (I had to comment out the stk500v1 code to have room for debugging, I suppose I could have changed the linker arguments...)
and it's failing in this format test:
Code: [Select]
if ((vbr->bsFileSysType[0] != 'F') || (vbr->bsFileSysType[4] != '6')){
  return 2; // No FAT16 found
The actual bytes in both those fields are zero.
Seems like it's sensitive to format, and that could be improved. After browsing the wikipedia article on the FAT "standard" I can see how that might be challenging!
Can anyone recommend a  format utility or method (such as a dd-able image) that I can at least try this?


Here's a little more info on my card (as currently formatted, I tried a canon powershot this time.)
(parted) print
Model: SD SU01G (sd/mmc)
Disk /dev/mmcblk0: 988MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type     File system  Flags
1      69.1kB  988MB  988MB  primary  fat16

Go Up