Trying to upload the program from anAtmega328p

Can anyone tell me what I am doing wrong ?
I am sending this command line to avrdude

# avrdude -p m328p -P usb:2:/dev/ttyusb4 -c usbtiny -U flash:r:"/root/flash.bin":r

and getting this response

avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)
avrdude done.  Thank you.

When I program to the chip I use /dev/ttyusb4 and it goes well but it does not find the device here?

Lua rocks!
View Profile
WWW
Personal Message (Offline)

Insults
« Sent to: april on: Today at 06:35:05 AM »
Reply with quoteQuote ReplyReply Remove this messageRemove
Quote
When i tell him to B... Offf I mean it
He then gets all reasonable and better for a while

I would just prefer he b...s off .

You are acting like a pack of dogs to his aid .

This sort of language is not acceptable.

The Arduino software is free, and the people on the forum are unpaid volunteers.

Post a public apology or I will ban you.

When you get free advice you don't get to choose who replies and who doesn't. You don't demand that certain people don't respond to you.

  • Moderator
    Get Fucked

Do you really have an USBtinyISP device as you specified on the command line? If yes, it will probably not be on /dev/ttyusb4, as it doesn't emulate a serial interface. The USBtinyISP are access through libusb and not by a kernel driver.

Thanks - You are right . When I unplug and replug the device I get
"usbdev2.9"
So what address do I use for that?

All good thanks found it with this

# avrdude -p m328p -c usbtiny -U flash:r:"/flash.hex":r 

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: reading flash memory:

Reading | ################################################## | 100% 62.34s

avrdude: 1 retries during read


avrdude: writing output file "/flash.hex"

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

#

The file saved is a binary file and not a hex file so now I need to convert it or get it in the hex format.
How do I do that ? OK realised that the last "r" stood for raw and changed that to "i" for Intel Hex
avrdude -p m328p -c usbtiny -U flash:r:"/flash.hex":i