how to flash atmega16u2 for a arduinoDUE based project

hello everyone,
i'm working on project based on Arduino DUE. i've already printed my pcb and now i need to flash the atmega16u2.
according to this guide http://arduino.cc/en/Hacking/Upgrading16U2Due i shouldd be able to flash it siply connecting to the usb and then execute avrdude.exe from the cmd program(i'm using windows seven), but in my arduino due IDE (1.5.2) i can't find avrdude.conf nor the hex file.
where can i find them?

i shouldd be able to flash it siply connecting to the usb and then execute avrdude.exe

I don't know that is correct, it implies that the u2 has a ROM-based bootloader and I don't think it does. I always thought you had to use ISP to program it.

I admit the article seems to say you can.

I found the avrdude files with a quick search under Vista, I would think 7 has a search facility?

\hardware\tools\avr\etc

for the conf file, I too cannot find that exact HEX file though but there are a lot of them in the bootloaders folder.


Rob

aureliusss:
hello everyone,
i'm working on project based on Arduino DUE. i've already printed my pcb and now i need to flash the atmega16u2.
according to this guide http://arduino.cc/en/Hacking/Upgrading16U2Due i shouldd be able to flash it siply connecting to the usb and then execute avrdude.exe from the cmd program(i'm using windows seven), but in my arduino due IDE (1.5.2) i can't find avrdude.conf nor the hex file.
where can i find them?

No, according to that article you need to flash a special sketch to an Uno or Mega and use it as an ISP (or use a normal ISP tool) to connect to a six pin connector on the Due that lets you flash the 16U2 chip. You can't just program that chip through the USB port.

ok, so i have to use arduino, but how do i check if the isp-sketch is really working? how do i know when the process is over?

The arduino is just a conduit. You still have to use avrdude (the program) and it will give you status messages. So, if it tells you that things didn't work then something is wrong. Otherewise, it'll tell you that it did work.

thus the problem remain where do i find the files? can you check if you have them in your IDE folder?

EDIT: i think i've found the files. the 16u2.hex file i have to upload is the one located in the folder arduino-1.5.2\hardware\arduino\sam\firmwares\atmega16u2\ Arduino-DUE-usbserial.hex, right?

That sounds right to me. You should try it and report back so that other people know what to do and where to find the files in the future.

ok Then i've found avrdude.conf in arduino-1.5.2\hardware\tools\avr\etc while the hex file is located in arduino-1.5.2\hardware\arduino\sam\firmwares\atmega16u2

(for windows users) the line to write in the cmd is your_path\avrdude.exe -C avrdude.conf -c arduino -P COMyour_com_port -b 19200 -p m16u2 -vvv -U flash:w: your_path_to_hex_file:i

but a problem still remains: my arduinoDUE based board is not recognised from my laptop(windows 7) so i can't upload any sketch. it is seen as unknown device with error code 43. i've tried several ways to udpate drivers, but none of them worked.