SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By Xuthus
#195088
I am wanting to update the ATmega firmware in my DUE to get rid of the system reset when the USB port connects.
I am trying to use a Buspirate v3.6a and AVRdude 6.3 for 16u2 communications. Acording to Arduino the latest firmware for the DUE 16u2 is dated 2013-02-05 and the first couple lines from the .hex file are as follows:

:10000000A7C00000C0C00000BEC00000BCC000000F
:10001000BAC00000B8C00000B6C00000B4C0000004

When I use the buspirate to read the 16U2 flash with the following command:

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>avrdude -C ..\etc\avrdude.
conf -c buspirate -b 115200 -i 25 -P com12 -p m16u2 -U flash:r:old16u2.hex:i

The first couple of lines of the .hex file are as follows:

:20000000A8C00000C1C00000BFC00000BDC00000BBC00000B9C00000B7C00000B5C000001B
:20002000B3C00000B1C00000AFC00000B9C400007DC40000A9C00000A7C00000A5C000007A

Since the unit is brand new, it's reasonable to expect that the two files should be identical or have small differences. As it turns out, the two files only match up in the last lines of code. If you notice, there is a specific pattern with the difference, leading to the possibility of a software error in the comm chain. Here's what I have tried so far (with no change in results);

1) The Buspirate started out with FW 5.10. I have updated it to 7.00. It sped up the flash read tremendously, but the outputs are identical.
2) The version of AVRdude used is the one that came with the Arduino 1.8.1 IDE environment. I have not tried earlier versions. I have tried various output formats with no change. Should the Buspirate and 16u2 sections in avrdude.conf be tweaked for the versions I'm using?
3) While the Buspirate passes the selftest with 0 errors, is there a mode other than SPI that the Buspirate can be configured for to read the 16u2? I want to try and isolate the issue.
By Xuthus
#195097
Does anyone know of a way to make AVRdude (v6.3) output intel format with a 16 byte data length (as opposed to its default 32 byte data length) when it read flash and creates the .hex file?