chip45boot upload error

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

Hey, Im trying to play with bootloaders since I got a butterfly on its way. So I thought I would try one out, I looked for a winAVR made bootloader and for a mega8. I found chip45bootloader witch doesent look to bad, so I followed its instructions, it has a premade hex file for the mega8...

my prob is when I try to upload the source with avrdude gui I get this error:

Quote:
avrdude.exe: erasing chip
avrdude.exe: reading input file "hex.hex"
avrdude.exe: input file hex.hex auto detected as Intel Hex
avrdude.exe: ERROR: address 0x2002 out of range at line 65 of hex.hex
avrdude.exe: write to file 'hex.hex' failed

avrdude.exe done. Thank you.

I normally get that error if I ran out of space on my chip, is this because I haven't burnt the fuses for the bootloader space? because on the chip45 instruction page it says to upload this first then set the fuses for bootloader, it doesent exactly say for bootloader space, just says 'Adjust the fuse bits to activate bootloader functionality.'.

So I decided to post here first, before I burn fuses I don't know what do.

any ideas? or have a better bootloader I should try? I would like one that was made with winAVR so I can play with the bootloader code myself. but I would also like a stk500 protocall, but you cant win them all :P

http://www.chip45.com/index.pl?p...

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

Mega8 has only 8 kilobytes of memory in total, which must be shared between both the app and the bootloader. This 8kb is 8192 bytes.

Your hex has code at address 0x2002, which is 8194 in decimal.

So you've run out of memory. Hex too big.

- Jani

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

that shouldent be though, because the chip45boot archive file comes with recompiled .hex's for a few megas, this one is for the mega8 and says its only 1k, is there a way I can test the file size of the hex?

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

Also I am trying to compile it myself, and I get an error with this line:

void (*startBootloader)( void ) = BOOTADR;  // pointer to the bootloader start address

BOOTADR isent defined, and there is no sign of it anywhere in the files, anyone know what or where I can find the bootloader section start addr?

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

BOOTADR is defined in the Makefile. I rebuilt the .hex file. Try it (I have not tested it but it looks small enough).
Edit: It it is built for 115200 baud with 14745600 Mhz F_CPU.

/Lars

Attachment(s): 

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

I have also tried to compile this code for diffeerent MCU's. I can't confirm it but it seam that the compiled code size depend on what processor it is compiled for.

There is no problem when compiling for ATmega8. When I compile for PWM3 i get error on that code segment text. overflows.

When disabling the EEprom programming option, resulting in decreased code size, it compiles fine for both chips.

Can someone please help me to point out what part in the code that may be MCU dependent.

/L