Go Down

Topic: how to flash atmega16u2 for a arduinoDUE based project (Read 1 time) previous topic - next topic

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?

Graynomad

#1
Aug 25, 2013, 12:46 am Last Edit: Aug 25, 2013, 12:49 am by Graynomad Reason: 1
Quote
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?

<install-folder>\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
Rob Gray aka the GRAYnomad www.robgray.com

Collin80


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.

aureliusss

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?

Collin80

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.

aureliusss

#5
Aug 26, 2013, 08:33 am Last Edit: Aug 26, 2013, 12:38 pm by aureliusss Reason: 1
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?

Collin80

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.

aureliusss

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 [font=Verdana]your_path[/font]\avrdude.exe -C avrdude.conf -c arduino -P COM[font=Verdana]your_com_port [/font]-b 19200 -p  m16u2 -vvv -U flash:w: [font=Verdana]your_path_to_hex_file[/font]: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.

Go Up