Offline
Newbie
Karma: 0
Posts: 11
|
 |
« on: March 22, 2011, 01:56:21 am » |
Hello,
trying to program an ATtiny2313 with a metaboard-programmer (arduino clone) and the Arduino-IDE runnig avr-developers special core, I have a problem with the -D option in AVRDude, that is the default (disable chip erase). A naked chip is programmed with no problems, but the second try ends up in a verify-error. I had to do a chip erase "manually" (-e) and it worked.
Is there a method to overwrite the -D option from the Arduino-IDE? I dind´t find it in the AVRDudeconfig or Arduino-Preference.
Thanks for Help Themroc
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10400
|
 |
« Reply #1 on: March 22, 2011, 02:07:13 am » |
I have a problem with the -D option in AVRDude, that is the default (disable chip erase) Disable chip erase is the default? Doesn't seem to be for my version (5.10). Which version are you using?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #2 on: March 22, 2011, 02:14:02 am » |
I meant the Arduino-IDE calling AVRDude default. I´m using 022. AVR-Dude is ok:)
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10400
|
 |
« Reply #3 on: March 22, 2011, 02:28:49 am » |
The command line when I upload an empty Sketch... C:\arduino-0022\hardware/tools/avr/bin/avrdude -CC:\arduino-0022\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cavrispv2 -P\\.\COM8 -Uflash:w:C:\Users\CODEB~1.001\AppData\Local\Temp\build1468340934531411719.tmp\sketch_mar22b.cpp.hex:i Broken into separate lines... C:\arduino-0022\hardware/tools/avr/bin/avrdude -CC:\arduino-0022\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cavrispv2 -P\\.\COM8 -Uflash:w:C:\Users\CODEB~1.001\AppData\Local\Temp\build1468340934531411719.tmp\sketch_mar22b.cpp.hex:i
There is no dash-D. I suspect the problem is something else.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #4 on: March 22, 2011, 04:02:27 am » |
Oh sorry my version contains the -D option and I can´t get it away:)
D:\arduino-0022\hardware/tools/avr/bin/avrdude -CD:\arduino-0022\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny2313 -cusbasp -P\\.\COM12 -b19200 -D -Uflash:w:C:\DOKUME~1\Me\LOKALE~1\Temp\build1303 597068202028020.tmp\BlinkWithoutDelay.cpp.hex:i
thanks themroc
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #5 on: March 22, 2011, 05:17:34 am » |
I tested it with the same command ommitting the -D and it worked. But it´s boring to copy the command from the Arduino-IDE and deleting -D.
Any idea, how to set (or to find) the right preference file?
T
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10400
|
 |
« Reply #6 on: March 22, 2011, 04:38:18 pm » |
Do you have an "upload.using" entry in "boards.txt" for the ATtiny2313 section? It should be something like this...
myboardname.upload.using=myprogrammer
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #7 on: March 22, 2011, 05:32:10 pm » |
NO I didn´t, but the other boards don´t have this option. I only specified the upload.protocol=usbasp. The Problem is, that the upload works once. It is definitly the -D option. Iwrote a batchfile to erase the chip before.
Regards T
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #8 on: March 22, 2011, 05:33:25 pm » |
Ok Iwould like to know what this using does.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10400
|
 |
« Reply #9 on: March 23, 2011, 01:41:18 am » |
When a section in "boards.txt" does not have an "upload.using" entry, the Arduino IDE performs a "bootloader upload". For you, that means the dash-D option is added when AVRDUDE is run. When you want to upload using an ICSP (in your case the "metaboard-programmer") you have to either add an entry to "programmers.txt" or select a close match. As far as I can tell, this is what you should add "programmers.txt"... metaboard.name=USBasp metaboard.protocol=usbasp You then need to update "boards.txt" so that uploading to your board is performed through the "metaboard" programmer. Something like this should work... attiny2313at8.name=ATtiny2313 @ 8 MHz attiny2313at8.upload.using=metaboard attiny2313at8.upload.maximum_size=2048 attiny2313at8.bootloader.low_fuses=0xE4 attiny2313at8.bootloader.high_fuses=0x9F attiny2313at8.bootloader.extended_fuses=0xFF attiny2313at8.bootloader.path=empty attiny2313at8.bootloader.file=empty2313at8.hex attiny2313at8.bootloader.unlock_bits=0x3F attiny2313at8.bootloader.lock_bits=0x3F attiny2313at8.build.mcu=attiny2313 attiny2313at8.build.f_cpu=8000000L attiny2313at8.build.core=CoreSubdirectoryGoesHere
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #10 on: March 23, 2011, 06:19:16 am » |
Thanks for explanation. I ´will try this. Did you work with the special cores from AVR-developers? With the attiny2313 I got it working, but not with an Atmega48 or 8. Uploading the bootloader works with the Atmega8, sketches are uploaded correctly, but don´t work.
T
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10400
|
 |
« Reply #11 on: March 23, 2011, 11:07:15 am » |
Did you work with the special cores from AVR-developers? No, I haven't.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #12 on: March 23, 2011, 12:36:07 pm » |
Thanks a lot coding badly. With your "using" modification it worked fine. The terrible -D option disappeared.  I used the following code: programmers.txt usbasp.name=USBasp usbasp.communication=usb usbasp.protocol=usbasp boards.txt ... atmega8.name=Arduino ATmega8 atmega8.upload.using=usbasp atmega8.upload.protocol=usbasp #maybe this is double? ... The avr-developers files support many of the other avrs, so that you can programm it with the Arduino IDE. Although the blink-sketch uses nearly half the flash of a Tiny2313:( Unfortunately Atmega48 doesn´t work. Maybe it is the fuses-section. T
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 129
Posts: 10400
|
 |
« Reply #13 on: March 23, 2011, 12:44:23 pm » |
For the ATtiny2313, give this core a try... http://code.google.com/p/arduino-tiny/
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #14 on: March 24, 2011, 05:58:45 am » |
Oh thanks. Does this core generate an optimized version for the tinys (to fit in the small flashes). The documentation in the boards.txt is really good (especially the fuse-settings). What about the "empty" bootloader specification? Is this only to set the right fuses, not to upload a bootloader?
T
|
|
|
|
|
Logged
|
|
|
|
|
|