Arduboy with SD card ?!

Hi, can I change arduboy bootloader to read games from SD card like on gamebuino? (I have DIY arduboy from Arduino Leonardo). Is it possibile , to do?

I think you would need a different bootloader. The gamebuino uses a custom bootloader, but its for a different Atmega chip.

Not sure I trust them. They’re making a claim that seems to be impossible: simultaneously Arduino compatible, Arduboy compatible, and able to load from the SD card. The SD card uses a custom bootloader (no duh), which means that if it’s also arduino compatible, it has to be bigger than the stock arduino bootloader used by the Arduboy, which means it can’t really be compatible with the Arduboy.

Maybe the managed to cram SD card IO and a file system into slop space in the Arduino bootlader, but that seems unlikely to me.

Thanks for link. I think It is a modificated arduboy. I wait for it’s shematics and bootloader.

I find that project questionable. The key is the bootloader like they say and they claim to have a working prototype but they don’t show actual booting from SD card. So I assume they don’t have a working bootloader yet. Just a cloned Arduboy with an added SD card slot.

Unlike Gamebuino which has a dedicated USB serial chip. the USB on the ATMEGA32U4 is implemented in software which increases the bootloader size. Most ATMEGA32U4 bootloaders are based on the Catarina bootloader which is 4Kb (2K-word) in size and which also happens to be the maximum bootloader size supported.

I’m sure the bootloader can be optimized. But without loosing standard Arduino IDE programming compatibility I wonder how much and if it would be enough to implement SD Card loading/booting. (hmm kind of itches to look into this…)

However If they drop the Arduino IDE compatiblility and supply their own program software (Like the Teensy 2.0 does) It’s more doable.

That said I don’t think we’ll find out looking at their pledges and pledge goal.


A word of caution: I think it best to steer the topic away from that particular Kickstarter.

The last thread discussing it was locked and unlisted, and I wouldn’t want that to happen to this thread as this thread has discussed some very important reasons as to why it’s a difficult thing to do.


Yes that would be a shame. But totally understandable. Maybe @Wattsup could remove the link and get focus back on topic.

I don’t know if anyone else here looked into the bootloader. I had a glimpse at a disassembly earlier from my Arduboy backup dump.But today I managed to successfully recompile the catarina bootloader and made a dissassembly from it’s elf file. Which is much easier on the eyes with labels for reference. The bootloader compiled to 4058 bytes with just 38 bytes left in the max available bootloader space.

1 Like

Or we can edit a gamebuino bootloader.

As said earlier, the Gamebuino has a dedicated USB serial chip. The ATMEGA32U4 uses a software implementation for USB support. The SD booting might be interesting to look at though. But first the bootloader has to be crunched down.

I’m going to have a go at assembly level where you can pull out a lot more tricks out of the box.Like putting those lost bytes in the vector table to use and gain 86 bytes (interleaved data can be stored there). also saw several small bits of code that can be optimized.out. But firstly I’ll need to convert the dissassembly so it can be assembled again.

1 Like

I would say we have to change the bootloader so that you need an extra button to switch between programs in the HEX extension. It does not have to be so complicated to have the program to choose on the screen, but it would be cool. I have a question if I need to change the bootloader, can I put the loader from Sd in flash?

Just to throw the idea out there, what if instead of building the SD port into the Arduboy, there was just an accessory (a bit like @eried’s Arduboy Dock) that had an SD slot and a USB port/connector that could be used to load games onto the Arduboy?

Then the focus wouldn’t be on “how do we fit an SD reader onto the Arduboy”, it would be on just making a small device that can read an SD card and act as a game uploader.
It would still be difficult, but @eried proved it can be done with a Raspberry Pi, so the question would just be “what’s the smallest/cheapest set of hardware with which such a thing would be possible”.

As an added bonus, nobody has to throw away their old Arduboys in favour of a new model, they just have to buy an extra accessory.

1 Like

An Adafruit Feather M0 Adalogger could probably do the job. It has a Micro-SD card reader, lipo battery charging circuitry, and supports USB host mode. USB code to talk to the Arduboy bootloader and a user interface would have to be written for it, though. You would also need some sort of display and input for the user interface.

what do you say to that

The 32u4 Adalogger can’t run in USB host mode, so wouldn’t work. Plus, it’s more expensive than the M0 datalogger that I mentioned.

I found a webpage:

Nice idea of that datalogger. It would be a solution for all existing arduboys. But I’ll like the conveniece of a built in slot for a future Arduboy then a bulky accessory to take along.

( just got this idea: )
If the SD card isn’t feasable after all. I’d go using a 8MB SPI flash chip (cause I got a bunch lying around from a project) It wouldn’t take much code to support it.No filesystem, just 256 game slots. since all games are 28K or less (limit of application size) each game slot can have it’s own EEPROM backup slot too. if this was implemented in a future Arduboy DX version or something, the existing case design wouldnt need changes too :smiley: Still would need to figure out a way on how to write to the extra flash using avr dude though…

OK feet back on the ground and nose into bootloader for now :blush:

I made a quick, rough comparison of dimensions:

8mm is a bit on the tall side, but otherwise the dimensions are reasonable.

For uploading, I think an immensely trimmed down version of avrdude would probably work as a baseline. (I mean literally the absolute minimum required for it to upload to an ATmega32u4.) From there further optimisations could be made if necessary.

Would two-way serial communication between the Adalogger and the Arduboy be possible like it is with a regular computer?
If so the Arduboy itself might be able to act as a display as it does with @eried’s dock.

(I’d suggest a slightly more sophisticated/compact communication protocol though. Binary based rather than string commands. I did once have a conceptual set of such commands written down somewhere.)

Even ignoring the bootloader I think fitting a microSD slot onto the board would be difficult to do without breaking the ISO/IEC 7810 ID-1 standard.
(i.e. it wouldn’t be credit card sized, I just really wanted to quote the actual standard name :P.)

1 Like

Sure, but it would mean a double load for each sketch; once to load a UI sketch and a second to load the target sketch selected from the UI.

The maind advantages of using the Arduboy is that it’s a nice big screen that could support a large-ish list and it’s already got a set of buttons with inferable meaning.

Putting a screen on the other device would take up space and marginally increase the price, and a small screen would limit how much information could be displayed at once, requiring either more buttons or more complicated software to offset that limitation.

I suppose it probably depends how much a sketch upload drains the battery by. I’ve not seen many figures regarding the battery drain of different actions/features (beyond the obvious ‘lots of bright pixels drain battery’).

Another consideration is the limited write life of program flash. If you were to use this method exclusively, you’re essentially halving the total upload life of the Arduboy (of course, it’s still a pretty big number).

If I were doing it, I’d probably go with the 64x48 0.66" OLED “little brother” of the one used for the Arduboy, and maybe 3 small pushbuttons for up/right, down/left, select.