Arduino serial instability on Linux

This is my second post relating to this issue (previous topic here); trying to describe the problem more openly without getting too in the weeds on specifics. Long story short, I can get a stable serial connection set up between a Linux machine and a variety of USB serial devices. These devices are microcontrollers basically acting as a feedthrough of sensor data and the data is always arriving on their respective serial ports if opened using code or some sort of monitor. The exception is Arduino products or sister products using the same format (UNO, Blackboard, Redboard, Due, Elegroo Mega 2560). When attempting to use these devices the same way, there is instability in the sense that when I open the serial port to read data, close the serial port, then reopen the serial port there is no data arriving by serial. The Linux machine usually still recognizes the Arduino is connected under lsusb and ls /dev/tty, but serial data won't arrive on the Linux side until I disconnect and reconnect my Arduino product. I experience the same behavior in the IDE. Sometimes the dev file and device cannot be found even if I disconnect and reconnect the device, but I can temporarily reset Linux's ability to see the device by restarting my main computer, so that doesn't feel like the same problem. I've tried creating udev rules that act as shortcuts to the correct Arduino device port (regardless of whether or not its dev file changes), setting dsrdtr settings, adding exception handling to code, watching dmesg, lsusb, ls /dev/tty, adding in code to synchronize the linux machine and arduino, and many other things. Yes, dialout permission are sorted. Very frustrating, especially because I can get other microcontrollers working well over USB.

I am trying to get the data from the Nine Axis Motion Shield to my Linux device in a similar feedthrough manner, so that I can open and close the serial port whenever I'd like on the Linux side without having to disconnect my Arduino. I'm looking for suggestions to make an Arduino work, or if someone has done similarly a clean method to use a Teensy 4.0 or 4.1, jumpers, and the same shield. The Arduino route is preferable.

1 Like

With Arduinos with AVR processors, I put a 100nF ceramic capacitor from reset pin to GND, stops Arduino from resetting when serial connects. Cap must be removed to program though, I install a double throw slide switch to disconnect the cap for programming.

Have you checked to see if either the brltty or modemmanager packages are installed? They've been the cause of much hair pulling over the years.

2 Likes

I will definitely be giving this a try, but...

The DUE isnt AVR. And unless I am misunderstanding what you mean by "reset", I don't think the device being sent back to its void setup { } function would be a problem for me, because the Arduino will simply restart its serial connection and begin spitting out data as if nothing happened. That could maybe cause the dev file to change in Linux, but I've handled that with the custom udev rule.

Sorry if you mean something else. It's almost as if the Linux machine is still latched onto the serial port even after explicitly closing it.

1 Like

Not familiar with Due, think I would check datasheet and schematic thoroughly first.

https://www.arduino.cc/en/uploads/Main/arduino-Due-schematic.pdf

I have uninstalled both, restarted my system, and still no luck.

Sounds like it's time to dive into dmesg and see if there's some other package competing for the port.

1 Like

dmesg -w and watch what happens when

1 Like

Sure. Here is dmesg:

When I first connect my Arduino I get:

[ 2612.590003] cdc_acm 1-2.3.1:1.0: ttyACM0: USB ACM device

with grep tty and:

[ 2942.197246] usb 1-2.3.1: new full-speed USB device number 13 using tegra-xusb
[ 2942.319689] usb 1-2.3.1: New USB device found, idVendor=2a03, idProduct=0043, bcdDevice= 0.01
[ 2942.319699] usb 1-2.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 2942.319703] usb 1-2.3.1: Product: Arduino Uno
[ 2942.319707] usb 1-2.3.1: Manufacturer: Arduino Srl            
[ 2942.319710] usb 1-2.3.1: SerialNumber: 7543535303835191B031
[ 2942.322040] cdc_acm 1-2.3.1:1.0: ttyACM0: USB ACM device

appears to be the relevant items from the full dmesg output.

While the port is open for the first time I get the same output. After closing the port for the first time, I also get the same output. Running a second time - again the same. Obviously these things change slightly depending on the type of Arduino I am using.

For comparison, here is the dmesg output when using a Teensy (one of the serial devices that work):

[ 3645.684595] usb 1-2.3.1: new high-speed USB device number 15 using tegra-xusb
[ 3645.804697] usb 1-2.3.1: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.80
[ 3645.804708] usb 1-2.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3645.804713] usb 1-2.3.1: Product: USB Serial
[ 3645.804716] usb 1-2.3.1: Manufacturer: Teensyduino
[ 3645.804719] usb 1-2.3.1: SerialNumber: 13208780
[ 3645.806922] cdc_acm 1-2.3.1:1.0: ttyACM0: USB ACM device
1 Like

Okay then. There may have been more data in things that didn't appear at first glance to be relevant, but since we can't see them, that's pretty much it then. Good luck with your investigation.

Apologies. Are you asking me to provide the entire dmesg output? I don't think I understand your response. Thanks for helping me work through this.

If you wanted the full output of dmesg here it is to the extent that I can see from terminal. The stuff above gets cut off:

[   11.966927] usb 1-2.3.2.2: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice=81.34
[   11.975893] usb 1-2.3.2.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[   11.983809] usb 1-2.3.2.2: Product: USB Serial
[   12.002139] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null)
[   12.017152] Rootfs mounted over mmcblk1p1
[   12.033722] Switching from initrd to actual rootfs
[   12.344772] systemd[1]: System time before build time, advancing clock.
[   12.577090] systemd[1]: systemd 245.4-4ubuntu3.23 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
[   12.600872] systemd[1]: Detected architecture arm64.
[   12.707535] random: crng init done
[   13.051998] systemd[1]: Set hostname to <robot1>.
[   13.393291] systemd[1]: system-modprobe.slice: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[   13.406316] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
[   13.416409] systemd[1]: Created slice system-modprobe.slice.
[   13.436561] systemd[1]: Created slice system-serial\x2dgetty.slice.
[   13.456479] systemd[1]: Created slice User and Session Slice.
[   13.476141] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[   13.500372] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[   13.524121] systemd[1]: Reached target User and Group Name Lookups.
[   13.544061] systemd[1]: Reached target Slices.
[   13.560054] systemd[1]: Reached target Mounting snaps.
[   13.580055] systemd[1]: Reached target Swap.
[   13.596386] systemd[1]: Listening on RPCbind Server Activation Socket.
[   13.616194] systemd[1]: Listening on Syslog Socket.
[   13.636180] systemd[1]: Listening on fsck to fsckd communication Socket.
[   13.660125] systemd[1]: Listening on initctl Compatibility Named Pipe.
[   13.680318] systemd[1]: Listening on Journal Audit Socket.
[   13.700172] systemd[1]: Listening on Journal Socket (/dev/log).
[   13.720200] systemd[1]: Listening on Journal Socket.
[   13.740212] systemd[1]: Listening on udev Control Socket.
[   13.760140] systemd[1]: Listening on udev Kernel Socket.
[   13.781643] systemd[1]: Mounting Huge Pages File System...
[   13.801550] systemd[1]: Mounting POSIX Message Queue File System...
[   13.825462] systemd[1]: Mounting RPC Pipe File System...
[   13.845620] systemd[1]: Mounting Kernel Debug File System...
[   13.865570] systemd[1]: Mounting Kernel Trace File System...
[   13.885890] systemd[1]: Starting Journal Service...
[   13.905826] systemd[1]: Starting Set the console keyboard layout...
[   13.929969] systemd[1]: Starting Create list of static device nodes for the current kernel...
[   13.957695] systemd[1]: Starting Load Kernel Module chromeos_pstore...
[   13.980100] systemd[1]: Condition check resulted in Load Kernel Module drm being skipped.
[   13.990091] systemd[1]: Starting Load Kernel Module efi_pstore...
[   14.009626] systemd[1]: Starting Load Kernel Module pstore_blk...
[   14.029454] systemd[1]: Starting Load Kernel Module pstore_zone...
[   14.049399] systemd[1]: Starting Load Kernel Module ramoops...
[   14.069575] systemd[1]: Starting NVIDIA specific first-boot udev script...
[   14.093510] systemd[1]: Started Nameserver information manager.
[   14.112314] systemd[1]: Reached target Network (Pre).
[   14.158137] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
[   14.167539] systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
[   14.180878] systemd[1]: Starting Load Kernel Modules...
[   14.201492] systemd[1]: Starting Remount Root and Kernel File Systems...
[   14.213337] nvmap_heap_init: nvmap_heap_init: created heap block cache
[   14.216085] EXT4-fs (mmcblk1p1): re-mounted. Opts: (null)
[   14.221603] tegra-carveouts tegra-carveouts: vpr :dma coherent mem declare 0x0000000249800000,914358272
[   14.236698] tegra-carveouts tegra-carveouts: assigned reserved memory node vpr-carveout
[   14.244967] nvmap_page_pool_init: Total RAM pages: 1659014
[   14.250600] nvmap_page_pool_init: nvmap page pool size: 207376 pages (810 MB)
[   14.258004] nvmap_background_zero_thread: PP zeroing thread starting.
[   14.258120] misc nvmap: created heap vpr base 0x0000000249800000 size (892928KiB)
[   14.265879] systemd[1]: Starting udev Coldplug all Devices...
[   14.294243] systemd[1]: Started Journal Service.
[   14.513741] nvgpu: 17000000.ga10b          nvgpu_nvhost_syncpt_init:135  [INFO]  syncpt_unit_base 60000000 syncpt_unit_size 4000000 size 10000

[   14.684716] systemd-journald[253]: Received client request to flush runtime journal.
[   15.432472] loop: module loaded
[   17.348710] nvidia: loading out-of-tree module taints kernel.
[   17.360405] nv_platform 13800000.display: Adding to iommu group 54
[   17.363854] platform 13800000.display:nvdisplay-niso: Adding to iommu group 55
[   17.368328] NVRM: loading NVIDIA UNIX Open Kernel Module for aarch64  35.4.1  Release Build  (buildbrain@mobile-u64-6422-d7000)  Tue Aug  1 12:45:41 PDT 2023
[   17.423313] r8168 0008:01:00.0: Adding to iommu group 11
[   17.423620] r8168 Gigabit Ethernet driver 8.051.02-NAPI loaded
[   17.423716] r8168 0008:01:00.0: enabling device (0000 -> 0003)
[   17.425412] spi-tegra114 3210000.spi: Adding to iommu group 2
[   17.431179] spi-tegra114 3230000.spi: Adding to iommu group 2
[   17.450326] imx219 9-0010: tegracam sensor driver:imx219_v2.0.6
[   17.458580] r8168: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.
[   17.460705] r8168  Copyright (C) 2022 Realtek NIC software team <nicfae@realtek.com> 
                This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/licenses/>. 
                This is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>. 
[   17.464795] imx219 9-0010: imx219_board_setup: error during i2c read probe (-121)
[   17.479430] imx219 9-0010: board setup failed
[   17.484184] imx219: probe of 9-0010 failed with error -121
[   17.490124] imx219 10-0010: tegracam sensor driver:imx219_v2.0.6
[   17.491820] cpu-throttle-alert cooling device registered.
[   17.491918] gpu-throttle-alert cooling device registered.
[   17.491987] cv0-throttle-alert cooling device registered.
[   17.492082] cv1-throttle-alert cooling device registered.
[   17.492136] cv2-throttle-alert cooling device registered.
[   17.492198] soc0-throttle-alert cooling device registered.
[   17.492256] soc1-throttle-alert cooling device registered.
[   17.492313] soc2-throttle-alert cooling device registered.
[   17.492399] hot-surface-alert cooling device registered.
[   17.496466] tegra-adma 2930000.adma: Tegra210 ADMA driver registered 16 channels
[   17.502725] imx219 10-0010: imx219_board_setup: error during i2c read probe (-121)
[   17.518196] imx219 10-0010: board setup failed
[   17.523883] imx219: probe of 10-0010 failed with error -121
[   17.530089] tegra-hda 3510000.hda: Adding to iommu group 56
[   17.582607] irq: IRQ307: trimming hierarchy from :pmc@c360000
[   17.584317] fusb301 1-0025: device id: 0x12
[   17.615937] fusb301 1-0025: toggle_time(0) is not updated
[   17.624195] fusb301 1-0025: fusb301_set_mode: mode (32)(32)
[   17.624516] fusb301 1-0025: fusb301_detach: type[0x00] chipstate[0x01]
[   17.624519] fusb301 1-0025: fusb_update_state: 1
[   17.625279] fusb301 1-0025: mode[0x20], host_cur[0x02], dttime[0x00]
[   17.648517] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=3 as /devices/platform/3510000.hda/sound/card0/input6
[   17.648662] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=7 as /devices/platform/3510000.hda/sound/card0/input7
[   17.648781] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=8 as /devices/platform/3510000.hda/sound/card0/input8
[   17.648937] input: NVIDIA Jetson Orin NX HDA HDMI/DP,pcm=9 as /devices/platform/3510000.hda/sound/card0/input9
[   17.705331] nvadsp 2993000.adsp: Adding to iommu group 57
[   17.705501] nvadsp 2993000.adsp: in probe()...
[   17.706398] nvadsp 2993000.adsp: nvadsp_app_module_probe
[   17.746913] rtl88x2ce 0001:01:00.0: Adding to iommu group 8
[   17.747385] rtl88x2ce 0001:01:00.0: enabling device (0000 -> 0003)
[   17.756256] tegra-asoc: sound: Adding to iommu group 57
[   17.873073] tegra210-adsp aconnect@2a41000:adsp_audio: Adding to iommu group 57
[   17.873107] tegra210_adsp_audio_probe: platform probe started
[   17.873561] tegra210-adsp tegra210-adsp: Default param-type to BYTE for mp3-dec1
[   17.873888] tegra210-adsp tegra210-adsp: Default param-type to BYTE for spkprot
[   17.874210] tegra210-adsp tegra210-adsp: Default param-type to BYTE for src
[   17.874520] tegra210-adsp tegra210-adsp: Default param-type to BYTE for aac-dec1
[   17.874829] tegra210-adsp tegra210-adsp: Default param-type to BYTE for aec
[   17.875134] tegra210-adsp tegra210-adsp: Default param-type to BYTE for wire
[   17.875138] tegra210-adsp tegra210-adsp: adma channel page address dt entry not found
[   17.875139] tegra210-adsp tegra210-adsp: using adma channel page 0
[   17.875201] nvadsp 2993000.adsp: ADSP OS firmware already loaded
[   18.040415] cdc_acm 1-2.3.1:1.0: ttyACM0: USB ACM device
[   18.044181] cdc_acm 1-2.3.4:1.0: ttyACM1: USB ACM device
[   18.046537] usbcore: registered new interface driver btusb
[   18.046986] cdc_acm 1-2.3.2.1:1.0: ttyACM2: USB ACM device
[   18.052467] cdc_acm 1-2.3.3:1.0: ttyACM3: USB ACM device
[   18.054771] usbcore: registered new interface driver cdc_acm
[   18.054779] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   18.068441] cryptd: max_cpu_qlen set to 1000
[   18.082743] rtk_btusb: Realtek Bluetooth USB driver ver 3.1
[   18.082748] rtk_btcoex: rtk_btcoex_init: version: 1.2
[   18.082750] rtk_btcoex: create workqueue
[   18.082831] rtk_btcoex: alloc buffers 1792, 2432 for ev and l2
[   18.082902] rtk_btusb: btusb_probe intf->cur_altsetting->desc.bInterfaceNumber 0
[   18.082905] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[   18.082907] rtk_btusb: patch_add
[   18.082909] rtk_btusb: auto suspend is disabled
[   18.082913] rtk_btusb: pid = 0x3549
[   18.082916] rtk_btusb: patch_add: Reset gEVersion to 0xff
[   18.082924] rtk_btusb: set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
[   18.084255] rtk_btusb: btusb_probe: done
[   18.084366] rtk_btusb: btusb_open start
[   18.084371] rtk_btusb: btusb_open hdev->promisc ==0
[   18.084373] rtk_btusb: download_patch start
[   18.084376] rtk_btusb: chip type value: 0x73
[   18.084379] rtk_btusb: HCI reset.
[   18.085134] usbcore: registered new interface driver rtk_btusb
[   18.095944] rtk_btusb: read_ver_rsp->lmp_subver = 0x8822
[   18.095948] rtk_btusb: read_ver_rsp->hci_rev = 0xc
[   18.095951] rtk_btusb: patch_entry->lmp_sub = 0x8822
[   18.095953] rtk_btusb: load_firmware start
[   18.095955] rtk_btusb: lmp_version = 0x8822
[   18.095957] rtk_btusb: config filename rtl8822cu_config
[   18.098532] rtk_btusb: no bdaddr file /opt/bdaddr
[   18.098536] rtk_btusb: 55 ab 23 87 00 00
[   18.098542] rtk_btusb: Config file length 6, new length 6
[   18.098544] rtk_btusb: fw name is  rtl8822cu_fw
[   18.106619] rtk_btusb: This is not 8723a, use new patch style!
[   18.106625] rtk_btusb: rtk_get_eversion: gEVersion 255
[   18.107930] rtk_btusb: eversion->status = 0x0, eversion->version = 0x3
[   18.107935] rtk_btusb: load_firmware: New gEVersion 3
[   18.107938] rtk_btusb: rtk_get_fw_project_id: opcode 0, len 1, data 13
[   18.107940] rtk_btusb: lmp_version is 8822, project_id is 8822, match!
[   18.107941] rtk_btusb: fw_version = 0x9a8cbc9
[   18.107943] rtk_btusb: number_of_total_patch = 3
[   18.107944] rtk_btusb: chipID 4
[   18.107945] rtk_btusb: patch_length 0x8590
[   18.107946] rtk_btusb: start_offset 0x00005d00
[   18.107948] rtk_btusb: Svn version: 1940234490
[   18.107949] rtk_btusb: Coexistence: BTCOEX_20210106-2020
[   18.107951] rtk_btusb: buf_len = 0x8596
[   18.107960] rtk_btusb: fw: exists, config file: exists
[   18.107961] rtk_btusb: load_firmware done
[   18.107972] rtk_btusb: download_data start
[   18.107976] usbcore: registered new interface driver ch341
[   18.107992] usbserial: USB Serial support registered for ch341-uart
[   18.110131] ch341 1-2.3.2.2:1.0: ch341-uart converter detected
[   18.118186] usb 1-2.3.2.2: ch341-uart converter now attached to ttyUSB0
[   18.245648] tegra210-adsp tegra210-adsp: Loaded app wire
[   18.245654] tegra210-adsp tegra210-adsp: Loaded app apm
[   18.245656] tegra210-adsp tegra210-adsp: Loaded app adma
[   18.245657] tegra210-adsp tegra210-adsp: Loaded app adma_tx
[   18.245661] nvadsp_set_adma_dump_reg: callback for adma reg dump is sent to 00000000d97cb67b
[   18.271987] tegra210-adsp tegra210-adsp: Tegra210 ADSP driver successfully registered
[   18.277958] rtk_btusb: download_data done
[   18.277964] rtk_btusb: HCI reset.
[   18.280953] logitech-djreceiver 0003:046D:C52B.0003: hiddev96,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-3610000.xhci-2.1/input2
[   18.288935] rtk_btusb: read_ver_rsp->lmp_subver = 0xcbc9
[   18.288939] rtk_btusb: read_ver_rsp->hci_rev = 0x9a8
[   18.288942] rtk_btusb: patch_entry->lmp_sub = 0x8822
[   18.288949] rtk_btusb: Rtk patch end 0
[   18.288953] rtk_btusb: btusb_open set HCI_RUNNING
[   18.288980] rtk_btcoex: Open BTCOEX
[   18.288983] rtk_btusb: btusb_open end
[   18.290949] rtk_btcoex: BTCOEX hci_rev 0x09a8
[   18.290953] rtk_btcoex: BTCOEX lmp_subver 0xcbc9
[   18.310943] rtk_btusb: btusb_notify: hci0 evt 3
[   18.406547] input: Logitech Wireless Device PID:404d Keyboard as /devices/platform/3610000.xhci/usb1/1-2/1-2.1/1-2.1:1.2/0003:046D:C52B.0003/0003:046D:404D.0004/input/input10
[   18.406719] input: Logitech Wireless Device PID:404d Mouse as /devices/platform/3610000.xhci/usb1/1-2/1-2.1/1-2.1:1.2/0003:046D:C52B.0003/0003:046D:404D.0004/input/input11
[   18.406869] input: Logitech Wireless Device PID:404d Consumer Control as /devices/platform/3610000.xhci/usb1/1-2/1-2.1/1-2.1:1.2/0003:046D:C52B.0003/0003:046D:404D.0004/input/input12
[   18.406951] input: Logitech Wireless Device PID:404d System Control as /devices/platform/3610000.xhci/usb1/1-2/1-2.1/1-2.1:1.2/0003:046D:C52B.0003/0003:046D:404D.0004/input/input13
[   18.407057] hid-generic 0003:046D:404D.0004: input,hidraw1: USB HID v1.11 Keyboard [Logitech Wireless Device PID:404d] on usb-3610000.xhci-2.1/input2:1
[   18.924186] using random self ethernet address
[   18.931004] using random host ethernet address
[   19.104271] input: Logitech K400 Plus as /devices/platform/3610000.xhci/usb1/1-2/1-2.1/1-2.1:1.2/0003:046D:C52B.0003/0003:046D:404D.0004/input/input17
[   19.104669] logitech-hidpp-device 0003:046D:404D.0004: input,hidraw1: USB HID v1.11 Keyboard [Logitech K400 Plus] on usb-3610000.xhci-2.1/input2:1
[   19.795691] Mass Storage Function, version: 2009/09/11
[   19.795698] LUN: removable file: (no medium)
[   19.798414] using random self ethernet address
[   19.803014] using random host ethernet address
[   19.815346] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   19.815362] Bluetooth: BNEP socket layer initialized
[   19.831376] rndis0: HOST MAC f2:a1:2e:c9:4c:10
[   19.831382] rndis0: MAC f2:a1:2e:c9:4c:11
[   19.832655] usb0: HOST MAC f2:a1:2e:c9:4c:12
[   19.832658] usb0: MAC f2:a1:2e:c9:4c:13
[   19.833928] tegra-xudc 3550000.xudc: EP 0 (type: ctrl, dir: out) enabled
[   19.838537] l4tbr0: port 1(rndis0) entered blocking state
[   19.838551] l4tbr0: port 1(rndis0) entered disabled state
[   19.838724] device rndis0 entered promiscuous mode
[   19.846878] l4tbr0: port 2(usb0) entered blocking state
[   19.846893] l4tbr0: port 2(usb0) entered disabled state
[   19.847071] device usb0 entered promiscuous mode
[   20.166002] eth0: 0xffff8000108a7000, 48:b0:2d:eb:c2:90, IRQ 306
[   25.144641] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   26.461088] pstore: Using crash dump compression: deflate
[   26.461132] printk: console [ramoops-1] enabled
[   26.461135] pstore: Registered ramoops as persistent store backend
[   26.461138] ramoops: using 0x200000@0x231800000, ecc: 0
[   26.756850] nvgpu: 17000000.ga10b                  gk20a_scale_init:541  [INFO]  enabled scaling for GPU

[   27.096425] zram: Added device: zram0
[   27.096600] zram: Added device: zram1
[   27.096772] zram: Added device: zram2
[   27.096978] zram: Added device: zram3
[   27.097304] zram: Added device: zram4
[   27.097544] zram: Added device: zram5
[   27.186281] zram0: detected capacity change from 0 to 566276096
[   27.296091] Adding 553000k swap on /dev/zram0.  Priority:5 extents:1 across:553000k SS
[   27.298880] zram1: detected capacity change from 0 to 566276096
[   27.328062] Adding 553000k swap on /dev/zram1.  Priority:5 extents:1 across:553000k SS
[   27.329194] zram2: detected capacity change from 0 to 566276096
[   27.364063] Adding 553000k swap on /dev/zram2.  Priority:5 extents:1 across:553000k SS
[   27.365158] zram3: detected capacity change from 0 to 566276096
[   27.400054] Adding 553000k swap on /dev/zram3.  Priority:5 extents:1 across:553000k SS
[   27.401046] zram4: detected capacity change from 0 to 566276096
[   27.424101] Adding 553000k swap on /dev/zram4.  Priority:5 extents:1 across:553000k SS
[   27.425214] zram5: detected capacity change from 0 to 566276096
[   27.468066] Adding 553000k swap on /dev/zram5.  Priority:5 extents:1 across:553000k SS
[   29.501462] Bridge firewalling registered
[   30.701974] nvidia-modeset: Loading NVIDIA UNIX Open Kernel Mode Setting Driver for aarch64  35.4.1  Release Build  (buildbrain@mobile-u64-6422-d7000)  Tue Aug  1 12:45:42 PDT 2023
[   31.010690] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[   31.321811] NVRM nvAssertFailedNoLog: Assertion failed: minRequiredIsoBandwidthKBPS <= clientBwValues[DISPLAY_ICC_BW_CLIENT_EXT].minRequiredIsoBandwidthKBPS @ kern_disp_0402.c:111
[   31.321826] CPU: 5 PID: 147 Comm: kworker/u12:2 Tainted: G           O      5.10.120-tegra #1
[   31.321828] Hardware name: Unknown NVIDIA Orin NX Developer Kit/NVIDIA Orin NX Developer Kit, BIOS 3.0-32616947 02/21/2023
[   31.321842] Workqueue: dce-async-ipc-wq dce_client_async_event_work
[   31.321847] Call trace:
[   31.321855]  dump_backtrace+0x0/0x1d0
[   31.321858]  show_stack+0x30/0x40
[   31.321863]  dump_stack+0xd8/0x138
[   31.321935]  os_dump_stack+0x18/0x20 [nvidia]
[   31.321994]  tlsEntryGet+0x130/0x138 [nvidia]
[   31.322051]  kdispArbAndAllocDisplayBandwidth_v04_02+0x274/0x288 [nvidia]
[   31.322108]  kdispInvokeDisplayModesetCallback_KERNEL+0xa8/0xf0 [nvidia]
[   31.322164]  dceclientHandleAsyncRpcCallback+0x17c/0x2f0 [nvidia]
[   31.322219]  initVGXSpecificRegistry+0x1dc/0x300 [nvidia]
[   31.322223]  dce_client_async_event_work+0x8c/0x190
[   31.322228]  process_one_work+0x1c4/0x4a0
[   31.322231]  worker_thread+0x54/0x430
[   31.322233]  kthread+0x148/0x170
[   31.322237]  ret_from_fork+0x10/0x24
[   33.288191] audit: type=1326 audit(1718812043.722:2): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=2708 comm="cupsd" exe="/snap/cups/1053/sbin/cupsd" sig=0 arch=c00000b7 syscall=55 compat=0 ip=0xffffbe30910c code=0x50000
[   33.516617] audit: type=1326 audit(1718812043.950:3): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=2708 comm="cupsd" exe="/snap/cups/1053/sbin/cupsd" sig=0 arch=c00000b7 syscall=55 compat=0 ip=0xffffbe30910c code=0x50000
[   33.550599] audit: type=1326 audit(1718812043.982:4): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=2721 comm="cups-browsed" exe="/snap/cups/1053/sbin/cups-browsed" sig=0 arch=c00000b7 syscall=274 compat=0 ip=0xffff88eb1c28 code=0x50000
[   36.302471] fuse: init (API version 7.32)
[  202.840133] logitech-hidpp-device 0003:046D:404D.0004: HID++ 4.1 device connected.
[  296.524061] audit: type=1326 audit(1718812530.718:5): auid=1000 uid=1000 gid=1000 ses=2 subj=kernel pid=3571 comm="chrome" exe="/snap/chromium/2885/usr/lib/chromium-browser/chrome" sig=0 arch=c00000b7 syscall=444 compat=0 ip=0xffffbdd41c28 code=0x50000
[  297.452857] audit: type=1326 audit(1718812531.646:6): auid=1000 uid=1000 gid=1000 ses=2 subj=kernel pid=3668 comm="chrome" exe="/snap/chromium/2885/usr/lib/chromium-browser/chrome" sig=0 arch=c00000b7 syscall=436 compat=0 ip=0xffffbdd3c90c code=0x50000
[ 1320.191008] usb 1-2.3.1: USB disconnect, device number 6
[ 1507.865970] NVRM nvAssertFailedNoLog: Assertion failed: minRequiredIsoBandwidthKBPS <= clientBwValues[DISPLAY_ICC_BW_CLIENT_EXT].minRequiredIsoBandwidthKBPS @ kern_disp_0402.c:111
[ 1823.430607] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 2421.620259] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 2422.825553] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 2423.054557] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 2443.262385] usb 1-2.3.2: USB disconnect, device number 8
[ 2443.262397] usb 1-2.3.2.1: USB disconnect, device number 9
[ 2443.263748] usb 1-2.3.2.2: USB disconnect, device number 11
[ 2443.263982] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 2443.264023] ch341 1-2.3.2.2:1.0: device disconnected
[ 2444.285552] usb 1-2.3.3: USB disconnect, device number 10
[ 2445.053557] usb 1-2.3.4: USB disconnect, device number 7
[ 2612.464440] usb 1-2.3.1: new full-speed USB device number 12 using tegra-xusb
[ 2612.586818] usb 1-2.3.1: New USB device found, idVendor=2a03, idProduct=0043, bcdDevice= 0.01
[ 2612.586828] usb 1-2.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 2612.586833] usb 1-2.3.1: Product: Arduino Uno
[ 2612.586836] usb 1-2.3.1: Manufacturer: Arduino Srl            
[ 2612.586839] usb 1-2.3.1: SerialNumber: 7543535303835191B031
[ 2612.590003] cdc_acm 1-2.3.1:1.0: ttyACM0: USB ACM device
[ 2925.821831] usb 1-2.3.1: USB disconnect, device number 12
[ 2942.197246] usb 1-2.3.1: new full-speed USB device number 13 using tegra-xusb
[ 2942.319689] usb 1-2.3.1: New USB device found, idVendor=2a03, idProduct=0043, bcdDevice= 0.01
[ 2942.319699] usb 1-2.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 2942.319703] usb 1-2.3.1: Product: Arduino Uno
[ 2942.319707] usb 1-2.3.1: Manufacturer: Arduino Srl            
[ 2942.319710] usb 1-2.3.1: SerialNumber: 7543535303835191B031
[ 2942.322040] cdc_acm 1-2.3.1:1.0: ttyACM0: USB ACM device
[ 3499.774003] usb 1-2.3.1: USB disconnect, device number 13
[ 3504.113608] usb 1-2.3.1: new full-speed USB device number 14 using tegra-xusb
[ 3504.241320] usb 1-2.3.1: New USB device found, idVendor=2a03, idProduct=0043, bcdDevice= 0.01
[ 3504.241331] usb 1-2.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 3504.241336] usb 1-2.3.1: Product: Arduino Uno
[ 3504.241339] usb 1-2.3.1: Manufacturer: Arduino Srl            
[ 3504.241343] usb 1-2.3.1: SerialNumber: 7543535303835191B031
[ 3504.243470] cdc_acm 1-2.3.1:1.0: ttyACM0: USB ACM device
[ 3641.086018] usb 1-2.3.1: USB disconnect, device number 14
[ 3645.684595] usb 1-2.3.1: new high-speed USB device number 15 using tegra-xusb
[ 3645.804697] usb 1-2.3.1: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.80
[ 3645.804708] usb 1-2.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3645.804713] usb 1-2.3.1: Product: USB Serial
[ 3645.804716] usb 1-2.3.1: Manufacturer: Teensyduino
[ 3645.804719] usb 1-2.3.1: SerialNumber: 13208780
[ 3645.806922] cdc_acm 1-2.3.1:1.0: ttyACM0: USB ACM device
1 Like

The DUE is an Arduino SAM board (32-bits ARM Cortex-M3), but this problem doesn't seem specific to just the DUE as he has tested with a variety of Arduinos.

1 Like

If I recall correctly, the Due has 2 usb ports, one for programming, the other one for communication.

Yes, there are two, but my understanding is the one used for programming can also be used for serial communication. As mentioned above I have tried to get this working with several different Arduinos and not just the DUE, but since I haven't tried programming the DUE on the one port and doing the communication through the other I'll give it a stab just to check things.

When you search the forum youÄll find references to SerialUSB to use the programming port for serial communication. But you'll also find that the Due is reset when you open the port from the PC side ...

Using the programming port of the DUE to attempt the serial communication, I can't receive any data and I see:

[ 6084.134526] usb 1-2.3.1: new full-speed USB device number 21 using tegra-xusb
[ 6099.537764] usb 1-2.3.1: device descriptor read/64, error -110
[ 6115.153193] usb 1-2.3.1: device descriptor read/64, error -110
[ 6115.265798] usb 1-2.3-port1: attempt power cycle
[ 6115.893285] usb 1-2.3.1: new full-speed USB device number 22 using tegra-xusb
[ 6116.905850] usb 1-2.3.1: Device not responding to setup address.
[ 6118.129588] usb 1-2.3.1: Device not responding to setup address.
[ 6118.340981] usb 1-2.3.1: device not accepting address 22, error -71
[ 6118.440980] usb 1-2.3.1: new full-speed USB device number 23 using tegra-xusb
[ 6119.453348] usb 1-2.3.1: Device not responding to setup address.
[ 6120.677472] usb 1-2.3.1: Device not responding to setup address.
[ 6120.888887] usb 1-2.3.1: device not accepting address 23, error -71
[ 6120.895960] usb 1-2.3-port1: unable to enumerate USB device

from dmesg.

Attaching to the native USB port, I see

[ 6004.209315] usb 1-2.3.1: new high-speed USB device number 19 using tegra-xusb
[ 6004.331195] usb 1-2.3.1: New USB device found, idVendor=2341, idProduct=003e, bcdDevice= 1.00
[ 6004.331209] usb 1-2.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6004.331216] usb 1-2.3.1: Product: Arduino Due
[ 6004.331222] usb 1-2.3.1: Manufacturer: Arduino LLC
[ 6004.333087] cdc_acm 1-2.3.1:1.0: ttyACM0: USB ACM device

from dmesg, but none of the data arrives to the Linux machine. The UNOs and Mega2560s both at least get data to the Linux machine the first time.

Ok another followup. After restarting my Linux machine, I am able to get the DUE device recognized by my Linux machine using just the programming port. I can get the data to arrive the first time but not the second time, just like the other Arduino types.

1 Like

What does dmesg say when things don't work? Did you try a different USB port and a different cable?

When things stop working the dmesg output doesn't change. And yes I've tried many different cables. And since I've tried many different Arduinos that means I've also tried many USB types (mim-USB, micro-USB, and USB type B).

lsusb and ls /dev/tty* will also show the same devices whether or not the serial connection is actually working.