USB Serial connection from CHIP to CNC device (large USB port)


#8

I’m not seeing you unplugging or plugging the device in on that dmesg.


#9

My BAD…

here it is:
[ 785.535000] usb 2-1: new full-speed USB device number 2 using ohci-platform


#10

If it’s not spitting out anything more than that it means there is no kernel-driver for the device. Maybe NTC hasn’t compiled the module? Paste the output of lsusb -v, maybe we can find out what module is missing.


#11

Bus 002 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Couldn’t open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0403 Future Technology Devices International, Ltd
idProduct 0x6001 FT232 USB-Serial (UART) IC
bcdDevice 6.00
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 90mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 2
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Couldn’t open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0001 1.1 root hub
bcdDevice 4.04
iManufacturer 3
iProduct 2
iSerial 1
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0002 1x 2 bytes
bInterval 255

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Couldn’t open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 4.04
iManufacturer 3
iProduct 2
iSerial 1
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Couldn’t open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 1 Single TT
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 4.04
iManufacturer 3
iProduct 2
iSerial 1
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12


#12

So, it’s just an FT232 USB-TTL. I do not have a CHIP, so I don’t know what modules NTC has compiled and which ones they have left out, but AFAIK FT232 should be handled by the module called ftdi_sio. find -iname "*ftdi*" /lib/modules/ should tell you if it exists or not.


#13

Doesn’t look like it :frowning:
Can I add it on my own?


#14

Well, that’s poop :confounded: NTC definitely shouldn’t leave out such common modules out of their OS-images, there’s just no good excuse for this :rage:

As for you: I’m sorry to say, but you’re either going to have to learn how to compile your own kernel for the CHIP or hope that someone else here would provide you with the needed files. If you’ve never compiled a kernel of your own…well, it’s quite a lot of work to learn.


#15

Well… There’s always a first time…

ftdi_sio is the name of the module…


#16

Yeah, the kernel configuration-option that you’re looking for is CONFIG_USB_SERIAL_FTDI_SIO

I wish you luck with learning how to compile the kernel on your own. It’s a good skill to have in the long run.


#17

Thanks… Il do my searching… Question… Can a Kernel be compiled on a MAC or does it has to be compiled on Linux?


#18

I have no idea. I don’t own any Apple-devices, so I’ve never had any reason to find out such things.


#19

Anyone has a simpler solution for this? I am really struggling to compile the kernel!


#20

If you flashed you chip using kernel 4.4.11-ntc (gui 4.4) you could try to import the usb serial modules

if you don’t want to recompile or change the kernel version.

First download the usbserial module. I did compile these modules from the original kernel source.

cd
wget https://dl.dropboxusercontent.com/u/48891705/chip/usbserial.tgz

install your usb serial and insert the modules

cd
sudo insmod usbserial.ko
sudo insmod ftdi_sio.ko

And now if you type dmesg
/dev/ttyUSB0 should appears at the end.

dmesg


[ 66.490000] usbcore: registered new interface driver usbserial
[ 105.020000] usbcore: registered new interface driver ftdi_sio
[ 105.020000] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 105.020000] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
[ 105.020000] usb 2-1: Detected FT232RL
[ 105.040000] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0

I also add some other usb to serial just in case.

If it works I could show you how to make it permanent.

Daniel


#21

THANKS!

It worked!..

How to make it permanent???

SAVED ME A TON OF TIME!

Can you also tell me the steps you took to compile the modules?


#22

Well if you want to compile it. you will need to follow these instructions from

http://www.raspibo.org/wiki/index.php/Compile_the_Linux_kernel_for_Chip:_my_personal_HOWTO

Please select the branch debian/4.4.11-ntc-1

If you are using linux it will simple. Just follow the instruction. A simple change if you are using debian like me. The cross compiler is arm-none-eabi for debian.

If you are using Windows then install a virtual machine with linux and use it! (debian or ubuntu).

Some hints that are not on the instruction.

  • Use ‘touch .scmversion’ to remove the + suffix.
  • Add a local version label. So you know it is your kernel.
  • To create de device tree use these commands

make ARCH=arm CROSS_COMPILE=/usr/bin/arm-none-eabi- INSTALL_DTBS_PATH=~/chip/lib dtbs
make ARCH=arm CROSS_COMPILE=/usr/bin/arm-none-eabi- INSTALL_DTBS_PATH=~/chip/lib dtbs_install

Please be free to change the compiler name and the DTBS path for your environment.

  • Don’t forget to import from the CHIP the config file and then make the change with menuconfig.

This way you won’t need to create my change permanent and it is the best way to configure a kernel.


#23

Thank you. Will try it tonight!


#24

I tried out your kernel modules (thanks!)
it reported “Unknown symbol in module”:

root@ngramradio:# uname -a
Linux ngramradio 4.4.11-ntc #1 SMP Sat May 28 00:27:07 UTC 2016 armv7l GNU/Linux

root@ngramradio:# file usb-serial-simple.ko 
usb-serial-simple.ko: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), BuildID[sha1]=972883bf2dc8eeaffdd8d2677335259adfd96677, not stripped

root@ngramradio:# for arg in *.ko; do insmod $arg; done
insmod: ERROR: could not insert module ch341.ko: Unknown symbol in module
insmod: ERROR: could not insert module cp210x.ko: Unknown symbol in module
insmod: ERROR: could not insert module ftdi_sio.ko: Unknown symbol in module
insmod: ERROR: could not insert module garmin_gps.ko: Unknown symbol in module
insmod: ERROR: could not insert module ir-usb.ko: Unknown symbol in module
insmod: ERROR: could not insert module keyspan_pda.ko: Unknown symbol in module
insmod: ERROR: could not insert module mos7720.ko: Unknown symbol in module
insmod: ERROR: could not insert module mos7840.ko: Unknown symbol in module
insmod: ERROR: could not insert module pl2303.ko: Unknown symbol in module
insmod: ERROR: could not insert module qcserial.ko: Unknown symbol in module

#25

You need to install usbserial first !

One thing is that you have to insert the modules into

/lib/modules/4.4.11-ntc/kernel/drivers/usb/serial

cd /lib/modules/4.4.11-ntc/kernel/drivers/usb
mkdir serial
cd serial
wget https://dl.dropboxusercontent.com/u/48891705/chip/usbserial.tgz
tar -xzf usbserial.tgz
depmod

Use modeprobe instead and don’t forget to execute depmod

And don’t install all the driver! they will install themself when needed.

B.T.W. The new kernel, 4.4.13-ntc-mlc ,already have all the usb serial.


#26

Cool, thank you. That’s great news about 4.4.13. modprobe did the trick, I was able to get it up and running at /dev/ttyUSB0. Whew!!


#27

Hi

I am having the same issue. I followed you instructions. The output of dmesg is

[ 767.245000] usbcore: registered new interface driver usbserial
[ 767.245000] usbcore: registered new interface driver usbserial_generic
[ 767.245000] usbserial: USB Serial support registered for generic
[ 777.720000] usbcore: registered new interface driver ftdi_sio
[ 777.720000] usbserial: USB Serial support registered for FTDI USB Serial Device

however, I still have no device I can see and

ls /dev/tty* | grep -i usb

shows nothing. Any suggestions?

Thx