Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Burn bootloader to 32u4 fails

Open Smashcat opened this issue 2 years ago • 3 comments

This has been an issue for a few years now. The Arduino IDE (currently using 2.2.0) cannot burn the bootloader to this chip as it attempts to set the high fuse bits, which cannot be done. Unsure why this still isn't fixed. Typical error message:

avrdude: WARNING: invalid value for unused bits in fuse "lock", 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 0xff instead of 0x3f (double check with your datasheet first). avrdude: verification error, first mismatch at byte 0x0000 0xf3 != 0xcb avrdude: verification error; content mismatch Failed chip erase: uploading error: exit status 1

Smashcat avatar Aug 29 '23 14:08 Smashcat

This is using an ATMEL ICE programmer to a 32u4 on a custom board. The chip can be programmed/tested using the Microchip Studio IDE, and it does appear as a USB device also, so that part is working.

Smashcat avatar Aug 29 '23 14:08 Smashcat

@Smashcat
Verify the Fuse Settings Double-check the fuse settings for your specific microcontroller. You can use the Engbedded Fuse Calculator to find the correct fuse values.

If the Arduino IDE is not setting the fuses correctly, you can try using AVRDude directly from the command line to set the fuses manually. This allows more control over the process. The command might look something like this: arduino documentation suggested command line: avrdude -c <programmer> -p <mcu> -U lfuse:w:<value>:m -U hfuse:w:<value>:m -U efuse:w:<value>:m

if issue solve please let me know

VivekShahare04 avatar Jul 10 '24 07:07 VivekShahare04

Thanks, I think the issue is that the 32u4 chips are delivered to me with fuse settings that are corrupted, and AVRDude cannot set them properly. I just buy chips pre-programmed now instead, as it's impossible to set the fuse bits reliably on them. AVRDude still has the bug, trying to set the high bits from Arduino though.

Smashcat avatar Jul 10 '24 09:07 Smashcat