Flashed Arduino Uno

Hi,
I am beginner in arduino

I was trying to burn bootloader into a standalone Atmega338p-pu using arduino uno r3. I have connected via icsp pins which is at the end of board. Standalone atmega328p-pu had external 5v volt power supply.

On trying the above I tried avrdude command with flash accidentally using a atmega8 hex file. I thought it will write into standalone atmega328p -pu.. but after this command my arduino uno board is not functioning. Led13 is always on. I could not upload any program into arduino board . I get stk500 not responding error.

So now to restore my arduino board, I tried to write atmega328p bootloader hex file with help of raspberry pi gpio.. but I get error message from avrdude as avrdude device not responding..

Can someone help me in this please.

It sounds like you never uploaded the "Arduino as ISP" sketch into the Uno and then you did a normal upload rather than selecting the "Upload with Programmer" option. That erased the flash in your Uno, which erased the bootloader.

You should be able to reflash it with the RPi but it would appear that you were unable to to follow the instructions on how to do that as well... since it was significantly more steps than the first procedure you didn't follow...

Your error description is too vague to be usable. Please review the installation instructions for the RPi and try again. If it fails, post the error message exactly as it appears on your terminal.

Hi avr_fred,
Thanks for the reply. I have tried as below

  1. Enabled Raspberry pi 3 SPI using 'sudo raspi-config' command and rebooted

  2. then connected GPIO pins with breadboard atmega328p-pu as below
    PI 19 - ATMEGA 19
    PI 21 - ATMEGA 18
    PI 23 - ATMEGA 17
    PI 24 - ATMEGA 1
    PI 1 & 6 - for suplying power to the atmega328p-pu
    Used 16mhz external crystal oscillator

  3. I have followed this instructions for Atmega328p breadboard connections -
    https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard
    Raspberry Pi Tutorial 36 - ATMEGA328P AVR (Arduino) Programming via GPIO (SPI) - YouTube

  4. When I run 'avrdude -p m328p -c gpio' this command in raspberry pi. I get below error
    avrdude: AVR device not responding
    avrdude: initialization failed, rc=-1
    Double check connections and try again, or use -F to override
    this check.

avrdude done. Thank you.

  1. When I run 'avrdude -p m328p -c gpio -F'. I get below error

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F

avrdude done. Thank you.

  1. I have opened the corresponding avrdude.conf file and searched for 328p. below is the signature

#------------------------------------------------------------

ATmega328P

#------------------------------------------------------------

part
id = "m328p";
desc = "ATMEGA328P";
has_debugwire = yes;
flash_instr = 0xB6, 0x01, 0x11;
eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
0x99, 0xF9, 0xBB, 0xAF;
stk500_devcode = 0x86;

avr910_devcode = 0x;

signature = 0x1e 0x95 0x0F;
7. I have tried the same with external power (9v battery + used 5v 7805 regulator)

Please let me know where I miss. Thanks in advance.


UPDATED:

  1. When I run 'avrdude -p m328p -c gpio -v'. I get below output

avrdude: Version 5.10, compiled on Jun 18 2012 at 12:38:29
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/pi/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : unknown
Using Programmer : gpio
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 5 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 : GPIO
Description : Use sysfs interface to bitbang GPIO lines

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

What in the world... where did you get avrdude version 5.1?
Rebuild your Raspbian if needed and then install the correct toolchain, in other words:

sudo apt-get install gcc-avr binutils-avr gdb-avr avr-libc avrdude

I think the -c gpio option is available, but I have not tried it.

Update: I should also note that -c gpio is a bitbang mode so SPI does not need to be enabled.