SOLVED!!! Atmega32u4 bootloader Invalid device

Hello everyone,

I am currently doing my Master project and for that i am going to use an ATmega32u4 (the same as Arduino Leonardo) in a pcb. In order to work with it i decided to use it as an Arduino, so i want to burn the bootloader. I found ths webpage explain it how to make it and i followed:

https://murchlabs.com/monday-experiment-bootloading-an-atmega32u4-with-arduino/

Instead of an Arduino Uno, i am using a Nano, but that shouldnt make any difference. i Followed the same connections. The only difference i can see if the arduino, which it shouldnt have any influence and that i use an eternal clock unit of 16MHz, i connected it as its shown in the datasheet (connected to XTAL1, and leaving XTAL2 not connected).

I did folow the steps but in the end it says:

Arduino: 1.8.5 (Windows 10), Board: "Arduino Leonardo"

C:\Users\JLB Ander\Desktop\arduino-1.8.5\hardware\tools\avr/bin/avrdude -CC:\Users\JLB Ander\Desktop\arduino-1.8.5\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cstk500v1 -PCOM5 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xcb:m -Uhfuse:w:0xd8:m -Ulfuse:w:0xff:m

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:\Users\JLB Ander\Desktop\arduino-1.8.5\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM5
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

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.04s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

Error while burning bootloader.

As i see in the message, the ardino cannot recognize the Device Signature. But also says that the target doesnt have any voltage. I checked the cables and everything looks good. Is it related to the chip?

If any had the same problem or similar or knows how to help me, it will be awesome.

Thanks in advance,
Ander

THe problem was the clock source, first i was using the internal RC oscillator, but apparently when i was burning the bootloader it changed by itself to quartz crystal. just use the circuit showed in the link and there will be no problem

If you are having the same error as me, it means there is something not properly connected or something is missing. It means that the signature that the system reads from the board isnt the one that supposed to be, or it can also mean that it didnt read anything, like in my case.

This signature has nothing to do with bootloader, its the "name" of the chip regadless of what bootloader or program has on it. So it will stay the same after you installed the bootloader. If you are getting this error first you have to kno why, there 2 options: or there is no signature like in my case (avrdude: Device signature = 0x000000 (retrying)) or it has the wrong one. In the first case there is something wrong with the circuit, check connections and all componenets, in my case it was the signal source, i changed to an Quartz crystal and no problem. If it is the second one, you are choosing the wrong bootloader or the wrong device, you have to see if the signatures are different, and if they are change the configuration to choose the right signature. For example the arduino uno uses atmega328p and the leonardo the atmega32u4, so you need to be careful to choose the right board before burning the bootloader.

The fuses are to choose some basic configurations (like the clock source). The on chip i was using, had the internal RC oscillaor by default, when i burned the bootloader it changed the fuses specially the clock source, so my chip needed the quartz crystal. Chek the datasheet to see what does every fuse and see if you need to change for your own purposes. Just remeber that the bootloader changes the fuses also.

I hope this helped you, if not you can always answer this. Also all this thing is new for me so i am not sure if everything is right.

1 Like