 |
| Author |
Message |
|
|
Posted: Oct 08, 2012 - 09:21 PM |
|

Joined: Jul 07, 2010
Posts: 29
|
|
I'm playing with atmega324p and try run bootloader.
But I can't connect avrdude to upload flash. Please did someone try this bootloader.
1/ I downloaded bootloader from sanguino.cc (Sanguino-0023r4.zip). It should support m324p chip.
2/ I changed the "chip" and "section-start" in the makefile (see attachment bootloader_324p.zip)
3/ I burned it to atmega324p and set "fuse SPM prohibited in bootsection" with avrdragon & AvrStudio4
fuses:
extended 0xff
high 0x18
low 0xf7
lockbit 0xef
4/ if I push & release the EXT_RESET button, the PB0 LED blinks shortly and stays off.
5/ I connected the RS232 cable (max232) to UART0 to RX0 and TX0 pins.
6/ if I push & release the EXT_RESET button and start avrdude, the PB0 LED blinks shortly and stays lit on.
7/ $ avrdude -p m324p -c avrisp -P com1 -b 19200 -U flash:r:readout.hex:i
avrdude.exe: stk500_getsync(): not in sync: resp=0x00
avrdude.exe done. Thank you.
8/ it seems, the PC sends some chars and the bootloader does't answer. I have loaded the bootloader *.elf to AvrStudio and was stepping in simulator. The UART0 speed should be OK. |
Last edited by frpr66 on Oct 11, 2012 - 08:08 PM; edited 1 time in total
|
| |
|
|
|
|
|
Posted: Oct 08, 2012 - 10:32 PM |
|

Joined: Feb 12, 2005
Posts: 16293
Location: Wormshill, England
|
|
No. I have no intention of downloading your ZIP file.
The Sanguino website gives no indication of the bootloader baud rate.
However, I guess that it may be 38400, 57600 or even 115200 baud. Your source code will tell you.
You tell the Arduino IDE the correct COM port, baud rate, bootloader protocol etc by editing boards.txt
David. |
|
|
| |
|
|
|
|
|
Posted: Oct 09, 2012 - 08:15 AM |
|

Joined: Jul 07, 2010
Posts: 29
|
|
edit1: It works fine now, thanks.
edit2:
READING
$ avrdude -c avrisp -p m324p -P com5 -b 19200 -F -D -U flash:r:readout.hex:i
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude.exe: Device signature = 0x000000
avrdude.exe: Yikes! Invalid device signature.
avrdude.exe: Expected signature for ATMEGA324P is 1E 95 08
avrdude.exe: reading flash memory:
Reading | ################################################## | 100% 24.56s
avrdude.exe: writing output file "readout.hex"
avrdude.exe done. Thank you.
WRITING
$ avrdude -c avrisp -p m324p -P com5 -b 19200 -F -D -U flash:w:main.hex:i
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude.exe: Device signature = 0x000000
avrdude.exe: Yikes! Invalid device signature.
avrdude.exe: Expected signature for ATMEGA324P is 1E 95 08
avrdude.exe: reading input file "main.hex"
avrdude.exe: writing flash (726 bytes):
Writing | ################################################## | 100% 0.64s
avrdude.exe: 726 bytes of flash written
avrdude.exe: verifying flash memory against main.hex:
avrdude.exe: load data flash data from input file main.hex:
avrdude.exe: input file main.hex contains 726 bytes
avrdude.exe: reading on-chip flash data:
Reading | ################################################## | 100% 0.56s
avrdude.exe: verifying ...
avrdude.exe: 726 bytes of flash verified
avrdude.exe done. Thank you.
ATTACHMENT |
|
|
| |
|
|
|
|
|
|
|