Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

USB low-full-high speed peripherals

hpalacio
Level 2
First like received First solution authored 5 replies posted
Level 2

Hello,

We are using the CY7C65211 bridge on a device that connect to a Linux (Kubutu 18.04) machine. The Linux PC, instead of adding a serial port (/dev/ttyXXX) is listing the device as a Thermometer:

Bus 001 Device 057: ID 04b4:0002 Cypress Semiconductor Corp. CY7C63x0x Thermometer

I downloaded CP210x_SDK from the website and install it, but the serial port appears nowhere.

In a Windows PC, the serial port works out-of-the-box, but I can't seem to make it work in Linux (no /dev/ttyUSBx or /dev/ttyACMx, or anything).

What am I missing?

Thank you so much!

Héctor

0 Likes
1 Solution
hpalacio
Level 2
First like received First solution authored 5 replies posted
Level 2

Hi @Meghavi 

My apologies, I had a typo on the string. I changed the PID to 00FB and clicked on Program.

Now Linux created a new node /dev/ttyACM0 and the serial console port works fine. To double check, I went backwards and reprogrammed the original PID 0002, and still the console port was detected and worked. I may have missed the node in the past but it looks like the PID change is not needed.

To summarize, in order to make this work as a serial port in Linux I needed to do:

  • add the /etc/udev/rules.d/90-cyusb.rules
    # Cypress USB driver for FX2 and FX3 (C) Cypress Semiconductor Corporation / ATR-LABS 
    # Rules written by V. Radhakrishnan ( rk@atr-labs.com )
    # Cypress USB vendor ID = 0x04b4
    KERNEL=="*", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", ATTR{idVendor}=="04b4", MODE="666"
    KERNEL=="*", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="remove", TAG=="cyusb_dev"​
  • Black list the cytherm driver module in /etc/modprobe/blacklist.conf
    blacklist cytherm​
  • rmmod the cytherm driver in case it was already loaded

A bit cumbersome for something that I expected to work out-of-the-box, honestly.

Thanks for all the help.

View solution in original post

10 Replies
hpalacio
Level 2
First like received First solution authored 5 replies posted
Level 2

Yes, I did download Infineon-CyUSBSerial_SDK_Linux-DevelopmentTools-v01_00-EN.zip, built it and installed it, restarted udev rules and everything, but the device lists itself as a Thermometer and it doesn't generate a new serial port device.

0 Likes
Meghavi
Moderator
Moderator 10 likes received First like given 250 sign-ins
Moderator

Hi,

The main cause of the issue is due to the Linux kernel you are using has a built-in HID Driver called Cytherm - Cypress USB thermometer driver in kernel. So whenever you connect a device, instead of binding to CDC ACM driver, it comes up as HID device binding to the Cytherm driver. 

There are 2 workarounds:

1) Try removing the Cytherm driver from the linux kernel using rmmod cytherm command in the terminal.

2) Change the VID and PID of the USB-Serial device when using in Linux.

Regards,

Meghavi

0 Likes
hpalacio
Level 2
First like received First solution authored 5 replies posted
Level 2

1) Try removing the Cytherm driver from the linux kernel using rmmod cytherm command in the terminal.

Even if I remove the module and blacklist it so that it never loads automatically, the kernel doesn't detect the chip as a serial port.

 


2) Change the VID and PID of the USB-Serial device when using in Linux.

Do you mean to configure the chip to report different VID/PID? How do I configure the chip for that and to what values? I expect Cypress to provide a serial driver that matches the VID/PID reported by default by the chip.

Thanks

Héctor

 

0 Likes
Meghavi
Moderator
Moderator 10 likes received First like given 250 sign-ins
Moderator

Hi Hector,

Can you please let us know after removing/blacklisting the Cytherm driver how does the device enumerate? 

Regards,

Meghavi

0 Likes
hpalacio
Level 2
First like received First solution authored 5 replies posted
Level 2

Hi Meghavi,

The device enumerates just the same. The fact that the kernel doesn't load a module driver to handle it doesn't change how it enumerates:

 

$ lsusb
Bus 001 Device 010: ID 04b4:0002 Cypress Semiconductor Corp. CY7C63x0x Thermometer

 

 

If I list the full USB tree, it shows this tree for the device (connected through a hub)

 

$ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M
    |__ ...
    |__ Port 10: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 4: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 3: Dev 10, If 1, Class=CDC Data, Driver=ftdi_sio, 12M
            |__ Port 3: Dev 10, If 2, Class=Vendor Specific Class, Driver=ftdi_sio, 12M
            |__ Port 3: Dev 10, If 0, Class=Communications, Driver=ftdi_sio, 12M

 

 

No  /dev/ttyUSBx ports are created.

I tried creating a udev rule I found on the Internet, that goes:

ACTION=="add", ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="0002", RUN+="/sbin/modprobe ftdi_sio" RUN+="/bin/sh -c 'echo 04b4 0002 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'"

with this, I get three /dev/ttyUSBx entries.

In one of them, I can open a minicom and start to see data from the serial console, but many characters are missing and the port doesn't echo back what I type.

I wanted to use this chip for the serial console of my design, but I mainly need it to work in Linux, and this doesn't seem to work fine at all.

Héctor Palacios

0 Likes
Meghavi
Moderator
Moderator 10 likes received First like given 250 sign-ins
Moderator

Hi Hector,

Please try to change the PID of the USB-Serial (CY7C65211) device from the windows configuration utility and let us know if the issue still persists. 

Please find the instructions attached to this response for changing the PID.  

Regards,

Meghavi

0 Likes
hpalacio
Level 2
First like received First solution authored 5 replies posted
Level 2

Hi Meghavi,

The tool doesn't allow me to change the PID:

hpalacio_0-1655120584071.png

According to your doc, there should be a checkbox that's missing on my tool (version 2.0.3.120). I can uncheck "Use Cypress VID/PID" but then it would only allow me to change the VID, not the PID.

Héctor

0 Likes
Meghavi
Moderator
Moderator 10 likes received First like given 250 sign-ins
Moderator

Hi Hector,

Can you please confirm if you have added the string in the configuration utility shortcut and opened the utility using the same shortcut? If yes please share the snapshot. 

Regards,

Meghavi

0 Likes
hpalacio
Level 2
First like received First solution authored 5 replies posted
Level 2

Hi @Meghavi 

My apologies, I had a typo on the string. I changed the PID to 00FB and clicked on Program.

Now Linux created a new node /dev/ttyACM0 and the serial console port works fine. To double check, I went backwards and reprogrammed the original PID 0002, and still the console port was detected and worked. I may have missed the node in the past but it looks like the PID change is not needed.

To summarize, in order to make this work as a serial port in Linux I needed to do:

  • add the /etc/udev/rules.d/90-cyusb.rules
    # Cypress USB driver for FX2 and FX3 (C) Cypress Semiconductor Corporation / ATR-LABS 
    # Rules written by V. Radhakrishnan ( rk@atr-labs.com )
    # Cypress USB vendor ID = 0x04b4
    KERNEL=="*", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", ATTR{idVendor}=="04b4", MODE="666"
    KERNEL=="*", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="remove", TAG=="cyusb_dev"​
  • Black list the cytherm driver module in /etc/modprobe/blacklist.conf
    blacklist cytherm​
  • rmmod the cytherm driver in case it was already loaded

A bit cumbersome for something that I expected to work out-of-the-box, honestly.

Thanks for all the help.