Validation errors when uploading to the ATmega328
Posted: Sun Dec 22, 2013 9:47 pm
I have previously had code running on my Gertduino without any problems. I don't use the Arduino IDE but I followed Gordon's various instructions and was able to program the 328 from the command line using ino as per one of my previous posts (http://www.raspberrypi.org/phpBB3/viewt ... 86#p466086).
Subsequently, I decided to man up and have a play with using c code and a makefile. I started with the examples provided in the download from Element 14, but I found that I got verification errors every time I try to upload a .hex file to the ATmega. See below:
I have tried going back to using ino, but get the same errors. In the past, working with ino, I have dealt with verification errors by erasing the chip before I upload a sketch by using this command:
I find that this no longer helps, I basically can't upload to the 328 using either method (ino upload, or ./program_328).
I wonder whether I have messed something up somewhere, I have tried disabling the overclock on the Pi, and have tried running the avrsetup script a couple of times. Does any wise soul have any suggestions about where I might be going wrong?
Subsequently, I decided to man up and have a play with using c code and a makefile. I started with the examples provided in the download from Element 14, but I found that I got verification errors every time I try to upload a .hex file to the ATmega. See below:
Code: Select all
$ ./program_328 blink.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "blink.hex"
avrdude: input file blink.hex auto detected as Intel Hex
avrdude: writing flash (594 bytes):
Writing | ################################################## | 100% 0.11s
avrdude: 594 bytes of flash written
avrdude: verifying flash memory against blink.hex:
avrdude: load data flash data from input file blink.hex:
avrdude: input file blink.hex auto detected as Intel Hex
avrdude: input file blink.hex contains 594 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.07s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x0c != 0x00
avrdude: verification error; content mismatch
avrdude: safemode: lfuse changed! Was e7, and is now 0
Would you like this fuse to be changed back? [y/n] y
avrdude: safemode: and is now rescued
avrdude: safemode: hfuse changed! Was d9, and is now 0
Would you like this fuse to be changed back? [y/n] y
avrdude: safemode: and is now rescued
avrdude: safemode: efuse changed! Was 7, and is now 0
Would you like this fuse to be changed back? [y/n] y
avrdude: safemode: and is now rescued
avrdude: safemode: Fuses OK
avrdude done. Thank you.
Code: Select all
avrdude -c gpio -p m328p -e -vI wonder whether I have messed something up somewhere, I have tried disabling the overclock on the Pi, and have tried running the avrsetup script a couple of times. Does any wise soul have any suggestions about where I might be going wrong?