Raspberry Pi Pico doesn't create tty file - tty

I've been using Raspberry Pi Pico for some time already and I'm using minicom for serial communication. But one day Pico stopped generating tty/ATCM0 when connected to USB port. Before this everything worked perfectly fine.
I can still upload software and it's executing, but there's no serial communication because of it.
I've tried switching USB ports, uploading software that worked fine before and I even bought new Pico, as I suspected a hardware issue, but it still didn't help. My best guess is that there's something wrong with USB drivers, though I don't remember doing anything to them.
I've checked /dev for new tty files when connecting Pico, but nothing appears.
dmesg output after connecting Pico:
[ 2418.974093] usb 3-2: new full-speed USB device number 28 using xhci_hcd
[ 2434.570047] usb 3-2: device descriptor read/64, error -110 // <-- Warning
dmesg output after connecting in BOOTLOADER mode and uploading file
[ 2901.230259] usb 3-2: new full-speed USB device number 30 using xhci_hcd // <-- connected as BOOTLOADER
[ 2901.397715] usb 3-2: New USB device found, idVendor=2e8a, idProduct=0003, bcdDevice= 1.00
[ 2901.397726] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2901.397729] usb 3-2: Product: RP2 Boot
[ 2901.397732] usb 3-2: Manufacturer: Raspberry Pi
[ 2901.397735] usb 3-2: SerialNumber: E0C912D24340
[ 2901.399735] usb-storage 3-2:1.0: USB Mass Storage device detected
[ 2901.399885] scsi host2: usb-storage 3-2:1.0
[ 2902.412571] scsi 2:0:0:0: Direct-Access RPI RP2 1 PQ: 0 ANSI: 2
[ 2902.413038] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 2902.413315] sd 2:0:0:0: [sdb] 262144 512-byte logical blocks: (134 MB/128 MiB)
[ 2902.413731] sd 2:0:0:0: [sdb] Write Protect is off
[ 2902.413734] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 2902.415755] sd 2:0:0:0: [sdb] No Caching mode page found // <-- Warning
[ 2902.415761] sd 2:0:0:0: [sdb] Assuming drive cache: write through // <-- Warning
[ 2902.424350] sdb: sdb1
[ 2902.427764] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ 2907.724687] usb 3-2: USB disconnect, device number 30 // <-- uploaded uf2 file
[ 2907.725456] blk_update_request: I/O error, dev sdb, sector 260 op 0x1:(WRITE) flags 0x100000 phys_seg 1 prio class 0 // <-- Warning
[ 2907.725471] Buffer I/O error on dev sdb1, logical block 259, lost async page write // <-- Warning
[ 2907.733492] FAT-fs (sdb1): unable to read boot sector to mark fs as dirty // <-- Warning
[ 2908.102068] usb 3-2: new full-speed USB device number 31 using xhci_hcd
[ 2923.530076] usb 3-2: device descriptor read/64, error -110 // <-- Warning
lsusb -tv lists these two entries only when Pico is in BOOTLOADER mode:
...
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 2: Dev 35, If 0, Class=Mass Storage, Driver=usb-storage, 12M
ID 2e8a:0003
|__ Port 2: Dev 35, If 1, Class=Vendor Specific Class, Driver=, 12M
ID 2e8a:0003
...

Related

Adalm Pluto works on Ubuntu but NOT on Ubuntu Server 20.04 LTS

I'm running ubuntu server and have tried installing libiio packages from both source and apt-get repositories. I can detect the adalm pluto sdr device with iio_info -s (as root because I have not installed the udev rules) but it does not assume an ip address (e.g. 192.168.2.1) like it does on ubuntu 20.04 LTS.
>iio_info -s
Library version: 0.19 (git tag: v0.19)
Compiled with backends: local xml ip usb serial
Available contexts:
0: 0456:b673 (Analog Devices Inc. PlutoSDR (ADALM-PLUTO)), serial=104473b04a060006ffff1c00dd1f8473f8 [usb:3.2.5]
I've followed the instructions here: https://wiki.analog.com/university/tools/pluto/drivers/linux
The output of dmesg when the pluto is plugged in is this:
[380299.366375] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[380299.520117] usb 3-1: New USB device found, idVendor=0456, idProduct=b673, bcdDevice= 4.19
[380299.520120] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[380299.520122] usb 3-1: Product: PlutoSDR (ADALM-PLUTO)
[380299.520123] usb 3-1: Manufacturer: Analog Devices Inc.
[380299.520124] usb 3-1: SerialNumber: 104473b04a060006ffff1c00dd1f8473f8
[380299.553556] usb-storage 3-1:1.2: USB Mass Storage device detected
[380299.555040] scsi host4: usb-storage 3-1:1.2
[380299.555206] usbcore: registered new interface driver usb-storage
[380299.555732] cdc_acm 3-1:1.3: ttyACM0: USB ACM device
[380299.558342] usbcore: registered new interface driver cdc_acm
[380299.558344] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[380299.560691] usbcore: registered new interface driver uas
[380299.569781] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[380299.570205] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[380299.574968] usbcore: registered new interface driver cdc_ether
[380299.578953] rndis_host 3-1:1.0 eth0: register 'rndis_host' at usb-0000:00:14.0-1, RNDIS device, 00:e0:22:81:0c:b6
[380299.579489] usbcore: registered new interface driver rndis_host
[380299.583238] usbcore: registered new interface driver rndis_wlan
[380299.595374] rndis_host 3-1:1.0 enx00e022810cb6: renamed from eth0
[380300.582838] scsi 4:0:0:0: Direct-Access Linux File-Stor Gadget 0419 PQ: 0 ANSI: 2
[380300.583349] sd 4:0:0:0: Attached scsi generic sg1 type 0
[380300.584030] sd 4:0:0:0: [sdb] 61441 512-byte logical blocks: (31.5 MB/30.0 MiB)
[380300.584266] sd 4:0:0:0: [sdb] Write Protect is off
[380300.584274] sd 4:0:0:0: [sdb] Mode Sense: 0f 00 00 00
[380300.584510] sd 4:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[380300.607978] sdb: sdb1
[380300.623364] sd 4:0:0:0: [sdb] Attached SCSI removable disk
This is not consistent with what the guide shows from analog devices' wiki.
I'm at a loss here as to what I'm doing wrong. The device shows up and I have the drivers and required kernel modules (I check with lsmod). Any ideas on what would make this work in ubuntu but not ubuntu server.

QCA9377 not coming up with ath10k

Device Model : Linksys WUSB6100M |
Kernel : 4.14.0-rc5-wt-ath+, 4.2 |
Backports version : 4.14-rc4, 4.14-rc5
Kernel Source : https://github.com/erstrom/linux-ath
Am trying to bringup the above specified USB card with ath10k driver. After reading the FW files am getting the following logs.
[ 6218.904243] usb 2-1.4: new high-speed USB device number 14 using ehci-pci
[ 6219.014440] usb 2-1.4: New USB device found, idVendor=13b1, idProduct=0042
[ 6219.014446] usb 2-1.4: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[ 6219.014450] usb 2-1.4: Product: USBWLAN
[ 6219.014454] usb 2-1.4: Manufacturer: Qualcomm Atheros
[ 6219.014457] usb 2-1.4: SerialNumber: 12345678
[ 6219.015314] usb 2-1.4: WARNING: ath10k USB support is incomplete, don't expect anything to work!
[ 6219.015672] usb 2-1.4: Direct firmware load for ath10k/pre-cal-usb-2-1.4.bin failed with error -2
[ 6219.015695] usb 2-1.4: Direct firmware load for ath10k/cal-usb-2-1.4.bin failed with error -2
[ 6219.016134] usb 2-1.4: qca9377 hw1.1 target 0x05020001 chip_id 0x00000000 sub 0000:0000
[ 6219.016138] usb 2-1.4: kconfig debug 1 debugfs 1 tracing 0 dfs 0 testmode 0
[ 6219.017441] usb 2-1.4: firmware ver WLAN.TF.1.0-00002-QCATFSWPZ-5 api 6 features ignore-otp crc32 c3e0d04f
[ 6219.055734] usb 2-1.4: board_file api 1 bmi_id N/A crc32 544289f7
[ 6221.308242] usb 2-1.4: Service connect timeout
[ 6221.308252] usb 2-1.4: Invalid resp message ID 0x1
[ 6221.308257] usb 2-1.4: failed to connect htt (-71)
[ 6221.412265] usb 2-1.4: could not init core (-71)
[ 6221.412358] usb 2-1.4: could not probe fw (-71)
If anyone experienced and fixed this issue please share the details.
Else if anyone aware of the driver and kernel version please suggest that.
Thanks ,
Vikas

Arduino to Ubuntu USB connection

I am having trouble getting an Ubuntu device to connect to an Arduino Uno. Before I begin talking about the device in question the Arduino is communicating correctly with my Windows pc, and also an Ubuntu VM on that PC.
The device in question is an nVidia Jetson TX2. The Arduino IDE is installed, and when run using sudo the only serial port available is /dev/ttyS0.
The following line is lsusb being run and it detecting the Arduino.
Bus 001 Device 008: ID 2341:0001 Arduino SA Uno (CDC ACM)
The following lines is the output from dmesg from the time that the Arduino is connected.
[ 6609.813385] usb 1-2.3: new full-speed USB device number 13 using xhci-tegra
[ 6609.923568] usb 1-2.3: New USB device found, idVendor=2341, idProduct=0001
[ 6609.930495] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 6609.938049] usb 1-2.3: Product: Arduino Uno
[ 6609.942268] usb 1-2.3: Manufacturer: Arduino (www.arduino.cc)
[ 6609.948065] usb 1-2.3: SerialNumber: 7563830333735121D160
[ 6609.953998] usb 1-2.3: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
And lastly the following is the output from ls -a /dev/tty*
/dev/tty /dev/tty18 /dev/tty28 /dev/tty38 /dev/tty48 /dev/tty58 /dev/ttyS1
/dev/tty0 /dev/tty19 /dev/tty29 /dev/tty39 /dev/tty49 /dev/tty59 /dev/ttyS2
/dev/tty1 /dev/tty2 /dev/tty3 /dev/tty4 /dev/tty5 /dev/tty6 /dev/ttyS3
/dev/tty10 /dev/tty20 /dev/tty30 /dev/tty40 /dev/tty50 /dev/tty60 /dev/ttyTHS1
/dev/tty11 /dev/tty21 /dev/tty31 /dev/tty41 /dev/tty51 /dev/tty61 /dev/ttyTHS3
/dev/tty12 /dev/tty22 /dev/tty32 /dev/tty42 /dev/tty52 /dev/tty62
/dev/tty13 /dev/tty23 /dev/tty33 /dev/tty43 /dev/tty53 /dev/tty63
/dev/tty14 /dev/tty24 /dev/tty34 /dev/tty44 /dev/tty54 /dev/tty7
/dev/tty15 /dev/tty25 /dev/tty35 /dev/tty45 /dev/tty55 /dev/tty8
/dev/tty16 /dev/tty26 /dev/tty36 /dev/tty46 /dev/tty56 /dev/tty9
/dev/tty17 /dev/tty27 /dev/tty37 /dev/tty47 /dev/tty57 /dev/ttyS0
I don't believe that a driver is being called to create /dev/ttyACM0 but I am not sure how to solve this issue. Any help would be great! Let me know if I need to update with the output from any other commands.
You haven't posted what the error is but I'm guessing it is an access type error, have you done the part at the end of the install for linux?
At the end of https://www.arduino.cc/en/Guide/Linux there is section on permissions for the serial port.

GadgetFS on Allwinner H3 based linux board

I have the nanopi-neo which is an Allwinner H3 based linux board. It supports USB OTG mode so I wanted to try and convert it into slave by using GadgetFS.
From what I understand, I am supposed to rebuild the linux kernel provided by them with this option
<*> USB Gadget Drivers
<*> Gadget Filesystem
And for the rootfs use this
Package Selection for the target --->
Hardware handling --->
[*] gadgetfs-test
I then proceeded to build and boot the board.
I followed this guide and used these commands
root:/dev> mkdir /dev/gadget
root:/dev> mount -t gadgetfs gadgetfs /dev/gadget
[ 219.808688] WRN:L2558(drivers/usb/sunxi_usb/udc/sunxi_udc.c):ERR: Error in bind() : -120
[ 219.827939] nop sunxi_usb_udc: failed to start (null): -120
root:/dev> ls /dev/gadget/ -l
total 0
-rw------- 1 root root 0 Jan 1 00:03 sunxi_usb_udc
I am unable to find anything on this error. Most problems people face is regarding insmod but I have inbuilt the module inside the kernel. So I don't have this issue for sure.
I then found this post for sunxi i.e. allwinner sdk asking me to echo some values to otg_role, I did and i got this
echo 1 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role
[ 192.310934] sunxi-ehci sunxi-ehci.1: remove, state 4
[ 192.326666] usb usb1: USB disconnect, device number 1
[ 192.343775] sunxi-ehci sunxi-ehci.1: USB bus 1 deregistered
[ 192.370300] sunxi-ohci sunxi-ohci.1: remove, state 4
[ 192.385941] usb usb5: USB disconnect, device number 1
[ 192.402761] sunxi-ohci sunxi-ohci.1: USB bus 5 deregistered
[ 192.444442] sunxi-ehci sunxi-ehci.1: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 192.458113] sunxi-ehci sunxi-ehci.1: new USB bus registered, assigned bus number 1
[ 192.471720] sunxi-ehci sunxi-ehci.1: irq 104, io mem 0xf1c1a000
[ 192.500050] sunxi-ehci sunxi-ehci.1: USB 0.0 started, EHCI 1.00
[ 192.511581] hub 1-0:1.0: USB hub found
[ 192.519996] hub 1-0:1.0: 1 port detected
[ 192.548993] sunxi-ohci sunxi-ohci.1: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 192.561898] sunxi-ohci sunxi-ohci.1: new USB bus registered, assigned bus number 5
[ 192.574365] sunxi-ohci sunxi-ohci.1: irq 105, io mem 0xf1c1a400
[ 192.644522] hub 5-0:1.0: USB hub found
[ 192.652612] hub 5-0:1.0: 1 port detected
root#kyloren:/$ # echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role
[ 195.940888] sunxi-ehci sunxi-ehci.1: remove, state 4
[ 195.956330] usb usb1: USB disconnect, device number 1
[ 195.976521] sunxi-ehci sunxi-ehci.1: USB bus 1 deregistered
[ 195.997477] sunxi-ohci sunxi-ohci.1: remove, state 4
[ 196.007624] usb usb5: USB disconnect, device number 1
[ 196.018520] sunxi-ohci sunxi-ohci.1: USB bus 5 deregistered
And I try to mount again but I get the same error.
Can someone guide me on this?
Sometime much later ...
The short answer is you are missing the usermode component which actually instantiates the USB endpoints and handles setup and control requests.
An example of such a beast is to be found in 3 parts, links below.
The long version:
To use the H3 board as a device, you need to modprobe gadgetfs, create a directory mkdir -p /dev/gadget, and then mount the device into that directory with mount -t gadgetfs gadgetfs /dev/gadget.
Finally enable the device role with echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role.
You will need to add the following to the autoconfig() function in usb.c as that code way predates AllWinner's very existence.
Once the usermode app (usb) is built, simply run it as sudo usb -v for verbose mode. If you are correctly plugged and powered your device should now show up on the host with 2 bulk endpoints and a single interrupt EP.
If you are trying to use mainline you will need to change the name of the controller in the code below (found in /dev/gadget) and add the right spell to the DTS file. Good luck with that as I've yet to get 4.11 to work in device mode on my NanoPi M1 and NanoPi Neo Air boards.
Hope this very belated is of use to someone at some point!
if (stat(DEVNAME = "sunxi_usb_udc", &statb) == 0)
{
HIGHSPEED = 1;
fs_source_desc.bEndpointAddress = hs_source_desc.bEndpointAddress = USB_DIR_IN | 1;
EP_IN_NAME = "ep1in-bulk";
fs_sink_desc.bEndpointAddress = hs_sink_desc.bEndpointAddress = USB_DIR_OUT | 1;
EP_OUT_NAME = "ep1out-bulk";
source_sink_intf.bNumEndpoints = 3;
fs_status_desc.bEndpointAddress = hs_status_desc.bEndpointAddress = USB_DIR_IN | 2;
EP_STATUS_NAME = "ep2in-interrupt";
}
Main usermode driver
USB descriptor strings
Header file for the above

Raspberry Pi USB to serial - multiple ACM0 devices spawning

I am trying to get a Raspberry Pi running Octoprint (a kind of 3D print server) to talk to my Lulzbot Kittaz (RAMBo controller board, an Arduino Mega derivative), but something keeps creating bogus serial ports that seem to be getting in the way.
Here's what I know:
I try and connect over USB and here is the error message I get in the octoprint console:
Error: SerialException: 'device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Further googling has lead me to SSH in to the pi and run
dmesg | grep tty
and I get:
[ 6.117809] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 28.949094] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 35.389154] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 36.119582] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
... on and on
[ 146.219829] cdc_acm 1-1.4:1.0: ttyACM1: USB ACM device
[ 156.209130] cdc_acm 1-1.4:1.0: ttyACM1: USB ACM device
[ 166.450016] cdc_acm 1-1.4:1.0: ttyACM1: USB ACM device
[ 167.590072] cdc_acm 1-1.4:1.0: ttyACM1: USB ACM device
If I reboot the pi, without the printer connected, the output is:
[ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708.boardrev=0x10 bcm2708.serial=0x6024d696 smsc95xx.macaddr=B8:27:EB:24:D6:96 bcm2708_fb.fbswap=1 bcm2708.disk_led_gpio=47 bcm2708.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
[ 0.001437] console [tty1] enabled
[ 0.646366] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83, base_baud = 0) is a PL011 rev3
[ 1.033111] console [ttyAMA0] enabled
As soon as I connect the printer to the RasPi, ACM0 and sometimes ACM1 devices start spawning, with a new one appearing every 3-10 seconds. Which seems like that would be a problem for a USB to serial connection. I'm guessing this is the problem. Any ideas on what could be causing it?
Here's what I've done so far:
Disabled getty
Gotten the printer to work with another (lost) install of octopi in the same hardware
Re-installed octopi 3 times
Gotten the printer to connect to my Windows machine
Re-uploaded the firmware to the printer

Resources