USB serial (CDC ACM) device requires RTS negated

848 views Asked by At

I am using a USB Serial (CDC ACM) device (an Astrosys GBA ST2 Bill Validator), but the device won't answer requests unless the RTS signal is negated.

On Windows, usbser drivers will configure the device by sending SetControlLineState and Get/SetLineCoding USB control requests until a SetSerial notification is received on the Interrupt endpoint. In other words, it will generate RTS/DTS signals (via SetControlLineState) until the device generate a notification (in our case, when RTS line is negated). It is then attached to a COM port and does not need further configuration.

On Linux with cdc-acm driver attach the device to /dev/ttyACMn, but it is required to explicitly negate the RTS line before making requests.

Generally, the device won't answer any request unless the RTS signal is negated, which may be done via USB control requests or using a serial library.

Note: by "negating RTS line" I mean setting RTS to 0 or False such as port.rts=0 with pySerial

I understand that a USB Virtual Serial port does not have to implement the full RS-232 specifications and answer every signals, but I don't see why RTS signal needs to be negated for the device to answer requests? Is it expected for a Serial CDC ACM USB device? Or is it a vendor specific feature?

Here is the full device descriptor:

Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x16f9
  idProduct          0x0003
  bcdDevice           14.06
  iManufacturer           1 Astrosystems
  iProduct                2 GBA ST2
  iSerial                 3 06010010001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           62
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower              100mA
    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 GBA USB Serial Port
      CDC Header:
        bcdCDC               1.20
      CDC ACM:
        bmCapabilities       0x02
          line coding and serial state
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              50
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              4 GBA USB Serial Port
      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     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0001
  Self Powered
0

There are 0 answers