Pages: [1]   Go Down
Author Topic: atmega324p bootloader can't write flash [SOLVED]  (Read 1267 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
1/ I have device atmega324p, I downloaded the bootloader from site: https://github.com/magnuskarlsson/SDLogger/wiki/Arduino-howto
2/ I modified a little bit the "Makefile" and "ATmegaBOOT.c" for chip atmega324p, speed 19200, cpu_speed 16MHz
3/ I burned it by avrdragon
4/ I joined RS232-TTL (max232) cabel to PC and to the chip
5/ I made a successful test:
Code:
$ avrdude -c avrisp -p m324p -P com1 -b 19200 -F -U flash:r:readout:i
6/ but writing doesn't work
Code:
$ avrdude -c avrisp -p m324p -P com1 -b 19200 -F -U flash:w:main_blinking.hex:i

What is wrong?
Please any advice how to upload atmega324p chip?
Or does someone provide Arduino IDE files for chip atmega324p?
« Last Edit: October 11, 2012, 02:28:08 pm by frpr666 » Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1729
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You have specified to avrdude to program the chip using ISP (note the avrisp), and yet you are trying to use a bootloader. The two are very different.

Off the top of my head I can't remeber what ATmegaBOOT uses in relation to avrdude. I think that optiboot is 'arduino' (instead of avrisp), or is it 'stk500v1'. Would have to check.

EDIT:
Try this:
avrdude -c arduino -p m324p -P com1 -b 19200 -D -U flash:w:main_blinking.hex:i
« Last Edit: October 10, 2012, 04:48:00 pm by Tom Carpenter » Logged

~Tom~

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you. Today I have found the bug. I forgot change line 119 in ATmegaBOOT.c for chip m324p. Now it works both reading & writing.
Bootloader code is here: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=1000323#1000323
Code:
$ avrdude -c avrisp -p m324p -P com5 -b 19200 -F -D -U flash:r:readout.hex:i
$ echo 'this one reads the chip'

$ avrdude -c avrisp -p m324p -P com5 -b 19200 -F -D -U flash:w:main.hex:i
$ echo 'this one writes the chip'

$ echo '-c arduino instead of -c avrisp works too'
Logged

Pages: [1]   Go Up
Jump to: