Teensy USB-UART - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: December 08, 2014, 01:58:48 pm
content: hi guysi am toying with a 128x128x8bit CCD sensor and i need a fast usb device in order to upload data into my linux box.i have chosen the teensy v2 device, used as described inthispageto summarize the device looks like an arduino board but it is much more powerful and it has a built-in USB-device, so it is possible to use it to move up to 900Kbyte/sec to the linux host.the teensy documentation tells to use the following udev rule without specifying which kernel-module has to been usedCode:# UDEV Rules for Teensy boards, http://www.pjrc.com/teensy/## The latest version of this file may be found at:# http://www.pjrc.com/teensy/49-teensy.rules## This file must be placed at:## /etc/udev/rules.d/49-teensy.rules (preferred location)# or# /lib/udev/rules.d/49-teensy.rules (req'd on some broken systems)## To install, type this command in a terminal:# sudo cp 49-teensy.rules /etc/udev/rules.d/49-teensy.rules## After this file is installed, physically unplug and reconnect Teensy.#ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04?", ENV{ID_MM_DEVICE_IGNORE}="1"ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04?", ENV{MTP_NO_PROBE}="1"SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04?", MODE:="0666"KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04?", MODE:="0666"## If you share your linux system with other users, or just don't like the# idea of write permission for everybody, you can replace MODE:="0666" with# OWNER:="yourusername" to create the device owned by you, or with# GROUP:="somegroupname" and mange access using standard unix groups.### If using USB Serial you get a new device each time (Ubuntu 9.10)# eg: /dev/ttyACM0, ttyACM1, ttyACM2, ttyACM3, ttyACM4, etc# apt-get remove --purge modemmanager (reboot may be necessary)## Older modem proding (eg, Ubuntu 9.04) caused very slow serial device detection.# To fix, add this near top of /lib/udev/rules.d/77-nm-probe-modem-capabilities.rules# SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04?", GOTO="nm_modem_probe_end"#i have programed my teensy as a serial USB device with the "USB-serial" example.when i connect to my embedded Linux box i do not get any device to communicate with.the /dev does not get any new devices when i connect the teensy.Code:# lsusbBus 004 Device 009: ID 16c0:047a Van Ooijen Technische Informatica Teensy Serialthis is the kernel dmesg event log when i plug the teensy with a preloaded USB-UART sketchCode:hub 4-0:1.0: port 2, status 0101, change 0001, 12 Mb/shub 4-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101usb 4-2: new full speed USB device number 9 using uhci_hcdusb 4-2: ep0 maxpacket = 16usb 4-2: skipped 4 descriptors after interfaceusb 4-2: default language 0x0409usb 4-2: udev 9, busnum 4, minor = 392usb 4-2: New USB device found, idVendor=16c0, idProduct=047ausb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3usb 4-2: Product: USB Serialusb 4-2: Manufacturer: Your Nameusb 4-2: SerialNumber: 12345usb 4-2: usb_probe_deviceusb 4-2: configuration #1 chosen from 1 choiceusb 4-2: adding 4-2:1.0 (config #1, interface 0)usbserial_generic 4-2:1.0: usb_probe_interfaceusbserial_generic 4-2:1.0: usb_probe_interface - got idusb 4-2: adding 4-2:1.1 (config #1, interface 1)usbserial_generic 4-2:1.1: usb_probe_interfaceusbserial_generic 4-2:1.1: usb_probe_interface - got iddrivers/usb/core/inode.c: creating file '009'hub 4-0:1.0: state 7 ports 2 chg 0000 evt 0004any help is appreciated, thank you

author: legacy
author_rank: Super Contributor
timestamp: December 08, 2014, 02:35:28 pm
content: it may be the kernel driver is "USB Modem (CDC ACM) support"i am adding it to the config and compiling the module …Code:CC  drivers/usb/class/cdc-acm.o

author: legacy
author_rank: Super Contributor
timestamp: December 08, 2014, 02:48:26 pm
content: Code:dc_acm 4-2:1.0: usb_probe_interfacecdc_acm 4-2:1.0: usb_probe_interface - got idcdc_acm 4-2:1.0: This device cannot do calls on its own. It is not a modem.cdc_acm 4-2:1.0: ttyACM0: USB ACM deviceusbcore: registered new interface driver cdc_acmcdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapterskernel/drivers/usb/class/cdc-acm.ko modit seems to be recognized, now i need to create the static device node, mknode …… /dev/ttyACM0

author: legacy
author_rank: Super Contributor
timestamp: December 08, 2014, 07:14:55 pm
content: Code:mknod /dev/ttyACM0 c 166 0OK, it is workingi hope this may help

author: legacy
author_rank: Super Contributor
timestamp: December 16, 2014, 09:15:08 pm
content: interestingdifferencebetween dev/ttyusb and /dev/ttyacm

author: legacy
author_rank: Super Contributor
timestamp: December 17, 2014, 10:09:45 am
content: i am having issues with a second laptop running linuxi have plugged teensy v2, the kernel is seeing it and it as ttyACM0Code:usb 2-1: ep0 maxpacket = 32usb 2-1: skipped 4 descriptors after interfaceusb 2-1: default language 0x0409usb 2-1: udev 2, busnum 2, minor = 129usb 2-1: New USB device found, idVendor=16c0, idProduct=0483usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3usb 2-1: Product: USB Serialusb 2-1: Manufacturer: Teensyduinousb 2-1: SerialNumber: 12345usb 2-1: usb_probe_deviceusb 2-1: configuration #1 chosen from 1 choiceusb 2-1: adding 2-1:1.0 (config #1, interface 0)cdc_acm 2-1:1.0: usb_probe_interfacecdc_acm 2-1:1.0: usb_probe_interface - got idcdc_acm 2-1:1.0: This device cannot do calls on its own. It is not a modem.cdc_acm 2-1:1.0: ttyACM0: USB ACM deviceusb 2-1: adding 2-1:1.1 (config #1, interface 1)drivers/usb/core/inode.c: creating file '002'hub 2-0:1.0: state 7 ports 2 chg 0000 evt 0002usb usb3: suspend_rh (auto-stop)usb usb4: suspend_rh (auto-stop)systemd-udevd: starting version 204but when i try to run mini com i get no outputand the following dmesgCode:uhci_hcd 0000:00:1a.1: reserve dev 2 ep82-INT, period 64, phase 0, 17 usuhci_hcd 0000:00:1a.1: release dev 2 ep82-INT, period 64, phase 0, 17 usuhci_hcd 0000:00:1a.1: reserve dev 2 ep82-INT, period 64, phase 0, 17 usuhci_hcd 0000:00:1a.1: release dev 2 ep82-INT, period 64, phase 0, 17 uswhile unplugging this teensy module and plugging it into the first laptop i have used i got the teensy outputdifferences between the two laptopsworking onekernel 2.6.39gentooDELL laptopthe teensy USB is OHCI drivennot working onekenrel 3.1.8gentooIBM laptopthe teensy USB is UHCI driven

author: legacy
author_rank: Super Contributor
timestamp: December 17, 2014, 11:48:31 am
content: i have done two more tests1) bare bone piece of C code, compiled without any arduino library2) arduino code, compiled on Arduino v1.0.5 + teensy library (installed as described in their manual)the barebone firmware is working on both laptopsthe arduino code is not working on the second laptop but it is working on macOSXthere is something strange with thisany idea about what to investigate ?also, i will try to a MIPS SoC running embedded linux, which is the final target on where i need to plug this teensy device

author: legacy
author_rank: Super Contributor
timestamp: December 17, 2014, 04:17:39 pm
content: i have compiled an ACM kernel module for my MIPS SoC, uploaded to the board, and attached a teensy device in order to test the kernel driverCode:# insmod cdc-acm.kocdc_acm 1-1.3:1.0: ttyACM0: USB ACM deviceusbcore: registered new interface driver cdc_acmcdc_acm: USB Abstract Control Model driver for USB# mknod /dev/ttyACM0 c 166 0# fempto-uart-terminal /dev/ttyACM0 -b 115200 -p n -s 1 -d 8 -f n -e nmeta=CTRL+Tlidar_controller_v1.2/Rev1data readyso it is workingbut it is working everywhere except on UHCI machines like my IBM laptops (1)(1) tested onIBM ThinkPad T23, UHCI: not workingIBM ThinkPad X61S, UHCI: not working