Trouble with leonardo bootloader on custom atmega32u4 board

I'm having trouble getting my board to be recognized by Windows with the Leonardo bootloader. Essentially I want a Leonardo clone so I can get COM port output while my code is running. I can load the default bootloader from Atmel's website and the board gets recognized by Windows as "ATmega32U4" but when I load the Leonardo bootloader it shows up as a "Unknown Device" with error code 43. My assumption is that the fuse settings are OK since the board enumerates with the default Atmel bootloader. I've tried every suggestion I've been able to find online but haven't had any luck. Does anyone have any ideas?

Here's a link to the schematic, it's a very simple board.

Doesn't one typically want a pull-up resistor on Reset?

What process did you use to install the Leonardo bootloader?

johnwasser:
Doesn't one typically want a pull-up resistor on Reset?

What process did you use to install the Leonardo bootloader?

Forgot to mention I added a 10k pull-up on the reset pin. Wasn't able to load code to the board without it. (doh!)

I've been using the Arduino IDE to burn the bootloader. I've got a Leonardo board I loaded the ArduinoISP code onto then selected the burn bootloader option. The output shows everything was loaded successfully but when I plug it in it doesn't enumerate properly.

I don't see an ICSP header on your schematic. How do you connect the Leonardo running the Arduino ISP sketch?

johnwasser:
I don't see an ICSP header on your schematic. How do you connect the Leonardo running the Arduino ISP sketch?

Very delicately placed blue wires. XD

I'm very new to the whole Arduino/Atmel experience. I thought the atmega32u4 would come preloaded with a bootloader that would do what I needed but later learned that wasn't the case so with a steady soldering iron and some patience I've managed to "breakout" the necessary pins. :slight_smile:

I believe the chip comes with a USB bootloader of some kind. You can force the chip into "Direct Firmware Update" mode and use a special uploader program to install the Arduino bootloader. Search for Arduino DFU to get more information.

johnwasser:
I believe the chip comes with a USB bootloader of some kind. You can force the chip into "Direct Firmware Update" mode and use a special uploader program to install the Arduino bootloader. Search for Arduino DFU to get more information.

Ok so I've made some progress but don't quite understand why. Using the ArduinoISP I loaded the bootloader for an Adafruit FLORA board and now I've got a FLORA clone with COM port access (yes!). However, I don't quite understand why the FLORA bootloader works yet the Leonardo one doesn't.

One thing I think might be related is that my board as well as the FLORA both use an 8MHz external crystal whereas the Leonardo uses a 16MHz crystal. Does the bootloader need to change because of the crystal difference?

makethings:
One thing I think might be related is that my board as well as the FLORA both use an 8MHz external crystal whereas the Leonardo uses a 16MHz crystal. Does the bootloader need to change because of the crystal difference?

Yes. The serial data rate is derived from the system clock. If the bootloader is compiled for a 16 MHz clock and is run at 8 MHz the serial data rate will be cut in half.

makethings:
One thing I think might be related is that my board as well as the FLORA both use an 8MHz external crystal whereas the Leonardo uses a 16MHz crystal. Does the bootloader need to change because of the crystal difference?

I know that John just answered your question but...

FWIW I just posted my design for a 32u4 based APRS tracker that runs at 8MHz and during my initial tests, I used the bootloader for the "LilyPad USB".

Perhaps that would work better for you? If nothing else it's in the stock environment.

Regards,

Brad.