Author Topic: AVR bootloader  (Read 4953 times)

0 Members and 1 Guest are viewing this topic.

Offline PULSSAIR

  • Contributor
  • Posts: 12
AVR bootloader
« on: August 07, 2014, 09:55:38 am »
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?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 7367
  • Country: nz
Re: AVR bootloader
« Reply #1 on: August 07, 2014, 10:03:36 am »
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?
« Last Edit: August 07, 2014, 10:07:04 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline PULSSAIR

  • Contributor
  • Posts: 12
Re: AVR bootloader
« Reply #2 on: August 07, 2014, 10:27:03 am »
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?
The ATMega32U2 has hardware USB. I found some bootloaders, but for software USB. i would really like to use the hardware USB.
Thanks for reply :)
 

Offline jeremy

  • Frequent Contributor
  • **
  • Posts: 909
  • Country: au
Re: AVR bootloader
« Reply #3 on: August 07, 2014, 11:09:31 am »
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.
 

Offline PULSSAIR

  • Contributor
  • Posts: 12
Re: AVR bootloader
« Reply #4 on: August 07, 2014, 11:58:04 am »
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.
Thanks a lot. Didn't noticed that. |O
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2330
  • Country: gr
Re: AVR bootloader
« Reply #5 on: August 07, 2014, 12:03:21 pm »
Have a look at LUFA.

http://www.fourwalledcubicle.com/LUFA.php

From 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 application
    Printer Class, using the OS's native printer drivers
    Mass Storage Class, using the OS's native USB storage drivers
Become a realist, stay a dreamer.

 

Offline SirNick

  • Frequent Contributor
  • **
  • Posts: 589
Re: AVR bootloader
« Reply #6 on: August 07, 2014, 09:19:29 pm »
Printer Class, using the OS's native printer drivers

WTH?  You can send a print job to update the firmware?  That has to be a "because we can" project right there.  :clap: Like IP over carrier pigeon.
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 1848
  • Country: sk
Re: AVR bootloader
« Reply #7 on: August 07, 2014, 10:22:50 pm »
Like IP over carrier pigeon.

actually that's very important technology for eventual post-apocalyptic internet communication  :-DD
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3066
  • Country: us
Re: AVR bootloader
« Reply #8 on: August 08, 2014, 01:57:04 am »
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/caterina
There 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...

 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6004
  • Country: us
Re: AVR bootloader
« Reply #9 on: August 08, 2014, 06:41:40 am »
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?

Check 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

Drain the swamp.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3066
  • Country: us
Re: AVR bootloader
« Reply #10 on: August 08, 2014, 08:13:01 am »
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.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 7367
  • Country: nz
Re: AVR bootloader
« Reply #11 on: August 08, 2014, 09:14:56 am »
Sorry, i totally missed that you were using a MCU with hw USB
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline firewalker

  • Super Contributor
  • ***
  • Posts: 2330
  • Country: gr
Re: AVR bootloader
« Reply #12 on: August 08, 2014, 01:12:03 pm »
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.

There is a boot loader included. Sparkfun uses it.

https://www.sparkfun.com/products/11117
https://github.com/adafruit/lufa-lib/tree/master/trunk/Bootloaders/CDC
Become a realist, stay a dreamer.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf