Pages: [1]   Go Down
Author Topic: Help needed with ATMega644P bootloader  (Read 1985 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26438
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

and signature bytes
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26438
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

watch for 644 vs 644a vs 644P
I think only P has dual serial ports, check data sheet to be sure.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Italy
Offline Offline
Brattain Member
*****
Karma: 325
Posts: 22498
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Offline Offline
Full Member
***
Karma: 9
Posts: 109
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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

* optiboot_atmega644p.hex (1.44 KB - downloaded 47 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

New York
Offline Offline
Sr. Member
****
Karma: 4
Posts: 366
xronosclock.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-sad
Would changing boards.txt file and be sufficient or I need to do something else?
Logged

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info smiley

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26438
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: