I think I've bricked my ATmega328p. I was working on a custom bootloader and was able to write it to the chip; however, I needed to change the fuse settings to ensure my bootloader would fit properly. I was also running into a problem where AVRDUDE was erasing my user code when I uploaded the bootloader.
I mistakenly copied an AVRDUDE command into my terminal to increase my bootloader size. What ended up happening was that I couldn't upload my bootloader anymore. In fact, I am unable to communicate at all with the chip.
I've hooked up the chip to another Arduino to use as "Arduino as ISP". When I turn on the programmer and the target turns on as well, the "bricked" target chip actually runs my previous user code, which was to blink the onboard LED (PB5) rapidly. As soon as I initiate a "burn bootloader," the LED instantly stops blinking, and the chip seems to halt until I disconnect and reconnect the USB cable back into the programmer.
I thought it may be a clock issue, so I jerry-rigged a crystal oscillator, but when I went to burn a bootloader, it just stopped working (I can tell because my blinking LED stopped in its last on or off state). I also used a spare STM32 to generate a ~2MHz square clock; it halts as well. To ensure it wasn't a wiring issue, I took the chip out of the (clone) Arduino socket and used a breadboard to program it. I used spare LEDs to visualize the ISP connection. It was clear that the programmer sent a MOSI, but the target was not returning a MISO.
I'm running out of ideas. However, I'm dedicated to fixing this chip is because it is still able to run my previous user code properly (blinking led rapidly). But it simply doesn't want to communicate through ISP. Anyone have any ideas on how I can go about saving this chip?
References I looked through, but to no avail:
- Is my ATMEGA328-PU dead or bricked? - #8 by dmjlambert
- avrdude: Device signature = 0x000000
- Recovering ATMEGA328p chip from external clock fuse set
Images of my current setup:
Crystal Oscillator (jerry-rig)
STM32 square clock
Typical AVRDUDE command output:
PS C:\Users\me> avrdude -c arduino -p m328p -P COM5 -n -b 19200 -v
avrdude: Version 7.2
Copyright the AVRDUDE authors;
see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
System wide configuration file is C:\Users\me\scoop\apps\avr-gcc\current\bin\avrdude.conf
Using Port : COM5
Using Programmer : arduino
Overriding Baud Rate : 19200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : possible i/o
RETRY pulse : SCK
Serial program mode : yes
Parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0x00 0x00
flash 65 10 128 0 yes 32768 128 256 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00
signature 0 0 0 0 no 3 1 0 0 0 0x00 0x00
calibration 0 0 0 0 no 1 1 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino for bootloader using STK500 v1 protocol
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x000000 (retrying)
avrdude: device signature = 0x000000 (retrying)
avrdude: device signature = 0x000000
avrdude main() error: Yikes! Invalid device signature.
avrdude main() error: expected signature for ATmega328P is 1E 95 0F
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.




