3 Replies Latest reply on Sep 23, 2020 10:56 PM by AashitaR_11

    PSOC6, USB, Composite Device, 2 CDC, how do you enumerate the second CDC?

    JeDu_4756451

      Building on the USB_CDC_Echo example, utilizing the Device Configurator 2.1 (new configuration), added a second CDC.  lsusb reported:

      Bus 001 Device 012: ID 04b4:f21d Cypress Semiconductor Corp.

      Device Descriptor:

        bLength                18

        bDescriptorType         1

        bcdUSB               2.00

        bDeviceClass            2 Communications

        bDeviceSubClass         0

        bDeviceProtocol         0

        bMaxPacketSize0         8

        idVendor           0x04b4 Cypress Semiconductor Corp.

        idProduct          0xf21d

        bcdDevice            0.00

        iManufacturer           1 Cypress Semiconductor

        iProduct                2 CDC Code Example

        iSerial                 3 DE516920A163FBDE

        bNumConfigurations      1

        Configuration Descriptor:

          bLength                 9

          bDescriptorType         2

          wTotalLength          125

          bNumInterfaces          4

          bConfigurationValue     1

          iConfiguration          0

          bmAttributes         0x80

            (Bus Powered)

          MaxPower               50mA

          Interface Descriptor:

            bLength                 9

            bDescriptorType         4

            bInterfaceNumber        0

            bAlternateSetting       0

            bNumEndpoints           1

            bInterfaceClass         2 Communications

            bInterfaceSubClass      2 Abstract (modem)

            bInterfaceProtocol      1 AT-commands (v.25ter)

            iInterface              4 CDC Communication Interface 1

            CDC Header:

              bcdCDC               1.10

            CDC ACM:

              bmCapabilities       0x02

                line coding and serial state

            CDC Union:

              bMasterInterface        0

              bSlaveInterface         1

            CDC Call Management:

              bmCapabilities       0x00

              bDataInterface          1

            Endpoint Descriptor:

              bLength                 7

              bDescriptorType         5

              bEndpointAddress     0x81  EP 1 IN

              bmAttributes            3

                Transfer Type            Interrupt

                Synch Type               None

                Usage Type               Data

              wMaxPacketSize     0x0008  1x 8 bytes

              bInterval              10

          Interface Descriptor:

            bLength                 9

            bDescriptorType         4

            bInterfaceNumber        1

            bAlternateSetting       0

            bNumEndpoints           2

            bInterfaceClass        10 CDC Data

            bInterfaceSubClass      0 Unused

            bInterfaceProtocol      0

            iInterface              5 CDC Data Interface 1

            Endpoint Descriptor:

              bLength                 7

              bDescriptorType         5

              bEndpointAddress     0x82  EP 2 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     0x03  EP 3 OUT

              bmAttributes            2

                Transfer Type            Bulk

                Synch Type               None

                Usage Type               Data

              wMaxPacketSize     0x0040  1x 64 bytes

              bInterval               0

          Interface Descriptor:

            bLength                 9

            bDescriptorType         4

            bInterfaceNumber        2

            bAlternateSetting       0

            bNumEndpoints           1

            bInterfaceClass         2 Communications

            bInterfaceSubClass      2 Abstract (modem)

            bInterfaceProtocol      1 AT-commands (v.25ter)

            iInterface              6 CDC Communication Interface 2

            CDC Header:

              bcdCDC               1.10

            CDC ACM:

              bmCapabilities       0x02

                line coding and serial state

            CDC Union:

              bMasterInterface        0

              bSlaveInterface         1

            CDC Call Management:

              bmCapabilities       0x00

              bDataInterface          1

            Endpoint Descriptor:

              bLength                 7

              bDescriptorType         5

              bEndpointAddress     0x84  EP 4 IN

              bmAttributes            3

                Transfer Type            Interrupt

                Synch Type               None

                Usage Type               Data

              wMaxPacketSize     0x0008  1x 8 bytes

              bInterval              10

          Interface Descriptor:

            bLength                 9

            bDescriptorType         4

            bInterfaceNumber        3

            bAlternateSetting       0

            bNumEndpoints           2

            bInterfaceClass        10 CDC Data

            bInterfaceSubClass      0 Unused

            bInterfaceProtocol      0

            iInterface              7 CDC Data Interface 2

            Endpoint Descriptor:

              bLength                 7

              bDescriptorType         5

              bEndpointAddress     0x85  EP 5 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     0x06  EP 6 OUT

              bmAttributes            2

                Transfer Type            Bulk

                Synch Type               None

                Usage Type               Data

              wMaxPacketSize     0x0040  1x 64 bytes

              bInterval               0

      Device Status:     0x0000

        (Bus Powered)

       

      which shows the second CDC is present, however,

       

      /dev/serial/by-id$ ll

      total 0

      drwxr-xr-x 2 root root 80 Aug 24 20:01 ./

      drwxr-xr-x 4 root root 80 Aug 24 09:23 ../

      lrwxrwxrwx 1 root root 13 Aug 24 20:01 usb-Cypress_Semiconductor_CDC_Code_Example_DE516920A163FBDE-if00 -> ../../ttyACM1

      lrwxrwxrwx 1 root root 13 Aug 24 09:23 usb-Cypress_Semiconductor_KitProg3_CMSIS-DAP_1A1717D900078400-if02 -> ../../ttyACM0

       

      is only showing one CDC interface.  How do I get the second CDC interface to be exposed?

        • 1. Re: PSOC6, USB, Composite Device, 2 CDC, how do you enumerate the second CDC?
          AashitaR_11

          Hi JeDu_4756451,

           

          I tried to re-produce the issue on my end. Can you please tell if you want to use 1 Two_COM_ports or 2 Single_COM_ports  ? As per your application, you can add .cdc file by following -> Launch USB Configurator -> CDC Descriptor Tab -> Green drop down arrow -> USBUART Single COM port / USBUART two COM ports. You can read more about this feature in the USBFS component datasheet. I have attached an image below to show this.

           

          Also, Can you please check for the below queries. It will help us understand the issue properly.

          1. Can you see the two COM ports  (interfaces)  in the device manager and they do not enumerate properly? OR

          2. Do you not at all see the two COM ports in the device manager?

           

          I have used  interface association descriptor in my project for the two CDC composite class devices.You can find information about this here: Implementing USB Composite Device with PSoC 3, PSoC 4L, or PSoC 5LP - KBA223141 . I have added four interfaces, two interfaces - control and data , each under two different interface association descriptor. Thus, two COM ports were recognized and enumerated properly.  I have attached my project for your reference. Please go through it.

           

          Also, I can see, from your given device descriptor. bDataInterface attribute has been set to 1 in the Call management for both the interface descriptors. Can you please try changing it to the corresponding data interface descriptor, it is associated with ? As an example you can look for this in the device descriptor of the attached project. I have changed the bDataInterface for the CDC_Interface_3 to 3 as it controls the data transfer through the endpoints under CDC_interface_4 which has bInterfaceNumber set to 3 in the Data Alternate Settings 0.

           

          Best Regards,

          Aashita

          • 2. Re: PSOC6, USB, Composite Device, 2 CDC, how do you enumerate the second CDC?
            JeDu_4756451

            Dear Aashita,

            Thank you for responding so fast.  I am using ModusToolbox which has a different interface.  The Green Down Arrow was a definite help though, but I had to delete the current configuration then click the down arrow.  I now see all devices in Linux as separate com ports.  Is there some documentation targeting ModusToolbox that I could reference?  Now I am attempting to created a blank project from scratch and a lot of the options for USB or the USB Device Middleware do not seem to be present in the project.  Long term I am looking at a dual CDC device with two ports and both cores operating.   

            Thanks

            Jeff    On Thursday, August 27, 2020, 05:47:47 AM EDT, AashitaR_11 <community-manager@cypress.com> wrote: 

             

              #yiv2371581118 * #yiv2371581118 a #yiv2371581118 body {font-family:Helvetica, Arial, sans-serif;}#yiv2371581118 #yiv2371581118 h1, #yiv2371581118 h2, #yiv2371581118 h3, #yiv2371581118 h4, #yiv2371581118 h5, #yiv2371581118 h6, #yiv2371581118 p, #yiv2371581118 hr {}#yiv2371581118 .yiv2371581118button td {}

            |

             

              Cypress Developer Community 

             

             

             

            |

            PSOC6, USB, Composite Device, 2 CDC, how do you enumerate the second CDC?

             

            reply from AashitaR_11 in ModusToolbox - View the full discussion

             

            Hi JeDu_4756451,

             

             

             

            I tried to re-produce the issue on my end. Can you please tell if you want to use 1 Two_COM_ports or 2 Single_COM_ports  ? As per your application, you can add .cdc file by following -> Launch USB Configurator -> CDC Descriptor Tab -> Green drop down arrow -> USBUART Single COM port / USBUART two COM ports. You can read more about this feature in the USBFS component datasheet.  I have attached an image below to show this.

             

             

             

            https://community.cypress.com/servlet/JiveServlet/downloadImage/2-248206-530513/pastedImage_3.png

             

            Also, Can you please check for the below queries. It will help us understand the issue properly.

             

            1. Can you see the two COM ports  (interfaces)  in the device manager and they do not enumerate properly? OR

             

            2. Do you not at all see the two COM ports in the device manager?

             

             

             

            I have used  interface association descriptor in my project for the two CDC composite class devices.You can find information about this here: Implementing USB Composite Device with PSoC 3, PSoC 4L, or PSoC 5LP - KBA223141 . I have added four interfaces, two interfaces - control and data , each under two different interface association descriptor. Thus, two COM ports were recognized and enumerated properly.  I have attached my project for your reference. Please go through it.

             

             

             

            Also, I can see, from your given device descriptor. bDataInterface attribute has been set to 1 in the Call management for both the interface descriptors. Can you please try changing it to the corresponding data interface descriptor, it is associated with ? As an example you can look for this in the device descriptor of the attached project. I have changed the bDataInterface for the CDC_Interface_3 to 3 as it controls the data transfer through the endpoints under CDC_interface_4 which has bInterfaceNumber set to 3 in the Data Alternate Settings 0.

             

             

             

            Best Regards,

             

            Aashita

             

             

             

             

             

            https://community.cypress.com/docs/DOC-14685

             

            Reply to this message by replying to this email, or go to the message on Cypress Developer Community

            Start a new discussion in ModusToolbox by email or at Cypress Developer Community

            Following PSOC6, USB, Composite Device, 2 CDC, how do you enumerate the second CDC? in these streams: Inbox

             

             

            This email was sent by Cypress Developer Community because you are a registered user.

            You may unsubscribe instantly from Cypress Developer Community, or adjust email frequency in your email preferences

               

             

             

             

            • 3. Re: PSOC6, USB, Composite Device, 2 CDC, how do you enumerate the second CDC?
              AashitaR_11

              Hi JeDu_4756451,

               

              Apologies for the late response. ModusToolbox has exactly the same implementation (green arrow) which can be used to import descriptors for two COM ports in the USB configurator, as can be seen in the image below-

              Also, You can refer the USBFS middleware documentation. The link for the same has been provided here : Cypress USB Device Middleware Library 2.0: Cypress USB Device Middleware Library 2.0 . Please let us know if this meets your expectations or in case of further queries.

               

              Best Regards,

              Aashita