This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCPDT: USB Composite Device CDC and Bulk for TM4C129x

Part Number: TM4C1294NCPDT

I will desing USB Composite Device for TM4C1299x. Now, I have DK-1294xl board.

1. The TM4C1299x support max device is 4 ?
//*****************************************************************************
//
// This is the maximum number of devices we can support when in host mode and
// using a hub. By default, we support up to 4 devices (plus 1 internally for
// the hub itself).
//
//*****************************************************************************
#ifndef MAX_USB_DEVICES
#define MAX_USB_DEVICES 5
#endif

2. I need first sample for CDC*2 and bulk*2,
How can I study it?

3. Do you have CDC*2 and bulk*2 Composite Device sample for 129x ?

thank you,

  • Hello JK Wolf,

    1) Yes the maximum devices supported by TivaWare is 4.

    3) We don't have an example for 2x CDC and 2x Bulk device.

    Regarding question 2, I would start by reviewing the usb_dev_cserial example which has 2 composite device, and the usb_dev_bulk example which has a single bulk device. Understand how the usblib configuration is done for each of these examples.

    Start with usb_dev_cserial and look into the USBDCDCCompositeInit API and the variables passed into.

    Once you understand that, then look at how bulk devices are configured for usb_dev_bulk.

    Then go into TivaWare usblib, and find usbdbulk.c and look into how the USBDBulkCompositeInit API works and what the required variables are for it.

    From there you should be able to generate the required structures by using the knowledge from usb_dev_bulk example in order to initialize your two Bulk devices via USBDBulkCompositeInit.
  • Hi Ralph,
    I will change usb_dev_cserial example to CDC and HID.
    In ~ /usblib/usb-ids.h isn't Product IDs for CDC and HID.
    1. What's CDC and HID product ID?
    The Composite CDC ID is #define USB_PID_COMP_SERIAL 0x0007

    2. I will support CDC*3 and Bulk.
    What's 4 devices product ID?
    3. Where can I search ID define ?
    4. When I change product ID then I modify code for usblib?

    //*****************************************************************************
    //
    // Product IDs.
    //
    //*****************************************************************************
    #define USB_PID_MOUSE 0x0000
    #define USB_PID_KEYBOARD 0x0001
    #define USB_PID_SERIAL 0x0002
    #define USB_PID_BULK 0x0003
    #define USB_PID_SCOPE 0x0004
    #define USB_PID_MSC 0x0005
    #define USB_PID_AUDIO 0x0006
    #define USB_PID_COMP_SERIAL 0x0007
    #define USB_PID_COMP_AUDIO_HID 0x0008
    #define USB_PID_COMP_HID_SER 0x0009
    #define USB_PID_COMP_HID_DFU 0x000A
    #define USB_PID_DATA_LOGGER 0x000B
    #define USB_PID_COMP_HID_HID 0x000D
    #define USB_PID_GAMEPAD 0x000F
    #define USB_PID_LP_CGAMEPAD 0x0010
    #define USB_PID_DFU 0x00FF

    #endif /* __USBIDS_H__ */

    thanks.

  • Hello JK Wolf,

    CDC PID is USB_PID_SERIAL or you can use USB_PID_COMP_SERIAL.

    HID PID includes items like:

    • USB_PID_MOUSE 
    • USB_PID_KEYBOARD
    • USB_PID_GAMEPAD

    For composite you may want to use:

    • USB_PID_COMP_HID_SER
    • USB_PID_COMP_HID_DFU
    • USB_PID_COMP_HID_HID

    You should be able to re-use the same product ID for multiple devices, our cserial example already does this.

    If you change the product ID's you don't need to change usblib, but rather you'd need to update the Windows USB drivers so the device will properly enumerate.

  • Part Number: TM4C1294NCPDT

    Thanks for your answer.

    Sorry, I am double confirm.

    Now, I am use  composite device is 4 device.

    The product ID select by below list.

    • USB_PID_COMP_HID_SER
    • USB_PID_COMP_HID_DFU
    • USB_PID_COMP_HID_HID

    thank you.

  • Hello JK Wolf,

    I think you didn't mean to create a new thread (or at least if there was a question, then I didn't understand it) so I merged your posts.
  • Hi Raoph
    I am modify usb_dev_cserial source code.
    I will creat three com port.

    #define NUM_SERIAL_DEVICES 3
    #define DESCRIPTOR_DATA_SIZE (COMPOSITE_DCDC_SIZE + COMPOSITE_DCDC_SIZE + COMPOSITE_DCDC_SIZE)
    ....
    tUSBDCDCDevice g_psCDCDevice[NUM_SERIAL_DEVICES] =
    {
    ......
    {
    USB_VID_TI_1CBE,
    USB_PID_SERIAL,
    0,
    USB_CONF_ATTR_SELF_PWR,
    ControlHandler,
    (void *)&g_psCDCDevice[2],
    USBBufferEventCallback,
    (void *)&g_psRxBuffer[2],
    USBBufferEventCallback,
    (void *)&g_psTxBuffer[2],
    g_pui8StringDescriptors,
    NUM_STRING_DESCRIPTORS
    }
    }

    tUSBBuffer g_psRxBuffer[NUM_SERIAL_DEVICES] =
    {
    ......
    {
    false, // This is a receive buffer.
    RxHandlerCmd, // pfnCallback
    (void *)&g_psCDCDevice[2], // Callback data is our device pointer.
    USBDCDCPacketRead, // pfnTransfer
    USBDCDCRxPacketAvailable, // pfnAvailable
    (void *)&g_psCDCDevice[2], // pvHandle
    g_ppui8USBRxBuffer[2], // pcBuffer
    UART_BUFFER_SIZE, // ulBufferSize
    }
    };

    tUSBBuffer g_psTxBuffer[NUM_SERIAL_DEVICES] =
    {
    ......
    {
    true, // This is a transmit buffer.
    TxHandlerCmd, // pfnCallback
    (void *)&g_psCDCDevice[2], // Callback data is our device pointer.
    USBDCDCPacketWrite, // pfnTransfer
    USBDCDCTxPacketAvailable, // pfnAvailable
    (void *)&g_psCDCDevice[2], // pvHandle
    g_ppcUSBTxBuffer[2], // pcBuffer
    UART_BUFFER_SIZE, // ulBufferSize
    }
    };
    ----------------------------------------------------------------
    main()

    //
    // Initialize the second serial port instances that is part of this
    // composite device.
    //
    g_sCompDevice.psDevices[2].pvInstance =
    USBDCDCCompositeInit(0, &g_psCDCDevice[2], &g_psCompEntries[2]);

    //
    // Pass the device information to the USB library and place the device
    // on the bus.
    //
    USBDCompositeInit(0, &g_sCompDevice, DESCRIPTOR_DATA_SIZE,
    g_pucDescriptorData);

    ................

    the USBview isn't look thrid com port

    ======================== USB Device ========================

    +++++++++++++++++ Device Information ++++++++++++++++++
    Device Description : USB Composite Device
    Device Path : \\?\usb#vid_1cbe&pid_00fd#0f00a1d0#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
    Device ID : USB\VID_1CBE&PID_00FD\0F00A1D0
    Hardware IDs : USB\VID_1CBE&PID_00FD&REV_0100 USB\VID_1CBE&PID_00FD
    Driver KeyName : {36fc9e60-c465-11cf-8056-444553540000}\0034 (GUID_DEVCLASS_USB)
    Driver : system32\DRIVERS\usbccgp.sys (Version: 6.1.7601.23933 Date: 2017-10-18)
    Driver Inf : C:\Windows\inf\usb.inf
    Legacy BusType : PNPBus
    Class : USB
    Class GUID : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
    Interface GUID : {a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
    Service : usbccgp
    Enumerator : USB
    Location Info : Port_#0009.Hub_#0001
    Location IDs : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(9)
    Container ID : {a1e665b3-3404-5c28-90f7-6572c9d011dd}
    Manufacturer Info : (標準 USB 主控制器)
    Capabilities : 0x94 (Removable, UniqueID, SurpriseRemovalOK)
    Status : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
    Problem Code : 0
    Address : 9
    Power State : D0 (supported: D0, D3, wake from D0)
    Child Device 1 : Stellaris ICDI JTAG/SWD Interface
    DevicePath : -
    Device ID : USB\VID_1CBE&PID_00FD&MI_02\6&39236B97&0&0002
    Class : StellarisICDIDeviceClass
    Child Device 2 : Stellaris ICDI DFU Device
    DevicePath : -
    Device ID : USB\VID_1CBE&PID_00FD&MI_03\6&39236B97&0&0003
    Class : StellarisICDIDeviceClass
    Child Device 3 : Stellaris Virtual Serial Port
    DevicePath : -
    Device ID : USB\VID_1CBE&PID_00FD&MI_00\6&39236B97&0&0000
    Class : Ports
    COM-Port : COM12 (\Device\USBSER000)

    What's process not add into code?

    thanks.
  • Hello JK Wolf,

    I was alerted to your follow-up question today. When you ask a new question, please be sure not to Verify any answers until you have your question resolved because otherwise your new inquiry will not show up in our workflow, I think that is what happened here.

    I am not sure I am fully understanding your question, but it sounds like you are not seeing the 3rd composite device enumerate? If so, can you please better share your modifications? You have code postings with ... but I can't understand what that means, your structures look incomplete so it's impossible for me to guess what is going on.
  • Dear Ralph,

    Please kindly look at below TI Box for modified code and feel free to let us know if any suggestion.
    txn.app.box.com/.../aqft2jg6oydnovi8lprxmasik2j6dzc9
    Thanks a lot.
  • Hello Janet,

    I replied to your new post today at: e2e.ti.com/.../2605537

    Let's keep the discussion isolated to a single thread.