Estoy tratando de flashear Atmega-328P usando avrdude. He escrito una configuración personalizada para que se reconozca mi USBASP.
programmer
id = "usbasp-kt";
desc = "usbasp desc";
type = "usbasp";
usbvid = 0x03EB;
usbpid = 0xC8B4;
;
Entonces trato de flashearlo.
avr-gcc -Os -mmcu=atmega328p -g -Wall -Wextra main.c -o firmware.o
avr-objcopy -j .text -j .data -O ihex firmware.o firmware.hex
avrdude -C /usr/local/etc/avrdude.conf -B 4 -c usbasp-kt -p m328p -U flash:w:firmware.hex -P usb -vvv
avrdude: Version 6.2
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/usr/local/etc/avrdude.conf"
User configuration file is "/home/u/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : usbasp-kt
Setting bit clk period : 4.0
avrdude: usbasp_open("usb")
avrdude: seen device from vendor ->zhifengsoft<-
avrdude: seen product ->USBHID<-
AVR Part : ATMEGA328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : usbasp
Description : Kompiuterines technikos ISP programuotojas
avrdude: usbasp_initialize()
avrdude: usbasp_spi_set_sck_period(4e-06)
avrdude: try to set SCK period to 4e-06 s (= 250000 Hz)
avrdude: set SCK frequency to 187500 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: usbasp_program_enable()
avrdude: error: program enable: target doesn't answer. 0
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: usbasp_close()
avrdude done. Thank you.
No importa si uso el parámetro -B 4 o no. He comprobado los cables un par de veces, todo parece correcto. La luz USBASP está encendida, por lo que debe funcionar desde USB.