1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Support for usb-serial adapter based on cp210x

Discussion in 'Asuswrt-Merlin' started by mad_ady, Mar 18, 2019.

  1. mad_ady

    mad_ady Regular Contributor

    Joined:
    Nov 14, 2015
    Messages:
    80
    Hello all!
    I was planning to use my RT-AC56U as a serial debug bridge for an Odroid board which is close by. I hooked up a USB cp210x adapter into its USB port, but it seems that support for it was not included in the kernel:

    Code:
    $ lsusb
    Bus 003 Device 116: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
    
    Code:
    usb 3-1: new full speed USB device using ohci_hcd and address 2
    usbcore: registered new interface driver usbserial
    USB Serial support registered for generic
    usbcore: registered new interface driver usbserial_generic
    usbserial: USB Serial Driver core
    option: `0x10c4 product=0xea60' invalid for parameter `vendor'
    [email protected]:/tmp/home/root# find  /lib/modules/2.6.36.4brcmarm/kernel/ -name
    'cp210x.ko'
    
    Since I noticed that AC56U is getting discontinued in newer releases, I'd like to ask to be pointed in the direction of the following information:
    1. Are there packages with extra modules that can be downloaded directly?
    2. Are there instructions on how to compile the kernel/extra modules? I plan on getting only the cp210x module and insmodding it myself, without replacing the kernel. I'm guessing the kernel only changes rarely, since it's 2.6.x

    Thanks!
     
  2. mad_ady

    mad_ady Regular Contributor

    Joined:
    Nov 14, 2015
    Messages:
    80
  3. mad_ady

    mad_ady Regular Contributor

    Joined:
    Nov 14, 2015
    Messages:
    80
    Ok, so I followed the guide above in a Ubuntu 12.04 lxc, combined with info from https://hqt.ro/how-to-compile-modules-for-asuswrt-routers/.
    I went to /home/ubuntu/asuswrt-merlin.ng/release/src-rt-6.x.4708/linux/linux-2.6 and ran 'make menuconfig', selected CONFIG_USB_SERIAL_CP210X=m followed by 'make linux', 'make modules', etc.
    It compiled most of the modules without dying, but for cp210x it didn't create a ko file:
    Code:
    [email protected]:/home/ubuntu/asuswrt-merlin.ng/release/src-rt-6.x.4708/linux/linux-2.6# grep -i cp210 .config
    CONFIG_USB_SERIAL_CP210X=m
    [email protected]:/home/ubuntu/asuswrt-merlin.ng/release/src-rt-6.x.4708/linux/linux-2.6# make drivers/usb/serial
    make: Nothing to be done for `drivers/usb/serial'.
    [email protected]:/home/ubuntu/asuswrt-merlin.ng/release/src-rt-6.x.4708/linux/linux-2.6# ls -l drivers/usb/serial/*.ko
    -rw-r--r-- 1 root root 218294 Mar 20 09:27 drivers/usb/serial/option.ko
    -rw-r--r-- 1 root root 153168 Mar 20 09:27 drivers/usb/serial/usb_wwan.ko
    -rw-r--r-- 1 root root 447044 Mar 20 09:27 drivers/usb/serial/usbserial.ko
    [email protected]:/home/ubuntu/asuswrt-merlin.ng/release/src-rt-6.x.4708/linux/linux-2.6# ls -l drivers/usb/serial/cp210x.*
    -rw-r--r-- 1 root root  25671 Mar 19 17:33 drivers/usb/serial/cp210x.c
    -rw-r--r-- 1 root root 129512 Mar 20 09:46 drivers/usb/serial/cp210x.o
    
    How do I turn a .o file into a .ko?
     
  4. mad_ady

    mad_ady Regular Contributor

    Joined:
    Nov 14, 2015
    Messages:
    80
    ... must be something wrong with my setup/environment because kernel make fails/make modules as well:
    Code:
      CC [M]  drivers/usb/core/notify.o
      CC [M]  drivers/usb/core/generic.o
      CC [M]  drivers/usb/core/quirks.o
      CC [M]  drivers/usb/core/devices.o
      CC [M]  drivers/usb/core/hcd-pci.o
      CC [M]  drivers/usb/core/inode.o
      LD [M]  drivers/usb/core/usbcore.o
      CC [M]  drivers/usb/host/ehci-hcd.o
    In file included from drivers/usb/host/ehci-hcd.c:1158:0:
    drivers/usb/host/ehci-pci.c:438:22: fatal error: bcmutils.h: No such file or directory
    compilation terminated.
    make[3]: *** [drivers/usb/host/ehci-hcd.o] Error 1
    make[2]: *** [drivers/usb/host] Error 2
    make[1]: *** [drivers/usb] Error 2
    make: *** [drivers] Error 2
    [email protected]:/home/ubuntu/asuswrt-merlin.ng/release/src-rt-6.x.4708/linux/linux-2.6# make kernel
      CHK     include/linux/version.h
      CHK     include/generated/utsrelease.h
    make[1]: `include/generated/mach-types.h' is up to date.
      CALL    scripts/checksyscalls.sh
      CC      kernel/sched.o
      CC      kernel/fork.o
      CC      kernel/exec_domain.o
      CC      kernel/panic.o
      CC      kernel/printk.o
      CC      kernel/cpu.o
      CC      kernel/exit.o
      CC      kernel/itimer.o
      TIMEC   kernel/timeconst.h
      CC      kernel/time.o
      CC      kernel/softirq.o
    kernel/softirq.c:38:22: fatal error: typedefs.h: No such file or directory
    compilation terminated.
    make[1]: *** [kernel/softirq.o] Error 1
    make: *** [kernel] Error 2