<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックLPC5411X: Is a composite CDC configuration possible with the USB ROM API?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5411X-Is-a-composite-CDC-configuration-possible-with-the-USB/m-p/1757075#M54701</link>
    <description>&lt;P&gt;I'm trying to create a composite USB device with multiple CDCs. To do this, I'm merging in the LPCXPresso54114_dev_composite_cdc_vcom_cdc_vcom_bm example with the LPC54114 usbdrom_cdc example from the Keil Pack Installer. Both work separately.&lt;/P&gt;&lt;P&gt;The USB ROM API from Keil is far easier to work with. But I'm struggling to get it to work in a composite configuration. My software is throwing a&amp;nbsp;ERR_USBD_BAD_INTF_DESC code.&lt;/P&gt;&lt;P&gt;Here's my FS Configuration Descriptor code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;const uint16_t config_desc_data_length=(           /* wTotalLength */                              
    (1*USB_CONFIGUARTION_DESC_SIZE         )+      /* length of initial descriptor */
    (
        (1*USB_INTERFACE_ASSOCIATION_DESC_SIZE )+  /* interface association descriptor */
        (1*USB_INTERFACE_DESC_SIZE             )+  /* communication control interface*/
        (0x0013                                )+  /* CDC functions */
        (1*USB_ENDPOINT_DESC_SIZE              )+  /* interrupt endpoint */
        (1*USB_INTERFACE_DESC_SIZE             )+  /* communication interface */
        (2*USB_ENDPOINT_DESC_SIZE              )+  /* bulk endpoints */
        (0)
    ) * 2
)  ;

/**
 * USB FSConfiguration Descriptor
 * All Descriptors (Configuration, Interface, Endpoint, Class, Vendor)
 */
ALIGNED(4) uint8_t USB_FsConfigDescriptor[] = {
    /* Configuration 1 */
    USB_CONFIGUARTION_DESC_SIZE,                /* bLength: 9 */
    USB_CONFIGURATION_DESCRIPTOR_TYPE,          /* bDescriptorType */
    WBVAL(config_desc_data_length),
    0x04,                                       /* bNumInterfaces */
    0x01,                                       /* bConfigurationValue: 0x01 is used to select this configuration */
    0x00,                                       /* iConfiguration: no string to describe this configuration */
    USB_CONFIG_BUS_POWERED /*|*/                /* bmAttributes */
    /*USB_CONFIG_REMOTE_WAKEUP*/,
    USB_CONFIG_POWER_MA(100),                   /* bMaxPower, device power consumption is 100 mA */
    
    /* First Interface Pair */
    /* Interface association descriptor IAD */
    USB_INTERFACE_ASSOCIATION_DESC_SIZE,        /* bLength: 8 */
    USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE,  /* bDescriptorType */
    USB_CDC_CIF_NUM_1,                          /* bInterfaceNumber: Number of Interface: 0 */ /* The first interface number associated with this function */
    0x02,                                       /* The number of contiguous interfaces associated with this function */
    CDC_COMMUNICATION_INTERFACE_CLASS,          /* bInterfaceClass: Communication Interface Class */
    CDC_ABSTRACT_CONTROL_MODEL,                 /* bInterfaceSubClass: Abstract Control Model */
    0x00,                                       /* bInterfaceProtocol: no protocol used */
    0x04,                                       /* Function string descriptor index */
    
    /* 1st Communications Interface */
    /*Interface 0, Alternate Setting 0, CCI Descriptor*/
    USB_INTERFACE_DESC_SIZE,            /* bLength: 9 */
    USB_INTERFACE_DESCRIPTOR_TYPE,      /* bDescriptorType */
    USB_CDC_CIF_NUM_1,                  /* 0: interface number  */
    0x00,                               /* Alternate Setting */
    0x01,                               /* endpoint count */
    CDC_COMMUNICATION_INTERFACE_CLASS,  /* CCI class*/
    CDC_ABSTRACT_CONTROL_MODEL,         /* ACM */
    0x00,                               /* Protocol  */
    0x04,                               /* Interface */
    
    /*Header Functional Descriptor*/
    0x05,                               /* bLength: Endpoint Descriptor size: 5 */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_HEADER,                         /* bDescriptorSubtype: Header Func Desc */
    WBVAL(CDC_V1_10), /* 1.10 */        /* bcdCDC */
    
    /*Call Management Functional Descriptor*/
    0x05,                               /* bFunctionLength: 5 */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_CALL_MANAGEMENT,                /* bDescriptorSubtype: Call Management Func Desc */
    0x01,                               /* bmCapabilities: device handles call management */
    USB_CDC_DIF_NUM_1,                  /* 1: bDataInterface: CDC data IF ID */
    
    /*Abstract Control Management Functional Descriptor*/
    0x04,                               /* bFunctionLength: 4 */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_ABSTRACT_CONTROL_MANAGEMENT,    /* bDescriptorSubtype: Abstract Control Management desc */
    0x02,                               /* bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported */
    
    /*Union Functional Descriptor*/
    0x05,                               /* bFunctionLength: 5 */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_UNION,                          /* 6: bDescriptorSubtype: Union func desc */
    USB_CDC_CIF_NUM_1,                  /* bMasterInterface: Communication class interface is master */
    USB_CDC_DIF_NUM_1,                  /* bSlaveInterface0: Data class interface is slave 0 */
    
    /*Endpoint 1 Descriptor*/           /* event notification (optional) */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_IN(1),                 /* 0x82: bEndpointAddress */
    USB_ENDPOINT_TYPE_INTERRUPT,        /* bmAttributes */
    WBVAL(0x0010),                      /* wMaxPacketSize */
    0x08,          /* 8ms */            /* bInterval */
    
    /* 1st Data Interface */
    /* Interface 1, Alternate Setting 0, Data class interface descriptor*/
    USB_INTERFACE_DESC_SIZE,            /* bLength: 9 */
    USB_INTERFACE_DESCRIPTOR_TYPE,      /* bDescriptorType */
    USB_CDC_DIF_NUM_1,                  /* bInterfaceNumber: Number of Interface */
    0x00,                               /* bAlternateSetting: no alternate setting */
    0x02,                               /* bNumEndpoints: two endpoints used */
    CDC_DATA_INTERFACE_CLASS,           /* bInterfaceClass: Data Interface Class */
    0x00,                               /* bInterfaceSubClass: no subclass available */
    0x00,                               /* bInterfaceProtocol: no protocol used */
    0x04,                               /* iInterface: */
    
    /* Endpoint, EP Bulk Out */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_OUT(3),                /* 0x01: bEndpointAddress */
    USB_ENDPOINT_TYPE_BULK,             /* bmAttributes */
    WBVAL(64),                          /* wMaxPacketSize */
    0x00,                               /* bInterval: ignore for Bulk transfer */

    /* Endpoint, EP Bulk In */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_IN(3),                 /* 0x81: bEndpointAddress */
    USB_ENDPOINT_TYPE_BULK,             /* bmAttributes */
    WBVAL(64),                          /* wMaxPacketSize */
    0x00,                               /* bInterval: ignore for Bulk transfer */

    /* Second Interface Pair */
    /* Interface association descriptor IAD */
    USB_INTERFACE_ASSOCIATION_DESC_SIZE,         /* bLength: 8 */
    USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE,   /* bDescriptorType */
    0x02,                                        /* bInterfaceNumber: Number of Interface */
    0x02,                                        /* bAlternateSetting: Alternate setting */
    CDC_COMMUNICATION_INTERFACE_CLASS,           /* bInterfaceClass: Communication Interface Class */
    CDC_ABSTRACT_CONTROL_MODEL,                  /* bInterfaceSubClass: Abstract Control Model */
    0x00,                                        /* bInterfaceProtocol: no protocol used */
    0x04,                                        /* iInterface: */
    
    /* 2nd Communications Interface */
    /*Interface 2, Alterante Setting 0, CCI Descriptor*/
    USB_INTERFACE_DESC_SIZE,            /* bLength: 9 */
    USB_INTERFACE_DESCRIPTOR_TYPE,      /* bDescriptorType */
    USB_CDC_CIF_NUM_2,                  /* 2: interface number  */
    0x00,                               /* unknown */
    0x01,                               /* endpoint count */
    CDC_COMMUNICATION_INTERFACE_CLASS,  /* CCI class*/
    CDC_ABSTRACT_CONTROL_MODEL,         /* ACM */
    0x00,                               /* Protocol  */
    0x04,                               /* Interface */
    
    /*Header Functional Descriptor*/
    0x05,                               /* bLength: Endpoint Descriptor size */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_HEADER,                         /* bDescriptorSubtype: Header Func Desc */
    WBVAL(CDC_V1_10), /* 1.10 */        /* bcdCDC */
    
    /*Call Management Functional Descriptor*/
    0x05,                               /* bFunctionLength */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_CALL_MANAGEMENT,                /* bDescriptorSubtype: Call Management Func Desc */
    0x01,                               /* bmCapabilities: device handles call management */
    0x01,                               /* 1: bDataInterface: CDC data IF ID */ /* Indicates multiplexed commands are handled via data interface */
    
    /*Abstract Control Management Functional Descriptor*/
    0x04,                               /* bFunctionLength */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_ABSTRACT_CONTROL_MANAGEMENT,    /* bDescriptorSubtype: Abstract Control Management desc */
    0x02,                               /* bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported */
    
    /*Union Functional Descriptor*/
    0x05,                               /* bFunctionLength */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_UNION,                          /* 6: bDescriptorSubtype: Union func desc */
    USB_CDC_CIF_NUM_2,                  /* 2: bMasterInterface: Communication class interface is master */
    USB_CDC_DIF_NUM_2,                  /* 3: bSlaveInterface0: Data class interface is slave 0 */
    
    /*Endpoint 1 Descriptor*/           /* event notification (optional) */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_IN(2),                 /* 0x82: bEndpointAddress */
    USB_ENDPOINT_TYPE_INTERRUPT,        /* bmAttributes */
    WBVAL(0x0010),                      /* wMaxPacketSize */
    0x08,          /* 8ms */            /* bInterval */
    
    /* 2nd Data Interface */
    /* Interface 3, Alternate Setting 0, Data class interface descriptor*/
    USB_INTERFACE_DESC_SIZE,            /* bLength: 9 */
    USB_INTERFACE_DESCRIPTOR_TYPE,      /* bDescriptorType */
    USB_CDC_DIF_NUM_2,                  /* bInterfaceNumber: Number of Interface */
    0x00,                               /* bAlternateSetting: no alternate setting */
    0x02,                               /* bNumEndpoints: two endpoints used */
    CDC_DATA_INTERFACE_CLASS,           /* bInterfaceClass: Data Interface Class */
    0x00,                               /* bInterfaceSubClass: no subclass available */
    0x00,                               /* bInterfaceProtocol: no protocol used */
    0x04,                               /* iInterface: */
    
    /* Endpoint, EP Bulk Out */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_OUT(4),                /* 0x04: bEndpointAddress */
    USB_ENDPOINT_TYPE_BULK,             /* bmAttributes */
    WBVAL(64),                          /* wMaxPacketSize */
    0x00,                               /* bInterval: ignore for Bulk transfer */

    /* Endpoint, EP Bulk In */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_IN(4),                 /* 0x84: bEndpointAddress */
    USB_ENDPOINT_TYPE_BULK,             /* bmAttributes */
    WBVAL(64),                          /* wMaxPacketSize */
    0x00,                               /* bInterval: ignore for Bulk transfer */

    /* Terminator */
    0                                  /* bLength */
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone see what I'm doing wrong?&lt;/P&gt;&lt;P&gt;Never mind. Found the first bug. Forgot to set the maximum number of endpoints.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;ErrorCode_t init_usb()
{
  ErrorCode_t ret = LPC_OK;
  /* initilize call back structures */
  memset((void *) &amp;amp;usbParameters, 0, sizeof(USBD_API_INIT_PARAM_T));
  usbParameters.usb_reg_base = USB0_BASE;
  usbParameters.max_num_ep = 6;     // &amp;lt;-- Formerly 3
  usbParameters.high_speed_capable = 0;		/* Full speed only. */
  usbParameters.mem_base = USB_STACK_MEM_BASE;
  usbParameters.mem_size = USB_STACK_MEM_SIZE;

  /* Set the USB descriptors */
  usbDescriptors.device_desc = (uint8_t *) USB_DeviceDescriptor;
  usbDescriptors.string_desc = (uint8_t *) USB_StringDescriptor;
  usbDescriptors.high_speed_desc = (uint8_t *) USB_FsConfigDescriptor;
  usbDescriptors.full_speed_desc = (uint8_t *) USB_FsConfigDescriptor;
  usbDescriptors.device_qualifier = 0;
	
  ret = USBD_API-&amp;gt;hw-&amp;gt;Init(&amp;amp;g_hUsb, &amp;amp;usbDescriptors, &amp;amp;usbParameters);
  
  return ret;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully I can get the rest to work.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2023 17:29:19 GMT</pubDate>
    <dc:creator>dean_sands</dc:creator>
    <dc:date>2023-11-14T17:29:19Z</dc:date>
    <item>
      <title>LPC5411X: Is a composite CDC configuration possible with the USB ROM API?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5411X-Is-a-composite-CDC-configuration-possible-with-the-USB/m-p/1757075#M54701</link>
      <description>&lt;P&gt;I'm trying to create a composite USB device with multiple CDCs. To do this, I'm merging in the LPCXPresso54114_dev_composite_cdc_vcom_cdc_vcom_bm example with the LPC54114 usbdrom_cdc example from the Keil Pack Installer. Both work separately.&lt;/P&gt;&lt;P&gt;The USB ROM API from Keil is far easier to work with. But I'm struggling to get it to work in a composite configuration. My software is throwing a&amp;nbsp;ERR_USBD_BAD_INTF_DESC code.&lt;/P&gt;&lt;P&gt;Here's my FS Configuration Descriptor code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;const uint16_t config_desc_data_length=(           /* wTotalLength */                              
    (1*USB_CONFIGUARTION_DESC_SIZE         )+      /* length of initial descriptor */
    (
        (1*USB_INTERFACE_ASSOCIATION_DESC_SIZE )+  /* interface association descriptor */
        (1*USB_INTERFACE_DESC_SIZE             )+  /* communication control interface*/
        (0x0013                                )+  /* CDC functions */
        (1*USB_ENDPOINT_DESC_SIZE              )+  /* interrupt endpoint */
        (1*USB_INTERFACE_DESC_SIZE             )+  /* communication interface */
        (2*USB_ENDPOINT_DESC_SIZE              )+  /* bulk endpoints */
        (0)
    ) * 2
)  ;

/**
 * USB FSConfiguration Descriptor
 * All Descriptors (Configuration, Interface, Endpoint, Class, Vendor)
 */
ALIGNED(4) uint8_t USB_FsConfigDescriptor[] = {
    /* Configuration 1 */
    USB_CONFIGUARTION_DESC_SIZE,                /* bLength: 9 */
    USB_CONFIGURATION_DESCRIPTOR_TYPE,          /* bDescriptorType */
    WBVAL(config_desc_data_length),
    0x04,                                       /* bNumInterfaces */
    0x01,                                       /* bConfigurationValue: 0x01 is used to select this configuration */
    0x00,                                       /* iConfiguration: no string to describe this configuration */
    USB_CONFIG_BUS_POWERED /*|*/                /* bmAttributes */
    /*USB_CONFIG_REMOTE_WAKEUP*/,
    USB_CONFIG_POWER_MA(100),                   /* bMaxPower, device power consumption is 100 mA */
    
    /* First Interface Pair */
    /* Interface association descriptor IAD */
    USB_INTERFACE_ASSOCIATION_DESC_SIZE,        /* bLength: 8 */
    USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE,  /* bDescriptorType */
    USB_CDC_CIF_NUM_1,                          /* bInterfaceNumber: Number of Interface: 0 */ /* The first interface number associated with this function */
    0x02,                                       /* The number of contiguous interfaces associated with this function */
    CDC_COMMUNICATION_INTERFACE_CLASS,          /* bInterfaceClass: Communication Interface Class */
    CDC_ABSTRACT_CONTROL_MODEL,                 /* bInterfaceSubClass: Abstract Control Model */
    0x00,                                       /* bInterfaceProtocol: no protocol used */
    0x04,                                       /* Function string descriptor index */
    
    /* 1st Communications Interface */
    /*Interface 0, Alternate Setting 0, CCI Descriptor*/
    USB_INTERFACE_DESC_SIZE,            /* bLength: 9 */
    USB_INTERFACE_DESCRIPTOR_TYPE,      /* bDescriptorType */
    USB_CDC_CIF_NUM_1,                  /* 0: interface number  */
    0x00,                               /* Alternate Setting */
    0x01,                               /* endpoint count */
    CDC_COMMUNICATION_INTERFACE_CLASS,  /* CCI class*/
    CDC_ABSTRACT_CONTROL_MODEL,         /* ACM */
    0x00,                               /* Protocol  */
    0x04,                               /* Interface */
    
    /*Header Functional Descriptor*/
    0x05,                               /* bLength: Endpoint Descriptor size: 5 */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_HEADER,                         /* bDescriptorSubtype: Header Func Desc */
    WBVAL(CDC_V1_10), /* 1.10 */        /* bcdCDC */
    
    /*Call Management Functional Descriptor*/
    0x05,                               /* bFunctionLength: 5 */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_CALL_MANAGEMENT,                /* bDescriptorSubtype: Call Management Func Desc */
    0x01,                               /* bmCapabilities: device handles call management */
    USB_CDC_DIF_NUM_1,                  /* 1: bDataInterface: CDC data IF ID */
    
    /*Abstract Control Management Functional Descriptor*/
    0x04,                               /* bFunctionLength: 4 */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_ABSTRACT_CONTROL_MANAGEMENT,    /* bDescriptorSubtype: Abstract Control Management desc */
    0x02,                               /* bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported */
    
    /*Union Functional Descriptor*/
    0x05,                               /* bFunctionLength: 5 */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_UNION,                          /* 6: bDescriptorSubtype: Union func desc */
    USB_CDC_CIF_NUM_1,                  /* bMasterInterface: Communication class interface is master */
    USB_CDC_DIF_NUM_1,                  /* bSlaveInterface0: Data class interface is slave 0 */
    
    /*Endpoint 1 Descriptor*/           /* event notification (optional) */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_IN(1),                 /* 0x82: bEndpointAddress */
    USB_ENDPOINT_TYPE_INTERRUPT,        /* bmAttributes */
    WBVAL(0x0010),                      /* wMaxPacketSize */
    0x08,          /* 8ms */            /* bInterval */
    
    /* 1st Data Interface */
    /* Interface 1, Alternate Setting 0, Data class interface descriptor*/
    USB_INTERFACE_DESC_SIZE,            /* bLength: 9 */
    USB_INTERFACE_DESCRIPTOR_TYPE,      /* bDescriptorType */
    USB_CDC_DIF_NUM_1,                  /* bInterfaceNumber: Number of Interface */
    0x00,                               /* bAlternateSetting: no alternate setting */
    0x02,                               /* bNumEndpoints: two endpoints used */
    CDC_DATA_INTERFACE_CLASS,           /* bInterfaceClass: Data Interface Class */
    0x00,                               /* bInterfaceSubClass: no subclass available */
    0x00,                               /* bInterfaceProtocol: no protocol used */
    0x04,                               /* iInterface: */
    
    /* Endpoint, EP Bulk Out */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_OUT(3),                /* 0x01: bEndpointAddress */
    USB_ENDPOINT_TYPE_BULK,             /* bmAttributes */
    WBVAL(64),                          /* wMaxPacketSize */
    0x00,                               /* bInterval: ignore for Bulk transfer */

    /* Endpoint, EP Bulk In */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_IN(3),                 /* 0x81: bEndpointAddress */
    USB_ENDPOINT_TYPE_BULK,             /* bmAttributes */
    WBVAL(64),                          /* wMaxPacketSize */
    0x00,                               /* bInterval: ignore for Bulk transfer */

    /* Second Interface Pair */
    /* Interface association descriptor IAD */
    USB_INTERFACE_ASSOCIATION_DESC_SIZE,         /* bLength: 8 */
    USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE,   /* bDescriptorType */
    0x02,                                        /* bInterfaceNumber: Number of Interface */
    0x02,                                        /* bAlternateSetting: Alternate setting */
    CDC_COMMUNICATION_INTERFACE_CLASS,           /* bInterfaceClass: Communication Interface Class */
    CDC_ABSTRACT_CONTROL_MODEL,                  /* bInterfaceSubClass: Abstract Control Model */
    0x00,                                        /* bInterfaceProtocol: no protocol used */
    0x04,                                        /* iInterface: */
    
    /* 2nd Communications Interface */
    /*Interface 2, Alterante Setting 0, CCI Descriptor*/
    USB_INTERFACE_DESC_SIZE,            /* bLength: 9 */
    USB_INTERFACE_DESCRIPTOR_TYPE,      /* bDescriptorType */
    USB_CDC_CIF_NUM_2,                  /* 2: interface number  */
    0x00,                               /* unknown */
    0x01,                               /* endpoint count */
    CDC_COMMUNICATION_INTERFACE_CLASS,  /* CCI class*/
    CDC_ABSTRACT_CONTROL_MODEL,         /* ACM */
    0x00,                               /* Protocol  */
    0x04,                               /* Interface */
    
    /*Header Functional Descriptor*/
    0x05,                               /* bLength: Endpoint Descriptor size */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_HEADER,                         /* bDescriptorSubtype: Header Func Desc */
    WBVAL(CDC_V1_10), /* 1.10 */        /* bcdCDC */
    
    /*Call Management Functional Descriptor*/
    0x05,                               /* bFunctionLength */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_CALL_MANAGEMENT,                /* bDescriptorSubtype: Call Management Func Desc */
    0x01,                               /* bmCapabilities: device handles call management */
    0x01,                               /* 1: bDataInterface: CDC data IF ID */ /* Indicates multiplexed commands are handled via data interface */
    
    /*Abstract Control Management Functional Descriptor*/
    0x04,                               /* bFunctionLength */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_ABSTRACT_CONTROL_MANAGEMENT,    /* bDescriptorSubtype: Abstract Control Management desc */
    0x02,                               /* bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported */
    
    /*Union Functional Descriptor*/
    0x05,                               /* bFunctionLength */
    CDC_CS_INTERFACE,                   /* bDescriptorType: CS_INTERFACE */
    CDC_UNION,                          /* 6: bDescriptorSubtype: Union func desc */
    USB_CDC_CIF_NUM_2,                  /* 2: bMasterInterface: Communication class interface is master */
    USB_CDC_DIF_NUM_2,                  /* 3: bSlaveInterface0: Data class interface is slave 0 */
    
    /*Endpoint 1 Descriptor*/           /* event notification (optional) */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_IN(2),                 /* 0x82: bEndpointAddress */
    USB_ENDPOINT_TYPE_INTERRUPT,        /* bmAttributes */
    WBVAL(0x0010),                      /* wMaxPacketSize */
    0x08,          /* 8ms */            /* bInterval */
    
    /* 2nd Data Interface */
    /* Interface 3, Alternate Setting 0, Data class interface descriptor*/
    USB_INTERFACE_DESC_SIZE,            /* bLength: 9 */
    USB_INTERFACE_DESCRIPTOR_TYPE,      /* bDescriptorType */
    USB_CDC_DIF_NUM_2,                  /* bInterfaceNumber: Number of Interface */
    0x00,                               /* bAlternateSetting: no alternate setting */
    0x02,                               /* bNumEndpoints: two endpoints used */
    CDC_DATA_INTERFACE_CLASS,           /* bInterfaceClass: Data Interface Class */
    0x00,                               /* bInterfaceSubClass: no subclass available */
    0x00,                               /* bInterfaceProtocol: no protocol used */
    0x04,                               /* iInterface: */
    
    /* Endpoint, EP Bulk Out */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_OUT(4),                /* 0x04: bEndpointAddress */
    USB_ENDPOINT_TYPE_BULK,             /* bmAttributes */
    WBVAL(64),                          /* wMaxPacketSize */
    0x00,                               /* bInterval: ignore for Bulk transfer */

    /* Endpoint, EP Bulk In */
    USB_ENDPOINT_DESC_SIZE,             /* bLength: 7 */
    USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType */
    USB_ENDPOINT_IN(4),                 /* 0x84: bEndpointAddress */
    USB_ENDPOINT_TYPE_BULK,             /* bmAttributes */
    WBVAL(64),                          /* wMaxPacketSize */
    0x00,                               /* bInterval: ignore for Bulk transfer */

    /* Terminator */
    0                                  /* bLength */
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone see what I'm doing wrong?&lt;/P&gt;&lt;P&gt;Never mind. Found the first bug. Forgot to set the maximum number of endpoints.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;ErrorCode_t init_usb()
{
  ErrorCode_t ret = LPC_OK;
  /* initilize call back structures */
  memset((void *) &amp;amp;usbParameters, 0, sizeof(USBD_API_INIT_PARAM_T));
  usbParameters.usb_reg_base = USB0_BASE;
  usbParameters.max_num_ep = 6;     // &amp;lt;-- Formerly 3
  usbParameters.high_speed_capable = 0;		/* Full speed only. */
  usbParameters.mem_base = USB_STACK_MEM_BASE;
  usbParameters.mem_size = USB_STACK_MEM_SIZE;

  /* Set the USB descriptors */
  usbDescriptors.device_desc = (uint8_t *) USB_DeviceDescriptor;
  usbDescriptors.string_desc = (uint8_t *) USB_StringDescriptor;
  usbDescriptors.high_speed_desc = (uint8_t *) USB_FsConfigDescriptor;
  usbDescriptors.full_speed_desc = (uint8_t *) USB_FsConfigDescriptor;
  usbDescriptors.device_qualifier = 0;
	
  ret = USBD_API-&amp;gt;hw-&amp;gt;Init(&amp;amp;g_hUsb, &amp;amp;usbDescriptors, &amp;amp;usbParameters);
  
  return ret;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully I can get the rest to work.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 17:29:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5411X-Is-a-composite-CDC-configuration-possible-with-the-USB/m-p/1757075#M54701</guid>
      <dc:creator>dean_sands</dc:creator>
      <dc:date>2023-11-14T17:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: LPC5411X: Is a composite CDC configuration possible with the USB ROM API?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5411X-Is-a-composite-CDC-configuration-possible-with-the-USB/m-p/1759104#M54724</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/223860"&gt;@dean_sands&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Technically it's possiable to use USB ROM API to implement USB composite device but we don't have related LPC5411x demo code and there is no plan to update the demo.&lt;/P&gt;
&lt;P&gt;For composite USB, our recommendation is MCUXPresso SDK.&lt;/P&gt;
&lt;P&gt;There were discussion on version on this topic. FYI:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/LPC54114-Need-ROM-based-USB-HID-Keyboard-example/td-p/1742175" target="_blank"&gt;https://community.nxp.com/t5/LPC-Microcontrollers/LPC54114-Need-ROM-based-USB-HID-Keyboard-example/td-p/1742175&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Have a nice day,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 15:09:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC5411X-Is-a-composite-CDC-configuration-possible-with-the-USB/m-p/1759104#M54724</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2023-11-17T15:09:20Z</dc:date>
    </item>
  </channel>
</rss>

