yet another bootloader thread

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

Hi fellow Freaks!

I want to experiment with bootloaders a little. I don't really feel like implementing my own from ground up, at least not now. Instead I'd like to reuse some opensource bootloader code. It's easy to find a bootloader for AVR on google, but there are too many of them and most of them are either half-developed, or half-proprietary (even if that wasn't the intent, the most popular booboo is windows side being AVRProg or some exe-only). Recently mentioned LUB seems to be very good, but if I understand it correctly it's not what I need (I don't have DataFLASH, I only need a serial bootloader).

So, the question is: could you recommend a very simple bootloader project that can be used on a mega8, has full source code for both PC and AVR sides, doesn't require AVRProg, under GPL or Berkeley style license?

Please advise, even if your bootloader of choice doesn't fully meet one of my requirements. A Freak's recommendation is worth a lot :)

The Dark Boxes are coming.

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

Well ... if You feel "adventurous" You could try my Mega8 bootloader:
http://privat.bluezone.no/jussis...

The Linux code is a mess ... lots of hardcoded stuff ...

But I've "used" it for about a week now and it seems to work..

Fits inside the smallest bootblock (current size : 124 words ...)

And the license .... well ... don't blame me if Your house burns down ...

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

Thank you juissishow, your bootloader looks exactly like what I need! Will give it a try definitely, expect some questions :)

The Dark Boxes are coming.

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

He heee ... remember to have a bottle of Vodka ready :-) For You, not for me ... :D

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

Managed to "port" the Mega8 version to Mega168 ....

http://privat.bluezone.no/jussis...

The Mega168 version is still "cooling down", it hasn't been tested as much as the Mega8 version ...

Currently the pagesize is harcoded into the PC SW ... Ie. different versions are required for Atmega8 and/or Mega168 ...
(set by TARGET variable in Makefile, or command line ...)

Both AVR versions can be built using the same Makefile ... again, there's a variable in the Makefile (MCU_TARGET) ...

Mega8 version is 248 bytes, ie. fits into smallest bootblock.
Mega168 version is 290 bytes ...

The PC SW is still a mess, full of hardcoded stuff and "cowboy engineering" solutions ...

Documentation is available upon request ... well ... to be honest it isn't, but "if You wish upon a star ..." e.t.c .....

/J

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

svofski, take a look at this link. This ATmega8 bootloader works with AVRprog.

I modified it to work with my ATmega16 based JTAG ICE clone.

Don

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

Quote:
He heee ... remember to have a bottle of Vodka ready

That I always have handy. Actually that's exactly what I had to resort to last night, when I was left internetless (large scale power meltdown, ISP died), my M8 died (still don't know what happened - just quit responding for no apparent reason, I haven't been touching the fuses and haven't been actually even touching the board either). It was a weird day, even my soldering iron stopped heating at maximum power, I had to tune it down a little to make it hotter.. A WTF day! Well, not vodka but brandy and a couple of soviet sci-fi movies from 80's helped me to get over that :D

@donblake: thanks! I've seen this link, it seems to be ok but I don't quite like the idea of using AVRProg, I prefer to have some simple custom software that I can modify on the PC side, just like jussishow's.

The Dark Boxes are coming.

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

Hey hey hey, jussishow!! Your bootloader works!

I had to rewrite some parts of the PC side to make it windoze friendly, but that's about it. Works like a charm :D

Do you want windows code? If you do I'll have to brush it up a little.

[Edit:]
P.S. Not a drop of alcohol was required. Excellent work!

The Dark Boxes are coming.

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

I took liberty of editing your code a little. Here's code that's ought to be compilable and functional both under windows and linux, but I'm not sure about linux includes. I split the code into several files because it became too long with all #ifdef's.

The archive includes your original Makefile, which I haven't touched - it has to be edited for the new file structure. Makefile.win is ok for mingw distribution, I use it with Bloodshed Dev-Cpp. .dev file is dev-cpp's project file.

-Dwindows or -Dlinux must be there in the Makefile. Makefile.win already has -Dwindows

Attachment(s): 

The Dark Boxes are coming.

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

Quote:

I had to rewrite some parts of the PC side to make it windoze friendly, but that's about it. Works like a charm

Nice to hear that it works outside my bedroom/lab !

Quote:

Do you want windows code? If you do I'll have to brush it up a little.

#ifdef WINDOWS
     jussishow needs lots of vodka
#endif

Quote:
I took liberty of editing your code a little

Feel free to do whatever You want with it ! Of course, I'd be grateful for any feedback/comments about it ...

It's "released" under the "yellow snow" license:

You can eat as much of the Yellow snow as You like, but don't blame the dog if You get sick :-)

/J

EDIT : Did You have to edit the AVR code/Makefile ? or did it build OK ?

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

jussishow, I thought you might want to merge the sources with my changes - it would suck if we would keep two completely separate versions of the same thing. I think your bootloader is very convenient and it may become popular. And even more so with windows binaries available.

vodka is negotiable :)

No, I didn't have to edit the AVR Makefile, it worked perfectly. I only modified clock speed.

The Dark Boxes are coming.