32u4 bootloader

I am building a project based on 32u4 MCU that will run on 3,3V and 8MHz.

I made several different designs based on 328p, both on 16MHz and 8MHz while burning the bootloader Nick Gammon provided and it works without any issue. Had zero issues on 2560, too. Can not say enough thanks to him.

But, while reading his list of supported bootloaders on https://www.gammon.com.au/bootloader I noticed there is no support for 3,3V 32u4. So it is not an option.

The Adafruit has its series of Itsy Bitsy 32u4 boards and Feather. Many of them use 32u4 on 8MHz. There is a HEX file that should be used somehow, BUT I don't know how.:slight_smile:

Can someone provide some links or examples, I would be grateful.

If need, I will provide schematics, but, basically it's just an ICSP header.

Thanks in advance.

I made several different designs based on 328p, both on 16MHz and 8MHz while burning the bootloader Nick Gammon provided and it works without any issue. Had zero issues on 2560, too. Can not say enough thanks to him.

But, while reading his list of supported bootloaders on https://www.gammon.com.au/bootloader I noticed there is no support for 3,3V 32u4. So it is not an option.

That thing is useful for the very corner case that you needed to create a standalone ISP programmer for burning bootloaders when you have no access to a computer.

But if all you need to do is burn a bootloader, it's the wrong tool. The reason is that the Arduino IDE has built-in support for burning the bootloader. This is superior because it allows you to easily use the latest bootloader for any Arduino board, rather than either being stuck with the arbitrary selection of outdated bootloaders that were provided or figuring out how to encode new ones yourself.

So all you need to do is select the board from the Arduino IDE's Tools > Board menu (in this case, ond of the Adafruit boards you mention), then select Tools > Burn Bootloader. You are still able to use a spare Arduino board as the programmer if you don't own a dedicated programmer. You can learn about that here:

I'm not familiar with the Adafruit boards. Just adding the SparKFun ProMicro to the list of options. You can download the boards package using the boards manager; it will give you a 3.3B/8MHz option as well.

Ok, I finally get all the components. I connect my board with a Nano this way:

D12 -> MISO
D13 -> SCK
D10 -> RST
D11 -> MOSI
5V -> 5V

There is a regulator so 5V is ok. Target is 32u4 with an 8MHz crystal.

My steps:
-select Nano
-select ArduinoISP sketch
-select port
-upload sketch
-connect Nano with 32u4 board
-plug it again on PC
-select board as SparkFun Pro Micro
-select processor 3,3V 8MHz
-select programmer Arduino as ISP
-burn the bootloader

After a maybe a minute I get this:

Sketch uses 6544 bytes (22%) of program storage space. Maximum is 28672 bytes.
Global variables use 447 bytes (17%) of dynamic memory, leaving 2113 bytes for local variables. Maximum is 2560 bytes.

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "�"; type = �
Software Version = i.

Here is the schematic I used for my board.

Ok, after a few tries, I get an error and a message Done Burning Bootloader in green.
The error message is:

avrdude: WARNING: invalid value for unused bits in fuse "efuse", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0xce instead of 0xfe (double check with your datasheet first).

Right now I don't have 22 ohms resistors to check if I can upload a sketch on the board. I hope I will get them tomorrow. So I am not sure if this is ok. Weird.

I think that error is about the fuse bits that aren't used. That would be efuse bits 4 and 5. However, the error message appears to have the values reversed. If the unused bits are supposed to be 1, then you would use 0xFE instead of 0xCE, and it says the opposite.

This same message applies with one of the 328P fuses - you're supposed to use 0xFD instead of 0x05.

I found that after some research. And it appears it is a Warning, not an Error. Today I will get these resistors to see if it actually works.

Ok, the first one works as it should. However, when I tried the second one with the same setup, same Nano as an ISP I get this error:

avrdude: Expected signature for ATmega32U4 is 1E 95 87
Double check chip, or use -F to override this check.
Error while burning bootloader.

Nothing on the internet about this problem.

Ok, I switched on to UsbTinyISP.

First, after I tried to burn the bootloader, I get this:

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cusbtiny -e -Ulock:w:0x3F:m -Uefuse:w:0xFE:m -Uhfuse:w:0xD8:m -Ulfuse:w:0xFF:m

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 : usb
Using Programmer : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\.\libusb0-0001--0x1781-0x0c9f
AVR Part : ATmega32U4
Chip Erase delay : 9000 us
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 : USBtiny
Description : USBtiny simple USB programmer, Overview | USBtinyISP | Adafruit Learning System
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
Error while burning bootloader.
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

Then I switched to the command line and avrdude. I add the -F command and get this at the end:

avrdude: Using SCK period of 10usec
avrdude: initialization failed, rc=-1
avrdude: AVR Device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expect signature for ATmega32u4 is 1E 95 87
avrdude done. Thank you.

Is this means it is dead?

Please clarify - you have two 32U4s? You were able to burn the bootloader to one of them using a Nano as ISP, and then were able to burn a test sketch to it (Blink, or whatever) which runs ok? But none of that works on the second 32u4? Is that right? If so, I would be checking the wiring, and the regulator.

Yes. On the first board, it is ok. I get that warning I mention.

When I go for a second one, I get to this point. I am sitting here for some 5 hours going through the internet for every single clue. I pass the joints several times with soldering iron. Didn't hot air reflow, though. It just doesn't work. Everything I use I get the same I post here. Right now I don't have the third one to check it. Wiring is ok, or I wouldn't make the first one.

There was one issue at the beginning. When firstly connected, I get some low voltage, Something was short, and while I have gone through the soldering iron, it disappeared. But AFTER that I couldn't burn the bootloader. I forgot to write it.

Now, I don't know what is happening to an MCU, neither is it dead-dead, nor dead to revive.

If the first one worked, then it seems something must be wrong with the second MCU or the board it's mounted on. But it seems you're getting no reponse from the MCU. That's almost always a wiring issue, but if the first one worked that seems unlikely. I'm sorry I don't have an answer for you.

I am pretty much afraid I kick-ass of the second one. I triple check the soldering. It is ok. The voltage is ok. I even change the crystal to a second one. Even switch from 8MHz to 16 MHz. Nothing.

As morning is always smarter than the evening (in my case deep night), I am starting to think that with that short I mention I burned it somehow. The voltage now is ok.

Is there a way to check is it dead?

I don't know of a way to test it other than trying to communicate with it with a programmer, as you have done.

I came across a similar problem and the suggestion is to use some JTAG ICE programmer. I never used this thing. There are some cheap ones on AliExpress.

New 32u4's are on their way. Meanwhile, I don't give up on this bricked one. :slight_smile:

I do some research and what I saw is that the solution might be Atmel JTAG ICE. I have one bought a few years ago. It is a clone, actually. I have never used it.

I found out that as it has older firmware, only Atmel Studio 4.17 will work. I downloaded it.

There is not a single page about the datasheet or the schematic of this device. My guess is it is the same as on the original. If so, I should connect the 32u4 this way:


10-pins header should look like this:


Please correct me if I am wrong.

On Win10 there is an issue with drivers. On the JTAG ICE, there is a PL2303HXA chip for which windows installs some new drivers, I think. It needs older drivers, which I install.

It seems this adapter can not power the target MCU, so I have to power it separately.

If not already, it should manually set to be some from 1-4.

Atmel Studio.
There is a tricky part when plugging the device. When plugged, it takes some 5-6 secs to select the device inside the Studio. When plugged in, there is an LED that blinks. Only while blinks, one can select it in the software.

Ok. So I have Atmel Studio 4.17 installed. Drivers for the device installed. If I am right about pinout and connection, there are only a few steps left. And those steps I don't know. :smiley:
I believe there must be some of you that do know. :slight_smile:

I connected it as above. While trying to connect to a programmer, I had that tricky part. With only the adapter in the USB port, I just couldn't connect.
Tools->Program AVR->Connect

When I connect my 32u4 through a header and connect it to a 5V power supply, I get the message:
The OCD JTAG adapter was detected, but there is no target power. Apply power to the target application or target device and click Retry. Click Cancel to try to connect to another port.

Port is ok. Power is connected to 32u4. JTAG ICE is connected to the PC.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.

After a while (almost a year) I take a few PCBs from the above project to make another batch. Of course, the problem with the bootloader is still here. However, these months make me a little bit smarter. Not enough though, as I am still here asking for help. :slight_smile:

While reading a bunch of topics across the internet I found out that the problem can easily be with the wrong capacitor values. I used 22pF. But maybe right here is the problem. Here are the links to the ATmega32u4 and the crystal.

I managed to make two of them work back in the day. So PCBs are ok. MCUs are the same. While burning the bootloader, it behaves the same. I double-checked pins on the microscope. Everything looks fine. What can you tell me about the values of the capacitors? They are critical for some other MCUs more than anything. Say ATmega328pb.