Pages: 1 [2]   Go Down
Author Topic: Garbage using serial functions in Arduino Due  (Read 8178 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
God Member
*****
Karma: 32
Posts: 507
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 What method is the best way to load that hex file? I have the program called Flip but, I am not sure if I am using it correctly because, it does seem to want to connect to the 16u2.

I used an ISP (well, actually the ArduinoISP sketch running on a Mega). I don't think the Due has a DFU firmware.

The firmware is better but I still get occasional odd results. For example,  after uploading (fixed) AnalogReadSerial  then uploading ASCIITable then opening the serial monitor, I get this:

Code:
453
457
454
451
26, oct: 46, bin: 100110
', dec: 39, hex 24, oct: 44, bin: 100100
%, dec: 37, hex: 25, oct: 45, bin: 100101
&, dec: 38, hex: 26, oct: 46, bin: 100110
', dec: 39, hex: 27, oct:44, bin: 100100
%, dec: 37, hex: 25, oct: 45, bin: 100101
&, dec: 38, hex: 26, oct: 46, bin: 100110
', dec: 39, hex: 27, oct:ASCII Table ~ Character Map
!, dec: 33, hex: 21, oct: 41, bin: 100001
", dec: 34, hex: 22, oct: 42, bin: 100010
#, dec: 35, hex: 23, oct: 43, bin: 100011
$, dec: 36, hex: 24, oct: 44, bin: 100100
%, dec: 37, hex: 25, oct: 45, bin: 100101
&, dec: 38, hex: 26, oct: 46, bin: 100110
', dec: 39, hex: 27, oct: 47, bin: 100111
(, dec: 40, hex: 28, oct: 50, bin: 101000
), dec: 41, hex: 29, oct: 51, bin: 101001
*, dec: 42, hex: 2A, oct: 52, bin: 101010
+, dec: 43, hex: 2B, oct: 53, bin: 101011
,, dec: 44, hex: 2C, oct: 54, bin: 101100
-, dec: 45, hex: 2D, oct: 55, bin: 101101
., dec: 46, hex: 2E, oct: 56, bin: 101110
/, dec: 47, hex: 2F, oct: 57, bin: 101111
0, dec: 48, hex: 30, oct: 60, bin: 110000
1, dec: 49, hex: 31, oct: 61, bin: 110001
2, dec: 50, hex: 32, oct: 62, bin: 110010
3, dec: 51, hex: 33, oct: 63, bin: 110011
4, dec: 52, hex: 34, oct: 64, bin: 110100
5, dec: 53, hex: 35, oct: 65, bin: 110101
6, dec: 54, hex: 36, oct: 66, bin: 110110
7, dec: 55, hex: 37, oct: 67, bin: 110111
8, dec: 56, hex: 38, oct: 70, bin: 111000
9, dec: 57, hex: 39, oct: 71, bin: 111001
:, dec: 58, hex: 3A, oct: 72, bin: 111010
;, dec: 59, hex: 3B, oct: 73, bin: 111011
<, dec: 60, hex: 3C, oct: 74, bin: 111100
=, dec: 61, hex: 3D, oct: 75, bin: 111101
>, dec: 62, hex: 3E, oct: 76, bin: 111110
?, dec: 63, hex: 3F, oct: 77, bin: 111111
etc.
I guess the first few lines are remnants of what is stuck in the OS serial input buffer from AnalogReadSerial,  but I'm not sure what's going on before ASCIITable starts properly.

Logged


France
Offline Offline
Sr. Member
****
Karma: 0
Posts: 262
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The firmware is better but I still get occasional odd results. For example,  after uploading (fixed) AnalogReadSerial  then uploading ASCIITable then opening the serial monitor, I get this:

Would you mind run my Java ElectroShaman SerPro as discussed on other thread http://arduino.cc/forum/index.php/topic,146696.0.html to see if firmware update helps ?

I suggest this because a real RX/TX with 16-bits CRC detection provides many diversity of USB links so in a way, is tough or heavy duty test.

Thank you, Albert
Logged

Forum Administrator
Milano, Italy
Offline Offline
Sr. Member
*****
Karma: 23
Posts: 292
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I guess the first few lines are remnants of what is stuck in the OS serial input buffer from AnalogReadSerial,  but I'm not sure what's going on before ASCIITable starts properly.

How can it be? I mean... there is a sketch upload beetween AnalogReadSerial and ASCIIITable output, the only way is that RXTX keeps the last read buffer even if you close and open the serial port.
Logged

C.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello!

I am bitten by the same bug. I want to update the firmware. Can anybody point me to any easy to follow recipe for updating the firmware on Linux (or Windows)? Thanks.

Stephan
Logged

France
Offline Offline
Sr. Member
****
Karma: 0
Posts: 262
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I only have a Mac and i'm stuck, it seems no DFU-programmer exist for Mac, see http://arduino.cc/forum/index.php/topic,147639.0.html

A friend of mine told me of this site that reports a DFU for the atmega16u2, maybe it works for you on PC http://dfu-programmer.sourceforge.net

Otherwise cmaglie wrote me this private mail

The 16u2 doesn't have DFU firmware inside, you must program it with an AVR-ISP (or equivalent programmer) from the ISP connector (the 6-pin header near the power jack).
If you don't have an ISP programmer you can emulate one using an Arduino Uno or Mega loaded with the ArduinoISP sketch.

http://arduino.cc/en/Tutorial/ArduinoISP
http://playground.arduino.cc/Code/MegaISP


So I'm confused, Albert
Logged

Forum Administrator
Milano, Italy
Offline Offline
Sr. Member
*****
Karma: 23
Posts: 292
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


The only way to upgrade the 16u2 firmware on the Due Board is with an ISP programmer.

You can use DFU-programmer, Flip, or similar only if the "DFU bootloader" is burned into the 16u2, but this is not the case.

Logged

C.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok cmaglie,

I happen to have an Arduino Uno. The tutorial at http://arduino.cc/en/Tutorial/ArduinoISP does not mention how to update the Due firmware from an Arduino Uno. And I do not want to connect it as shown in the tutorial because of the 5V intolerant inputs of the Due. Can you describe how to connect these two boards?

Sorry, I am more on the programming side and not so much on the hardware side (that's why I opted for the Arduino).

Thanks,
Stephan
Logged

Wahiawa, Hawaii
Online Online
God Member
*****
Karma: 29
Posts: 600
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 16U2 is running from 5v.  It should be safe to program from 5v programmers via ICSP.  Just make sure you use the 6-pin header next to it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Would anyone of you gurus go the extra mile and enlighten us not that bright users which pin on the Uno we have to connect to which pin on the Due? Thanks!

Stephan
Logged

Forum Administrator
Milano, Italy
Offline Offline
Sr. Member
*****
Karma: 23
Posts: 292
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I happen to have an Arduino Uno. The tutorial at http://arduino.cc/en/Tutorial/ArduinoISP does not mention how to update the Due firmware from an Arduino Uno. And I do not want to connect it as shown in the tutorial because of the 5V intolerant inputs of the Due. Can you describe how to connect these two boards?

Sorry, I am more on the programming side and not so much on the hardware side (that's why I opted for the Arduino).

I asked one of my collaborator to write a step-by-step tutorial for that, more info coming in a short while.
Thanks for the patience.
Logged

C.

Forum Administrator
Milano, Italy
Offline Offline
Sr. Member
*****
Karma: 23
Posts: 292
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here the tutorial to upload new firmware on the ATmega16u2:

http://arduino.cc/en/Hacking/Upgrading16U2Due

please report any issue/success by posting a comment here:

https://github.com/arduino/Arduino/pull/1267
Logged

C.

France
Offline Offline
Sr. Member
****
Karma: 0
Posts: 262
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

All right, working much better now with new USB firmware https://github.com/arduino/Arduino/pull/1267#issuecomment-14058478
« Last Edit: February 25, 2013, 11:32:01 pm by selfonlypath » Logged

Pages: 1 [2]   Go Up
Jump to: