Bootloader troubles

For problems with Gamebuino itself, NOT your project

Bootloader troubles

Postby BenedictTaylor » Sat Sep 27, 2014 1:47 pm

As the name suggests I am having difficulties with the bootloader on my device (This is on my DIY 'Buino if that makes a difference). I am bootloading using an arduino uno with a 100uf cap between ground and reset, and am targeting an arduino nano. The dialogue window at the bottom of the arduino IDE reports that the bootloading has been successful, but it does not allow me to switch between games on the uSD.

I am able to upload the examples through USB, and they just show the game screen when the device is powered (not a Gamebuino splash screen with the c button prompt at the top as I have seen in videos). Also, I have tried running build.bat but it says that 'make' is not an internal or external command, among other things.

So I am asking if anybody can help me with setting up the bootloader, as I have found the Readme instructions are quite difficult to understand, but that may just be me, as I am fairly young. Any step by step instructions or pointers would be very helpful and much appreciated, especially around editing and running the build.bat, and placement of folders in the arduino IDE.

Finally I would just like to apologise if this has been asked before, although a preliminary search did not yield any results, or I have overlooked something obvious.
BenedictTaylor
 
Posts: 12
Joined: Sat Sep 27, 2014 1:25 pm

Re: Bootloader troubles

Postby rodot » Sat Sep 27, 2014 8:22 pm

Hello there, and welcome on the forum!

A few things you may want to check:

Where did you get your bootloader, and when? You should get the latest version from the official library (see download page), it's very easy to install since the last update (simply copy and paste in you sketch book, see getting started).
Then simply select the board "Gamebuino", select your programmer and click "burn bootloader".
If your bootloader is correctly flashed, the Gamebuino run with the SETTINGS program (it's included along with the bootloader), so it should display the splash screen and make the start up sound once bootloader burning is correctly done. Press 'A' twice to set the default settings and save them.

Did you connect your SD socket according to the Gamebuino Schematics (see hardware)?
You SD card has to be 2GB or less, formated in FAT, and contain .HEX files (at least LOADER.HEX).
If you load one of the Gamebuino examples via USB, what happens when you press 'C' while in the main menu (the one with the Gamebuino logo)? It should load the LOADER.HEX and allow you to browse the SD card and select a game file to flash.
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: Bootloader troubles

Postby BenedictTaylor » Sun Sep 28, 2014 8:26 am

1) I downloaded the bootloader about a week ago, and followed the instructions on the git readme. I will try just copying it into the sketchbook folder (does it need to be in a bootloader folder within the sketchbook?)
2) I did try to follow the schematics, but finding them difficult to understand, I looked for the ATMEGA328p pinout and connected it to the default miso and mosi pins. I did connect CS to D10 and SCK to D13.
3) My uSD card is a 64mb FAT formatted device
4)The c button does nothing when at the home screen of a USB-uploaded game

Thank you for your help :D
BenedictTaylor
 
Posts: 12
Joined: Sat Sep 27, 2014 1:25 pm

Re: Bootloader troubles

Postby BenedictTaylor » Sun Sep 28, 2014 12:13 pm

I tried just moving the folders and I got this error:

Code: Select all
  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Gamebuino"
java.io.IOException: Cannot run program "C:\Users\Benedict\Desktop\arduino-1.0.6-windows\arduino-1.0.6\hardware/tools/avr/bin/avrdude": CreateProcess error=2, The system cannot find the file specified

   at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)

   at java.lang.Runtime.exec(Runtime.java:593)

   at java.lang.Runtime.exec(Runtime.java:466)

   at processing.app.debug.Uploader.executeUploadCommand(Uploader.java:125)

   at processing.app.debug.AvrdudeUploader.avrdude(AvrdudeUploader.java:333)

   at processing.app.debug.AvrdudeUploader.avrdude(AvrdudeUploader.java:302)

   at processing.app.debug.AvrdudeUploader.burnBootloader(AvrdudeUploader.java:263)

   at processing.app.debug.AvrdudeUploader.burnBootloader(AvrdudeUploader.java:222)

   at processing.app.Editor$47.run(Editor.java:2498)

   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)

   at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)

   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified

   at java.lang.ProcessImpl.create(Native Method)

   at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)

   at java.lang.ProcessImpl.start(ProcessImpl.java:30)

   at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)

   ... 16 more

Hope this helps
BenedictTaylor
 
Posts: 12
Joined: Sat Sep 27, 2014 1:25 pm

Re: Bootloader troubles

Postby rodot » Sun Sep 28, 2014 12:57 pm

The folders from GitHub you copy and paste to your sketchbook are "libraries" and "hardware", leave subfolders and their content (bootloader, etc.) as-is. On Windows the sketchbook directory is usually named "Arduino" inside the My Documents directory. On OS X and Linux the sketchbook directory is usually named "sketchbook" inside your home directory. You can change its location in Arduino's preferences.
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: Bootloader troubles

Postby BenedictTaylor » Sun Sep 28, 2014 1:52 pm

I moved the files and the arduino IDE said it has burned the bootloader (I realised I had deleted the actual hardware folder in the master arduino folder :oops: ) Now it is the same as before though. I can upload a game via usb, but I don't get the start up screen. Also if I press the c button it shows a 'flashing loader' screen until I let go of the button, at which point it returns to the previous game title screen. However, if I hold it down for about 3 seconds, the loader screen disappears until I let go of the button, where it returns to the game screen. Any ideas why the sd loader will not work?

Thanks again for your continued help :D
BenedictTaylor
 
Posts: 12
Joined: Sat Sep 27, 2014 1:25 pm

Re: Bootloader troubles

Postby jonnection » Sun Sep 28, 2014 7:04 pm

Hi Benedict

To me it sounds like you haven't actually burned the bootloader at all. If I remember correctly, the IDE will report "finished burning the bootloader" even if the process fails (if you scroll back up in the window it might be reported earlier). This is because the IDE calls AVRDUDE to do the bootloader burning and it might be that AVRDUDE doesn't return fail / success to the IDE.

Fortunately, there is a simple check:

- what device are you using to burn the bootloader: USBASP or Arduino-as-ISP ?

If you don't know the answer to that, then its 100% sure you have NOT burned the bootloader and there is no way pressing C will do anything, because all the functions needed are simply not there.

If you DO know the answer, then I apologize, you've mastered the basics, and maybe I can help you ahead from there.
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: Bootloader troubles

Postby BenedictTaylor » Sun Sep 28, 2014 7:12 pm

I am using an arduino Uno as ISP with a 100uF cap between reset and ground (I know that isn't the same value as the arduino tutorial but I figured that it would do the same job). I also bought an arduino ISP board as an easier means to burn the bootloader than manually wiring it up to my uno, but I couldn't get it to appear in the tools - programmer menu. I will try again with the dedicated board as I have just downloaded the arduino 1.0.6 IDE.

Thank you for helping me with this (and the bootloader is an amazing addition to the gamebuino platform, as well as something I have been looking for prior to my discovery of this great device)
BenedictTaylor
 
Posts: 12
Joined: Sat Sep 27, 2014 1:25 pm

Re: Bootloader troubles

Postby jonnection » Mon Sep 29, 2014 4:47 am

Ok. So you have to troubleshoot step-by-step. The difficult part is that with your own 'fakebuino' the problem might be anywhere.

Some basic things:
- bootloader and loader.hex are 2 separate programs
- bootloader contains functions called by the loader.hex
- you can not see the operation of the bootloader other than from a slight delay and flashing led on pin 13. It is therefore very difficult to know if the bootloader is fired up or not. However, if you are able to upload a program from Arduino IDE normally, you know that at least the serial connection part of the bootloader is working

Next step is to find whether your sd-card is working or not. Take any sd-reading example program, even from the arduino IDE. Modify the code and check that the CS pin is set to the one you have wired. If I remember correctly, the sd card reading example will report via serial port. So upload the sd card reading example, put in sd card, open serial monitor and tell if youre able to read your card. If not, 0% chance bootloader will work.
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: Bootloader troubles

Postby rodot » Mon Sep 29, 2014 11:06 am

Another way to check that the Gamebuino bootloader is correctly burnt is to check that settings are kept upon restart. To do so, load the settings program via USB, change the settings (the user name for example), save the settings, restart and check that the user name was correctly saved.
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Next

Return to Installation & Troubleshooting

Who is online

Users browsing this forum: No registered users and 13 guests

cron