Bootloader for games

Hello! I am trying to make a game console. I heared for something called bootloader. How can I burn it and can I use it to run .ino games from an sd card?

Nin10do-guy:
can I use it to run .ino games from an sd card?

No , not at all.

Any other format type for sketch that I can run from sd card?

This is probably what you want:

You will need to compile your .ino file to a .hex file and then convert the .hex file to a .bin file before putting it on the SD card. There are full instructions for doing this as well as bootloader installation at the link above.

Any other format type for sketch that I can run from sd card?

Yes

http://bitlash.net/wiki/start

Pert, this is very useful. I want to check if I understand:

  1. Install the bootloader
  2. Put the bin file in the sd card
    3 . Reset the arduino and the sketch will be uploaded?
    And where can i put the sd card? If i use an adafruit sd shield, can I connect it as it' s shown in the most schematics and plug the sd card there?
    Thanks!!!

Yes, that's correct. You can use the adafruit SD shield or any other SD shield or module. You just need to set which Arduino pin the CS pin of the SD reader is connected to before burning the bootloader. If you're using the "Adafruit Data Logging Shield for Arduino" this is pin 10. It may be a different pin on other shields or if you use a module you can connect it to any free pin. If you use the Arduino hardware package for avr_boot you can select the CS pin from the Tools > SD CS Pin menu

And how do I connect the other pins? Or only the cs is needed?

The SD reader is connected to the hardware SPI pins:

those are set so there's no need to configure the bootloader, it already knows which pins will be used. The shields will have those pins connected correctly, if you are using a module you will have to be sure to get it right according to the information in the link above. The SD CS pin is different in that any pin can be used for it and in fact various shields or boards use different Arduino pins for the SD CS. I have set up the Arduino hardware package so that you can select any of the commonly used SD CS pins (4, 8, 10). If you needed to use a different pin than the ones listed on the menu for some reason then you can set it to any pin you like in the makefile and then compile the bootloader yourself.

So I connect the pins as shown in the table and the cs on a pin that I set and it's done? I don't have to add software for the card, the bootloader itself runs the FIRMWARE.bin?
Thank you very much!

That's correct. No special code at all is needed.

Here's an extra tip that might be useful to you. In the avr_boot instructions it tells you to check the verbose compilation output to find the temporary build folder, which contains the .hex file. That's fine, but there's another way to get the .hex file if you're using a recent version of the Arduino IDE that may be a little easier:

  • Sketch > Export Compiled Binary
  • Wait for the compilation to complete
  • Sketch > Show Sketch Folder

You will see that two .hex files have been saved to the sketch folder. You want the one without "with_bootloader" in the name, e.g. Blink.ino.arduino_standard.hex.

Then you run the avr-objcopy command as instructed in the avr_boot documentation. avr-objcopy is included with the Arduino IDE installation at hardware/tools/avr/bin.

If you want to get fancy you could write a script/batch file that automatically finds the most recent build folder in the temp folder location and then generates the .bin file from the .hex file found in that folder. I've been meaning to look into adding a recipe to avr_boot's platform.txt to generate the .bin file on compilation but I haven't gotten to it yet, that might actually be less work than the script.

Thanks! Tomorrow I will start prototyping.

I don't understand the part with the converting the .hex to .bin. When I double-click the avr-objcopy it shows something like the cmd, writes a lot of lines and exits. I can do nothing.

Please explain exactly what you did. You can't just double click on avr-objcopy.exe, you need to run the full command shown in the avr_boot documentation. avr-objcopy is a command line tool, don't expect to get some point and click GUI. If you want to see what those "lot of lines" say then you need to run it from the command line.

Will this work:

objcopy -I ihex Blink.hex -O binary FIRMWARE.bin

It's avr-objcopy, other than that looks good.

Will this work:
objcopy -I ihex Blink.hex -O binary FIRMWARE.bin

Will this work:
objcopy -I ihex Blink.hex -O binary FIRMWARE.bin

Will this work:
objcopy -I ihex Blink.hex -O binary FIRMWARE.bin

Nin10do-guy:
Will this work:
objcopy -I ihex Blink.hex -O binary FIRMWARE.bin

Why the hell do you keep posting the same thing over and over again? I already responded after the first one. I'm going to have to unsubscribe from this thread because I'm tired of getting spammed. I do want to help you out but I think the documentation provided should be more than sufficient for you to do this on your own.