I flashed bootloader with Raspberry PI. anyone please verify the process

HI

i have some issue with burning bootloader with UsbAsp. Then i got one nice tutorial about flashing IC using RPI. the programe used is avrdude.

i took the bootloader from Arduino IDE folder (optiboot_atmega328.hex) . But the same folder, there is 2 more bootloader for atmega328. Which one i need to choose. My AVR is Atmega328P-PU

and below is the output from RPI console

root@raspberrypi:~# avrdude -c gpio -p m328p  -U flash:w:/home/pi/optiboot_atmega328.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
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: reading input file "/home/pi/optiboot_atmega328.hex"
avrdude: input file /home/pi/optiboot_atmega328.hex auto detected as Intel Hex
avrdude: writing flash (32768 bytes):

Writing | ################################################## | 100% 18.03s

avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against /home/pi/optiboot_atmega328.hex:
avrdude: load data flash data from input file /home/pi/optiboot_atmega328.hex:
avrdude: input file /home/pi/optiboot_atmega328.hex auto detected as Intel Hex
avrdude: input file /home/pi/optiboot_atmega328.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 16.47s

avrdude: verifying ...
avrdude: 32768 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

is it ok. or do i need to do anything extra to work with arduino. The thing is one of arduino regulator IC got burned bcoz of supply issue. after that i am always getting below error

avrdude: stk500_getsync(): not in sync: resp=0x00

when i put the newly flashed IC to Arduino, same error . my board is freeduino

thanks & regards,
Ben

Have you got the bits to run the 328 in a breadboard? if so try it there first.

If the power regulator on the Freeduino is blown I can't see the chip getting power and so no chip no ability to program it.

Hi

power regulator is connected to external power I think.

i am trying with USB

HI

i got one working Arduino. and i replaced the AVR with newly flased one. when i start the power, the LED connected to pin 13 is blinking 3 times.

when i try to upload led blink sketch, the led connected to pin 13 also blinking 3 times. and giving me below error

but when i try to programe that, getting error

Binary sketch size: 1,082 bytes (of a 32,256 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00

For testing, how can i convert Arduino IDE,s Led blink programe to .hex file . So that i can try to flash that from RPI.

please help me to understand the situation

thanks & Regards,
Ben

ChilliTronix:
If the power regulator on the Freeduino is blown I can't see the chip getting power and so no chip no ability to program it.

Should run fine on USB though.

bentech4u:
For testing, how can I convert Arduino IDE's Led blink program to .hex file. So that I can try to flash that from RPI.

If as you say, you have a working USBASP (or Arduino as ISP), you should be able to simply download the "blink" example from the Arduino IDE (which I presume you have installed in the Pi - I sure do!) instead of the bootloader. Note you can (well you can do both with some jiggery-pokery) load only one or the other using ISP.

HI

thanks for the replay.

No my UsbASP is not working, always giveng me error. and from the RPI, the chip is detecting, i can able to flash .hex files by using avrdude from command line.

i took the bootloader from Arduino IDE and flashed that, it was successful.

and the Blink excample is with .ino extension, like direct C programe.How can i convert it to hex file?

thanks & Regards,
Ben

How can i convert it to hex file?

That is what the IDE do for you.
If you enable "show verbose output compiling" in the File->preferences you can see where the .hex file is saved.

On my setup it is:

C:\Users\EC\AppData\Local\Temp\build3058734612122673183.tmp\Blink.cpp.hex

The Blink.cpp.hex is what you want to use

Hi

i got the hex fine and i programmed by using RPI. the supply i used is 5 v and the crystal is 15.468 MHZ(i don't have 16Mhz). after that i put that IC in to my Arduino . the the LED was in ON stage for a while after that it turned off.

it's not working and from the RPI console, the flashing was successful .

please direct me. these crystal changes will affect my programe.?

HI
please anyone help me to solve this issue. As i received my 16 Mhz crystal yesterday and i reflashed bootloader from command line

avrdude -c gpio -p m328p  -U flash:w:/home/pi/optiboot_atmega328.hex

then i inserted ID to freeduino board. when i plug the USB cable, the led is blinking(3 times) after that it's gone to off state. When i try to upload the sketch blink.c from IDe, again the led is blinking and i am getting error

avrdude: stk500_getsync(): not in sync: resp=0x00

thanks & Regards,
Ben

Did you set the fuses to use 16MHz external crystal ?

HI,

i i dind't set anything. i don't know how to do that.Is it required to set to 16 Mhz..?

i run a avrdude command from command line.

avrdude -p m328p -c gpio -U lock:r:lock.txt:h -U efuse:r:efuse.txt:h -U hfuse:r:hfuse.txt:h -U lfuse:r:lfuse.txt:h -U signature:r:signature.txt:h

output is :

root@raspberrypi:~# more *.txt
::::::::::::::
efuse.txt
::::::::::::::
0x7
::::::::::::::
hfuse.txt
::::::::::::::
0xd9
::::::::::::::
lfuse.txt
::::::::::::::
0x62
::::::::::::::
lock.txt
::::::::::::::
0x3f
::::::::::::::
signature.txt
::::::::::::::
0x1e,0x95,0xf

Your fuses seems to be the factory default : 8MHz /8 internal OSC

For a standard UNO with 16MHz external x-tal the fuses are

low_fuses=0xff
high_fuses=0xde
extended_fuses=0x05

In this tutorial you can see how you change fuses

http://www.ladyada.net/learn/avr/avrdude.html