I was really happy when I found the GB bootloader, because this is exactly what I need for a project of mine. My basic intention is to load sketches from the SD card in order to update my arduino uno in the field. Thus flashing the arduino via the serial interface is not an option.
So here is what I've done so far:
I checked the documentation on the GB bootloader here: https://github.com/Rodot/Gamebuino/tree ... buino_boot and followed the instructions. I was able to flash the bootloader successfully to my arduino uno via USBasp. Afterwards I checked if the arduino is still optiboot compliant and uploaded the Blink example via USB. This worked, so I assume that the GB bootloader is successfully flashed.
Next I created a partition 32MB partition on my 4GB microSD card that is FAT16 formatted. I copied the compiled HEX-file "blink.hex" to the SD card. When I run the arduino example sketch for displaying all files on the SD card, the sketch gets listed. Thus I also assume that the wiring of the SD card is correct. Here is the output of the sketch:
Initializing SD card...initialization done.
BLINK.HEX 6195
done!
I also double checked the wiring with the schematics of GB and everything seems fine. Here is the wiring:
ARDUINO -> Adafruit microSD breakout
5V -> 5V
GND -> GND
PIN 10 -> CS
PIN 11 -> DI
PIN 12 -> DO
PIN 13 -> CLK
At least I flashed the sketch that is responsible for loading the target sketch to the arduino. Which looks like the following:
- Code: Select all
#define load_game (*((void(*)(const char* filename))(0x7ffc/2)))
void setup() {
Serial.begin(9600);
delay(4000);
Serial.println("Load Blink");
delay(100);
load_game("BLINK");
}
void loop() {
// put your main code here, to run repeatedly:
}
After the "Load Blink" is written to the serial monitor the sketch is stucked and the red LED on the Adafruit microSD flashes infinitely.
Here is an image of the wiring.
Do you guys have an idea what the problem might be? Is there anything else I have to consider when formatting the SD card? I would be grateful for any help!