Uploading Leonardo (Micro) bootloader to ATmega32u4RC with ICE - Page 1
Forum section: electronics / general

author: hoser
author_rank: Newbie
timestamp: May 16, 2017, 04:18:01 am
content: I designed a development board with the Atmel ATmega32u4RC that has an external 16MHz crystal and having issues with the bootloader installation. The board was designed so that I could use Atmel Studio but I also wanted the ability to upload the Leonardo bootloader that is on the Arduino Micro so my son could get comfortable with code development.So far I have successfully been able to write and execute code written in Atmel Studioand upload it to the MCU via my Atmel ICE programmer. In the fuse selection, I have the external oscillator selected and verified the functionality by changing my F_CPU clock and monitored the timing.The problem I have is when I select the Leonardo bootloader hex file located at (C:\Program Files (x86)\Arduino\hardware\arduino\avr\bootloaders\caterina\Caterina-Leonardo.hex) the device will show up as an Arduino Leonardo. Once I upload the code, I get an error message stating it cannot find the board.I am curious if this has something to do with the processor being a ATmega32u4RC and not the ATmega32u4 that is used on the Arduino Micro?Any help is much appreciated!

author: FreddyVictor
author_rank: Regular Contributor
timestamp: May 16, 2017, 08:11:20 am
content: Quote from: hoser on May 16, 2017, 04:18:01 amthey have the same signatures, so this isn't a problemsee 2nd pic for signature found on deviceQuote from: hoser on May 16, 2017, 04:18:01 amI havn't used the Leonardo, so not overly sure about themFor normal Arduinos, the BOOTRST fuse is normally setdoes the program actually upload OK & run ?is it just the COM port not appearing after the upload ?

author: hoser
author_rank: Newbie
timestamp: May 16, 2017, 02:48:02 pm
content: I will check the "BOOTRST" fuse this evening but when I upload the program using the Arduino IDE, it says it is uploading then gives the error after ~10 seconds. The program does not run and after I get the error message it is no longer recognized by the IDE. I have to reload the hex file with my ICE programmer in Atmel Studio in order for it to register again.

author: Buriedcode
author_rank: Super Contributor
timestamp: May 16, 2017, 09:24:26 pm
content: I've had similar problems with both the 32u4, mega328/168/88 etc.. and it is almost always the fuse settings that cause problems, specifically, the wrong ones for the bootloader.I just checked here:http://electronut.in/bootloader-atmega32u4/For installing the leonardo bootloader, note the fuse hex's:Code:avrdude: safemode: Fuses OK (H:F3, E:99, L:5E)As to how that translates to the fuse settings I do no know, but I'm sure you can just set them with values. I have bricked a couple of AVR's by changing the SPIEN bit, which leaves only high voltage programming available, so if you set the fuses just with HEX values - make sure that at least is still checked.

author: hoser
author_rank: Newbie
timestamp: May 16, 2017, 11:05:20 pm
content: Thanks guys, I changed the fuses and I am now able to upload the sketches from the Arduino IDE. My Red and Blue LED are working perfectly along with an onboard tact switch but for some reason I cannot flash the green LED in my RGB LED on pin 13 but the main issue has been resolved.