Can't upload to my arduboy [Solved]

When I try to upload any sketch, it just hangs

We’re here to help. Tell us a little more about your process.

When you plug the Arduboy into your computer with the USB cable, does the yellow light flash and do you hear a USB-Connected sound from windows?

What is hanging? Is the Arduino software freezing? If it fails to upload it should give an error message in the bottom of the window.

Are you sure you’ve selected the right board? Sometimes I forget to switch from Arduino Uno to the Leonardo. Also make sure you’ve got the correct port selected.

Have you installed any other games before or are you still running from the software that came with the Arduboy?

Let us know and we can go from there.

Yes the yellow light flashes, and I do hear a connection sound. When I upload, the Arduino IDE hangs on the upload step and it does respond, but it never finishes uploading. Currently it’s running MicroCity

One quick test, if you are using Windows:


(Select MicroCity on the step 4)


Another alternative:
Go to preferences in Arduino IDE and enable Verbose:

Then try to upload again and copy the text that appear in the bottom panel in the IDE here in the forum to help you further.

Have you tried putting it into flashlight mode before uploading?
Hold UP button whilst turning on.

1 Like
Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Arduino Leonardo"

Archiving built core (caching) in: C:\Users\bearo\AppData\Local\Temp\arduino_cache_363712\core\core_arduino_avr_leonardo_a94ab6aaf61dfb93b4a8079c694a14c2.a
Sketch uses 23948 bytes (83%) of program storage space. Maximum is 28672 bytes.
Global variables use 1320 bytes (51%) of dynamic memory, leaving 1240 bytes for local variables. Maximum is 2560 bytes.
Forcing reset using 1200bps open/close on port COM3
PORTS {COM3, } / {} => {}
PORTS {} / {COM3, } => {COM3, }
Found upload port: COM3
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avrdude -CC:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM3 -b57600 -D -Uflash:w:C:\Users\bearo\AppData\Local\Temp\arduino_build_901079/SHRUN_AB.ino.hex:i 

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\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: ser_recv(): read error: The I/O operation has been aborted because of either a thread exit or an application request.


avrdude: butterfly_recv(): programmer is not respondithe selected serial port avrdude: butterfly_recv(): programmer is not respondi does not exist or your board is not connected
ng
avrdude: ser_drain(): read error: The device does not recognize the command.


avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: The device does not recognize the command.


avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: The device does not recognize the command.


avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_recv(): read error: The device does not recognize the command.


avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: The device does not recognize the command.


avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "&"; type = @
    Software Version = ž.v; Hardware Version = “.ð
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: The device does not recognize the command.


avrdude: butterfly_recv(): programmer is not responding
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: The device does not recognize the command.


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: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: The device does not recognize the command.


avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: ser_send(): write error: sorry no info avail
avrdude: ser_recv(): read error: The device does not recognize the command.


avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader

avrdude done.  Thank you.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

This worked, thank you very much

3 Likes

Sounds like the “magic number” issue preventing a usb-reset I think. Applications that use more than 70% of ram can run into this problem sometimes.

70% ? Is that a guess or a tested number?

Either way, its a pity the Aruino IDE reports memory warnings at 75%.

Do you know why this works? I was having an issue with uploading as well and this works for me. Even though this works, is there some other problem with it that this merely bypasses? (and should I fix that problem?)

The source code indicates it’s because flashlight() disables timer 0.

A not so techy answer…

Basically some sketches/ games use too much memory that’s required by the bootloader to run correctly. Flashlight mode essentially runs a smaller program, it’s a bit like windows safe mode loads minimal programs & services or entering bios but not exactly the same if that makes sense.

Actually, it’s very rare that the timer is what’s overwriting the magic number. It’s most often the screen buffer that ends up overlapping the magic number and frequent calls to display() in the game cause the magic number to be overwritten.

So, although the power_timer0_disable(); prevents the very rare case where the timer interrupt is corrupting the magic number, it’s the infinite while (true) loop that prevents the majority of cases.

2 Likes

There’s not much you can do. It’s a problem with the design of the Arduino system. In the future we hope to use custom core code for the Arduboy, which will provide a fix.