I tried flash bootloader into Arduino Pro Mini 328P 8MHz/3.3V clone, but got error.
First I did test:
~$ avrdude -c usbasp -p m328p
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: Fuses OK (E:FD, H:D9, L:E2)
avrdude done. Thank you.
~$ avrdude -c usbasp -p m328p -v -U flash:w:optiboot_atmega328_pro_8MHz.hex
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 "/etc/avrdude.conf"
User configuration file is "/home/combox/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : usbasp
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
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : usbasp
Description : USBasp, http://www.fischl.de/usbasp/
avrdude: auto set sck period (because given equals null)
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as FD
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: auto set sck period (because given equals null)
avrdude: reading input file "optiboot_atmega328_pro_8MHz.hex"
avrdude: error opening optiboot_atmega328_pro_8MHz.hex: No such file or directory
avrdude: can't determine file format for optiboot_atmega328_pro_8MHz.hex, specify explicitly
avrdude: read from file 'optiboot_atmega328_pro_8MHz.hex' failed
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:D9, L:E2)
avrdude done. Thank you.
@combox:~$ cd Downloads
@combox:~/Downloads$ cd Arduino
@combox:~/Downloads/Arduino$ avrdude -c usbasp -p m328p -v -U flash:w:optiboot_atmega328_pro_8MHz.hex
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 "/etc/avrdude.conf"
User configuration file is "/home/combox/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : usbasp
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
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : usbasp
Description : USBasp, http://www.fischl.de/usbasp/
avrdude: auto set sck period (because given equals null)
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as FD
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: auto set sck period (because given equals null)
avrdude: reading input file "optiboot_atmega328_pro_8MHz.hex"
avrdude: input file optiboot_atmega328_pro_8MHz.hex auto detected as Intel Hex
avrdude: writing flash (32768 bytes):
Writing | ################################################## | 100% 0.00s
avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against optiboot_atmega328_pro_8MHz.hex:
avrdude: load data flash data from input file optiboot_atmega328_pro_8MHz.hex:
avrdude: input file optiboot_atmega328_pro_8MHz.hex auto detected as Intel Hex
avrdude: input file optiboot_atmega328_pro_8MHz.hex contains 32768 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x7e00
0x00 != 0x11
avrdude: verification error; content mismatch
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as FE
avrdude: safemode: lfuse changed! Was e2, and is now fe
Would you like this fuse to be changed back? [y/n]
How to solve this?
2 Answers 2
First, I put the voltage jumper on USBASP programmer to 5V, to increase voltage. Then I set correct default fuse bits values for this board:
Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328
Low Fuse: 0xFF
High Fuse: 0xDA
Extended Fuse: 0x05
avrdude -c usbasp -p m328p -v -u -U lock:w:0x3f:m -U efuse:w:0xFD:m
avrdude -c usbasp -p m328p -v -u -U lock:w:0x3f:m -U hfuse:w:0xDA:m
avrdude -c usbasp -p m328p -v -u -U lock:w:0x3f:m -U lfuse:w:0xFF:m
Note, that I used option -u when modifying the fuse bits, this switch tell avrdude we really mean modify it. It disables the default behaviour of reading out the fuses three times before programming, then verifying at the end of programming that the fuses have not changed. I put 0xFD value for Extended Fuse Byte in place of 0x05, due to a bug in avrdude. (0xFD and 0x05 are the same value)
After that I flashed correct bootloader:
avrdude -c usbasp -p m328p -v -U flash:w:optiboot_atmega328_pro_8MHz.hex -U lock:w:0x0f:m
Now it fully fixed and works.
It is locked/blown. Looks like you tried to flash it previously as an Arduino Nano or Uno. Now the lock bits are set. Even in highVoltage programming mode you cannot discover it. Buy a new one.
-
discover? recover?user31481– user314812017年11月10日 10:12:28 +00:00Commented Nov 10, 2017 at 10:12
-
@Harald - no, I managed to fix it, easily enough. I will edit my question to add the solution.minto– minto2017年11月11日 23:05:14 +00:00Commented Nov 11, 2017 at 23:05