AVR bootloader - Page 1
Forum section: electronics / general

author: PULSSAIR
author_rank: Contributor
timestamp: August 07, 2014, 09:55:38 am
content: Hey, is there any USB bootloader for AVR? I have a board with ATMega32U2 and i want to be able to write HEX files via USB. Is there any bootloader that is able to do this?

author: Psi
author_rank: Super Contributor
timestamp: August 07, 2014, 10:03:36 am
content: You run out of flash/ram/cpu quite fast trying to do software USB on a small 8bit mcu as well as run your own code.A better idea is a serial uart bootloader and a cheap usb cable with built in ftdi chip.However yes, im sure someone has built a usb bootloader into an AVR.Tried googling it?I think some arduino boards have a avr as the usb-serial chip for the main mcu?

author: PULSSAIR
author_rank: Contributor
timestamp: August 07, 2014, 10:27:03 am
content: Quote from: Psi on August 07, 2014, 10:03:36 amThe ATMega32U2 has hardware USB. I found some bootloaders, but for software USB. i would really like to use the hardware USB.Thanks for reply

author: jeremy
author_rank: Super Contributor
timestamp: August 07, 2014, 11:09:31 am
content: yes there is and it comes preprogrammed (unless you have the atmega32U2RC, which is the special version that comes blank). If you put the HWB pin in a certain state (can't remember which, it's in the datasheet), it will wake up in bootloader mode. You can then use Atmel FLIP or dfu-programmer depending on your operating system.

author: PULSSAIR
author_rank: Contributor
timestamp: August 07, 2014, 11:58:04 am
content: Quote from: jeremy on August 07, 2014, 11:09:31 amThanks a lot. Didn't noticed that.

author: firewalker
author_rank: Super Contributor
timestamp: August 07, 2014, 12:03:21 pm
content: Have a look at LUFA.http://www.fourwalledcubicle.com/LUFA.phpFrom the description:LUFA also contains USB bootloaders for the following USB classes:CDC Class, AVR109 protocol compatible (AVRDude)DFU Class, Atmel DFU protocol compatible (Atmel FLIP, dfu-programmer)HID Class, with an included custom cross-platform loader applicationPrinter Class, using the OS's native printer driversMass Storage Class, using the OS's native USB storage drivers

author: SirNick
author_rank: Frequent Contributor
timestamp: August 07, 2014, 09:19:29 pm
content: Quote from: firewalker on August 07, 2014, 12:03:21 pmWTH? You can send aprint jobto update the firmware? That has to be a "because we can" project right there.LikeIP over carrier pigeon.

author: rob77
author_rank: Super Contributor
timestamp: August 07, 2014, 10:22:50 pm
content: Quote from: SirNick on August 07, 2014, 09:19:29 pmactually that's very important technology for eventual post-apocalyptic internet communication

author: westfw
author_rank: Super Contributor
timestamp: August 08, 2014, 01:57:04 am
content: No, no. LUFA is a "Lightweight USB Framework for AVR" and implements the nitty-gritty of hardware USB device definition and IO. You'd have to write the bootloader on top of that.(Supposedly the "TeensyHID bootloader" is an example LUFA project.)One possibility is the "caterina" bootloader used on the Arduino.https://github.com/arduino/Arduino/tree/master/hardware/arduino/bootloaders/caterinaThere seems to be lots of discussion on how to modify/improve it as well. (those horrible arduino-associated people, writing all that useful code that can be used on non-arduino projects! Explaining how things work, and all that stuff. Cursed hobbyists I tell you!)"Teensy 2" has a USB Bootloader called "halfkay", implying "very small." It's proprietary, but if you're a commercial project it might be worth buying/licensing it from Paul...

author: zapta
author_rank: Super Contributor
timestamp: August 08, 2014, 06:41:40 am
content: Quote from: PULSSAIR on August 07, 2014, 09:55:38 amCheck the DigiSpark, both the standard and Pro are open sourced and have USB based bootloader that are compatible with Arduino IDE. The Pro's booloader is 1.5K in size according to this page:https://www.kickstarter.com/projects/digistump/digispark-pro-tiny-arduino-ready-mobile-and-usb-de?ref=emailupdate

author: westfw
author_rank: Super Contributor
timestamp: August 08, 2014, 08:13:01 am
content: Digispark uses an AVR that does NOT have hardware USB. Impressive that it can do a USB bootloader in 1.5k of pure software, but not what the OP was looking for.

author: Psi
author_rank: Super Contributor
timestamp: August 08, 2014, 09:14:56 am
content: Sorry, i totally missed that you were using a MCU with hw USB

author: firewalker
author_rank: Super Contributor
timestamp: August 08, 2014, 01:12:03 pm
content: Quote from: westfw on August 08, 2014, 01:57:04 amThere is a boot loader included. Sparkfun uses it.https://www.sparkfun.com/products/11117https://github.com/adafruit/lufa-lib/tree/master/trunk/Bootloaders/CDC