Weird and erroneous behavior of DUE's USB native port

Hi all,

I am writing you to share a problem I have since some days ago with the usb native port on the Arduino DUE. In general, I use this port for uploading (it is faster), and also for having debugging information on the serial monitor. The question is that since I have updated my ubuntu system it has stopped working correctly.

First, information about the Ubuntu system I usually work with:

:~⟫ lsb_release -a
LSB Version:    core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

:~⟫ uname -a
Linux dis172acp 4.13.0-26-generic #29~16.04.2-Ubuntu SMP Tue Jan 9 22:00:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

To problem basically is that once a program it is uploaded using the native port, the port in the process of restarting is not recognized by the system, dmesg provides me the following information:

[ 1989.372173] usb 2-1.2: device descriptor read/64, error -71
[ 1990.188160] usb 2-1.2: device not accepting address 15, error -71
[ 1990.268155] usb 2-1.2: new high-speed USB device number 16 using ehci-pci

I have created a small test code based on the blink example to reproduce the problem:

I have created a small test code based on the blink example to reproduce the problem:

void setup() {
  SerialUSB.begin(57600);
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT); 
}

// the loop function runs over and over again forever
void loop() {
  SerialUSB.println("----> HIGH");
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second

  SerialUSB.println("----> LOW");
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Taking into account that I have not changed anything in my Arduino IDE, Arduino IDE 1.8.5 and Arduino SAM Boards Support 1.6.11 since previously the updating of my ubuntu systems. I am suspecting that something on the Linux kernel has changed, doing the process of enumerating and registering usb devices more strict, provoking that now the usb native is not getting recognized.

Another colleague of mine in the lab has the same problem with a previous kernel 4.4.108, and I have kernel 4.13.0.

I have checked if the problem persists uploading using the programming port, and unfortunately, once done the upload, the native port keeps not being recognized by the system.

To start with I would like to make two questions:

  1. Is there anyone out there having the same problems?.

  2. Does anybody know at which kernel version (my hypothesis) this problem started to appear? (unfortunately I was not able to perceive in which kernel version this malfunctioning started to happen).

Thanks in advance.

antodom:
Hi all,

I am writing you to share a problem I have since some days ago with the usb native port on the Arduino DUE. In general, I use this port for uploading (it is faster), and also for having debugging information on the serial monitor. The question is that since I have updated my ubuntu system it has stopped working correctly.

First, information about the Ubuntu system I usually work with:

:~⟫ lsb_release -a

LSB Version:    core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:      xenial

:~⟫ uname -a
Linux dis172acp 4.13.0-26-generic #29~16.04.2-Ubuntu SMP Tue Jan 9 22:00:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux




To problem basically is that once a program it is uploaded using the native port, the port in the process of restarting is not recognized by the system, dmesg provides me the following information: 



[ 1989.372173] usb 2-1.2: device descriptor read/64, error -71
[ 1990.188160] usb 2-1.2: device not accepting address 15, error -71
[ 1990.268155] usb 2-1.2: new high-speed USB device number 16 using ehci-pci




I have created a small test code based on the blink example to reproduce the problem:

I have created a small test code based on the blink example to reproduce the problem:



void setup() {
  SerialUSB.begin(57600);
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  SerialUSB.println("----> HIGH");
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second

SerialUSB.println("----> LOW");
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}




Taking into account that I have not changed anything in my Arduino IDE, Arduino IDE 1.8.5 and Arduino SAM Boards Support 1.6.11 since previously the updating of my ubuntu systems. I am suspecting that something on the Linux kernel has changed, doing the process of enumerating and registering usb devices more strict, provoking that now the usb native is not getting recognized.

Another colleague of mine in the lab has the same problem with a previous kernel 4.4.108, and I have kernel 4.13.0.

I have checked if the problem persists uploading using the programming port, and unfortunately, once done the upload, the native port keeps not being recognized by the system.

To start with I would like to make two questions:

1. Is there anyone out there having the same problems?.

2. Does anybody know at which kernel version (my hypothesis) this problem started to appear? (unfortunately I was not able to perceive in which kernel version this malfunctioning started to happen).

Thanks in advance.

I do not use Ubuntu but since it is based on Debian I will give it a go.

Do you have both the programming port and the native port connected to the computer with two usb cables?

I have several DUE and normally use the Programming port.
Running Debian Stretch

cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Have you tried a different Linux Kernel?

I am running
uname -a
Linux birnbaum 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux

I use Linux Mint 18.3 for all of my development work. It's based upon the same version of Ubuntu you're using. I don't have your same problem. But, I'm also using a slightly different kernel version - 4.13.0-31-generic

However, I don't know if that's your problem or not. It'd be a good guess and you could confirm that by reverting to an earlier kernel. But, the error messages you're seeing look familiar to me. Errors very much like that happen to me if I use a crappy USB cord. I know it probably sounds stupid but try a few other cords if you can. Sometimes computers can get picky about the cord and things will mess up only with certain cords. Some cords will let your upload but then it breaks or you can sometimes upload and sometimes get data but not always. Bad cords are the bane of existence. Rule out the cord before you do anything else.