Simple bootloader on AVR ?

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys,

Does anyone of you have an example or tutorial link (simple one) for creating bootloader on AVR ?
I have tried to find in google and avrfreak itself but can't find the simple and understandable one...

May be someone from you has one ?
I'm thinking boot loader is a code on 0x0000 and there's a small code until 1Kb, and then a code on flash, but I don't understand on how to implement it..

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I searched the tutorial forum for 'bootloader' and got 2 pages of tutorial articles. I'll read them to you over the phone for $30 an hr. Call me. 407-855-2586

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why don't you just get a 900 number, Uncle Bob? Then you can field the psychic and phone sex calls, too.

Not that I know anything about that. But boot ladders, yes. I have a project (AVR Flash Loader) that incorporates a pretty simple bootloader. As CallMe says, there are many others.

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hahahaha....let's create automatic phone caller with boot loader then...hahahaha

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bianchi , we're not joking. Maybe if we charged you we'd get some more respect from you?

The datasheet outlines how the bootloader modes work and what the fuses do. Recently we discussed Arduino bootloaders - why are they not useful to you?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As I believe you use avr-gcc then the obvious candidate to implement a bootloader (though why reinvent the wheel?) is:

http://www.nongnu.org/avr-libc/u...

Read down that page and you see an example routine called boot_program_page() which shows the available APIs being used to implement a high level function. that high level function is about 95% of an entire bootloader. All it now needs wrapped around it is a for() loop to step through flash addresses and feed the data to be programmed. That data itself will likely be coming from a PC over a UART link so you also usually have some UART routines to receive the data and feed it to boot_program_page(). Finally you can implement a bootloader that just receives and programs every byte you send to it but you really need a way to say "this next data goes to location NNNN" and "there are 12846 bytes following this message that need programming" and things like this. This is known as the "bootloader protocol". To save you making ine up from scratch Atmel has helpfully thought up some example protocols to use that they have implemented in their own bootloadable devices (AVR109 in the Atmel Butterfly, stk500 and then stk500v2 protocol for the STK500 and so on). Most people implement one of these simply because there will already be PC side software (usually avrdude.exe) that knows how to talk the PC side of things. So you can say "avrdude -c avr109 ..." or "avrdude -c butterfly ..." or "avrdude -c stk5000 ..." and it will read a .hex file then send the right protocol commands to have the AVR109/AVR910/stk500/stk5002/whatever bootloader receive and program the bytes.

At the end of this process you will have reinvented a wheel that has been invented thousands of times before you!

Oh and here's a 5327th bootloader ever written for the AVR:

https://spaces.atmel.com/gf/proj...

(written by a complete genius!).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Modest too.

Imagecraft compiler user