Q&D Arduboy FX Bootload

This example uses an Arduino uno to burn a new Arduboy FX compatible bootloader to the 32u4 of the Arduboy.

If you are trying to recover an Arduboy that has the mod chip installed follow the instructions here in this reply:

Made a few images that might help people to recover their Arduboy into the new FX if they need to, it is very quick and dirty.

The first step is to configure your UNO as a programmer, if you’ve done this already you can skip these steps and grab the board manager.
Open up arduino and the example sketch Arduino ISP

image

Set your board to UNO

Select your COM Port

image

Upload to UNO
image

Install the Arduboy board package from @Mr.Blinky

Arduino > File > Preferences

https://raw.githubusercontent.com/MrBlinky/Arduboy-homemade-package/master/package_arduboy_homemade_index.json

Tools > Board > Board Manager…

Tools > Board > Arduboy versions > Arduboy

image

You probably want Cathy3k (starts with menu) otherwise the game will start right away and you wont be able to choose games

image

Then burn the bootloader!

image

If you have any problems you should check all your connections a million times, and then if it doesn’t work shake it and try again.

Good luck!

3 Likes

I’m getting an error while trying to burn boot loader with the modchip

does this mean ill have to remove the modchip?

avrdude: Version 6.3-20190619
     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
     Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

     Using Port                    : COM3
     Using Programmer              : stk500v1
     Overriding Baud Rate          : 19200
     AVR Part                      : ATmega32U4
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PA0
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
       flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : STK500
     Description     : Atmel STK500 Version 1.x firmware
     Hardware Version: 2
     Firmware Version: 1.18
     Topcard         : Unknown
     Vtarget         : 0.0 V
     Varef           : 0.0 V
     Oscillator      : Off
     SCK period      : 0.1 us

     avrdude: AVR device initialized and ready to accept instructions

     Error while burning bootloader.
     Reading | ################################################## | 100% 0.02s

     avrdude: Device signature = 0xff00ff
     avrdude: Expected signature for ATmega32U4 is 1E 95 87
     Double check chip, or use -F to override this check.

     avrdude done.  Thank you.

I tried again but had the arduboy turned on and got a different error message

     avrdude: Version 6.3-20190619
     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
     Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

     Using Port                    : COM3
     Using Programmer              : avr109
     Overriding Baud Rate          : 57600
     AVR Part                      : ATmega32U4
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PA0
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
       flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : butterfly
     Description     : Atmel AppNote AVR109 Boot Loader

     Connecting to programmer: .
     avrdude: butterfly_recv(): programmer is not responding
     avrdude: butterfly_recv(): programmer is not responding
     Found programmer: Id = ""; type = @
     Software Version = �.v; Hardware Version = .
     avrdude: butterfly_recv(): programmer is not responding
     avrdude: error: buffered memory access not supported. Maybe it isn't
     a butterfly/AVR109 but a AVR910 device?
     avrdude: initialization failed, rc=-1
     Double check connections and try again, or use -F to override
     this check.

     avrdude: error: programmer did not respond to command: leave prog mode
     avrdude: error: programmer did not respond to command: exit bootloader

     avrdude done.  Thank you.

     the selected serial port 
     does not exist or your board is not connected

I’ve tried many other things but with no success, the errors all seem to have a problem with connecting to the programmer and that the programmer is not responding

I think if you double check your connections again, but you might need to remove the mod chip for it to work. I’ll test on my side and see.

Not anymore. you can upload the bootloader without problems.

In my earlier tests the flash chip did get upset during ISP-ing and it recovered fine after power cycling off and on again. But I do recommend to temporary connect a 10K pullup resistor to the SDA pad to prevent the flash chip from getting upset by the ISP data. If bad luck would strike a one time only bit in a certain register may get set with unwanted consequences)

(There’s no pullup on the mod chip cause the attiny normally takes care of that when it’s programmed with firmware)


Note

if the Modchip has been programmed already but contains faulty firmware the reset pad of the mod chip must be disconnected. otherwise the mod chip may try to flash the faulty bootloader right after ISPing with the UNO has completed.

For what reason/condition?

The mod chip has a press reset for 2 seconds update feature (If that part was successfully flashed)

when ISP-ing the bootloader reset will be held low during the process. The Cathy bootloader flashes fast but if the ISP process takes longer than 2 seconds. the modchip 2 seconds update feature may kick in.


Thinking more about it may be better to ISP the modchip firmware (need to think about it more tomorrow, need sleep).
1 Like

Sorry this may be a bit of a dumb question but what does this mean/what do I connect the other side of the resistor to? also is the arduboy supposed to be on or off while uploadihg the bootloaader?

I think I know why I’m getting the error code about the programmer not responding. I think it’s because I’m using a clone Uno r3 and I read on some other Arduino forums that some clone R3s don’t have the bootloader installed on the Atmel chip and you need a real R3 to flash the bootloader. So I’m probably gonna buy a USBasp
Would this one work? if not which one would/

Oh hm, I don’t think the bootloader that is on the UNO matters, all of the functions you are using it for are contained within the sketch.

I think either you’ll have to wait for instructions on how to bootload the modchip directly, or try removing the modchip and try these instructions again.

My suggestion is hold on for a day or two and we can come with instruction for how to fix this scenario.

this is where I read about the clone Atmel. maybe this is something different? idk.
thank you so much for the help

If there was no bootloader on your R3 Uno clone then you would not be able to upload the ‘Arduino as ISP’ sketch to it.

After the Arduino as ISP sketch was uploaded you may need to connect a 10uF (bigger is fine too) capacator between the Uno’s reset and GND pins.

But as @bateske suggested hold on for a few days. I want to look properly into a solution for this unanticipated case.

1 Like

Ok have had a look at this with a fresh mind.

@Bateske since you’ve also wired up VCC to 5V it’s also important to say:

Keep Arduboy power switch in the Off position !!!

If the modchip was programmed successfully there is no reason to upload the bootloader using an ISP. it would be much more convenient to use the FX activator to update the bootloader.

However in case the modchip was programmed unsuccesfully (verification failed) and one flashed the Arduboy’s bootloader anyway (no longer possible now) then things get a bit more complicated. If I have understood it correctly, this is the case with @TheBossinator

So:

  • We have an attiny with unexpected behaviour because of unsuccessful programming trying to update Arduboy’s bootloader and using the SPI bus.

  • We have Arduboy powering up with unexpected behaviour and possibly using the SPI bus for OLED display and / or flash chip if the Cathy3K bootloader was (partly) flashed.

  • We have the FX flash chip on the SPI bus.

  • We have the ISP programmer (Arduino Uno) using the SPI bus.

When connecting the ISP programmer to Arduboy and trying to program Arduboy, Arduboy will be hold in reset and will not send data to OLED and flash so that’s not a problem. But the attiny is still there trying to program Arduboy too and the flashchip is possibly listening in for receiving commands also (because of a floating chip select) so the ISP programmer won’t be able function properly.

We need to make sure that the attiny doesn’t try to program Arduboy and that the flash chip doesn’t listen in.

This can be done by putting both the attiny and Arduboy in reset, put them in program mode and issue a chip erase. (Both the Attiny and Arduboy will be erased) Once erased they won’t interfere with each other and the bootloader can be uploaded.

To make sure the flash chip doesn’t listen in. The flash chip select can be connected to one of the Unos GPIO pins cofigured as INPUT_PULLUP so it’s pulled high and the flash chip is disabled.

I’ll have a look at the Arduino as ISP sketch to add this.


here's how you should connect the Uno to Arduboy with mod chip (2 extra wires for SCL and SDA):

Here’s the adapted Arduino as ISP sketch:

ArduinoISP.zip (5.7 KB)

Select board Arduino Uno in tools menu and upload it:

Arduboy and mod chip should get erased immediately after power up. but press reset button on Uno once more after 5 seconds after powering up and then:

  • Select board Arduboy versions > Arduboy
  • bootloader > Cathy3K (starts with menu)
  • programmer > Arduino as ISP
  • Burn bootloader
3 Likes

I may just be dumb, but this step seems a bit confusing to me

in this case, what does “power up” mean. do I turn the arduboy on after I upload the new isp sketch?

also, it says “press reset button on Uno once more” so is there a different time in which I should press the reset button?

if you could rephrase this step to make it a bit easier to follow that would be great.
sorry for being a bother

this is supposed to be Arduino as ISP right? or is there a different one because I don’t have an Arduino as ISK option

The moment you connect your Uno to USB or connect it to a power supply.

You keep Arduboy turned off for as long as your Uno is connected to USB or is connected to a power supply

The timing doesn’t have to be precise. When you have connected your Uno to USB or a power supply wait a few seconds or say out loud ‘Arduboy is awesome’ and press reset. wait another second and
burn the bootloader.

Yes I made a typo.

1 Like

SUCESS, the arduboy now says “USB boot” so now I just upload the flash image using the activator right?

thank you soo much for all your help.

1 Like

Sounds like you got it! Great job! Mega KUDOS to @mr.blinky as always.

3 Likes

Yup everything works perfectly now
I cant think of many other communities that would be this helpful and knowledgeable
Big thanks to @Mr.Blinky

2 Likes

if I do the UNO arduino as a programmer
will i still be able to use the arduino uno normally or will i have to buy another one?

After you’re done using the UNO as a programmer, you can upload any other sketch to it and use it for any other purpose.

1 Like