Go Down

Topic: Help needed with ATMega644P bootloader (Read 2333 times) previous topic - next topic

Kevin Marinelli

I made my own Arduino clone board using a ATMega644P microcontroller. In the past,
I used the AdaFruit 644P boatloader with no problems. Unfortunately the bootloader
does not seem to work with the current Arduino IDE. I would really like to use my
home-brew boards with the current IDE, since I need both USB and XBee communications
in the projects I am working on.

When I try to use avrdude to install the ATmegaBOOT_644P.hex bootloader, I get the following
error:

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "ATmegaBOOT_644P.hex"
avrdude: ERROR: address 0x1f010 out of range at line 2 of ATmegaBOOT_644P.hex
avrdude: write to file 'ATmegaBOOT_644P.hex' failed


Any suggestions to resolve the bootloader issue would be appreciated.

Here is an image of my board in case anyone is interested:  http://www.flickr.com/photos/56395654@N03/8114494718/in/photostream
The board is not Arduino shield compatible, since I wanted to be able to wire the 8-bit data ports grouped in their logical structure.



Osgeld

I have never used the bootloader but I have used the mighty1284 core with a 644 before

https://github.com/maniacbug/mighty-1284p

you would have to modify the boards.txt to reflect a 644 (name and its 64k of program space instead of 128k) but outside of program memory and ram, they are the same chip
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

watch for 644 vs 644a vs 644P
I think only P has dual serial ports, check data sheet to be sure.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

leo72


I think only P has dual serial ports, check data sheet to be sure.

+1

PeterVH

Quote
avrdude: ERROR: address 0x1f010 out of range at line 2 of ATmegaBOOT_644P.hex


That address is out of range indeed: it is > 64K.
Since the error is at line 2, I guess line 1 contains a so called "extended segment address record" (long live wikipedia). These are used to accomplish addressing over 64K. It are lines looking like this:
    :02000002xxxxyy

If line 1 looks like this, try deleting it. Or just post the hex file you use.

Recently I built optiboot_atmega644p.hex and flashed it to my sanguino rbk using ArduinoISP.
I used these command lines:
Code: [Select]

avrdude -pm644p -c avrisp -b 19200 -P /dev/ttyUSB0 -e -u -U lock:w:0x3f:m -U efuse:w:0xFD:m -U hfuse:w:0xDE:m -U lfuse:w:0xFF:m
avrdude -pm644p -c avrisp -b 19200 -P /dev/ttyUSB0 -U flash:w:optiboot_atmega644p.hex:i -U lock:w:0x2f:m

It worked fine.
I attached it, it is only  1.4K

I was running into the same error as the first one.  Eliminating the first line of the hex file fixed that issue, but now I have a new one. 

I've noticed that the verify step in the flash fails no matter what bootloader I try to load.

Using the optiboot hex file that was attached, my command is:
avrdude -p m644p -C "[path to avrdude.conf]" -c dapa -P lpt1 -U flash:w:[path to optiboot_atmega644p.hex]

Avrdude appears to write and read normally, then says:

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0xfc00
             0x0f != 0xff
avrdude: verification error; content mismatch

Then what's weirder is that the fuse bits have been changed, because the next thing it says is

avrdude: safemode: hfuse changed! Was de, and is now ff
Would you like this fuse to be changed back? [y/n]


I am using Windows 7 and a parallel cable that I built.  I suspect the cable could cause the issues and I have a usbasp on the way, but I'd really like to get it to work with the parallel cable.  Any thoughts?

bratan


and signature bytes

Where do I specify signature bytes? In boards.txt file?

I also need to update my 644p with Optiboot version via Arduino IDE (I don't have ISP). Sanguino boot-loader is horrendous :(
Would changing boards.txt file and be sufficient or I need to do something else?
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info :)

CrossRoads

Signature bytes are in avrdude.conf.
Copy the 1284 section or another 644 section with a new name and update the memory size and signature bytes.
Make a new section in boards.txt to match.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up