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.

TMS320F28388D: USB "Hello World" application issues

Part Number: TMS320F28388D
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE, TMDSCNCD28388D

Tool/software:

Hi,

I'm developing for the F28388 (337 pin footprint) for the first time using CCS 20.1.1. 

I tried to use the usb_ex1_dev_serial example project from the project wizard to get started, but my initialization code seems to be wrong, as my device manager won't see the virtual com port after I execute the code. What am I doing wrong?

I've attached my main. It was generated by the example project usb_ex1_dev_serial. The important bits are below:
I uncommented the following lines to register the event handler (they were commented out by default):
    Interrupt_register(INT_USBA, &INT_myUSB0_ISR);
    Interrupt_register(INT_myUSB0, &INT_myUSB0_ISR);
I added the following clause to the end of the while loop:
        if (g_bUSBConfigured)  
        {
            const char msg[] = "Hello world\r\n";

            (void)USBBufferWrite(&g_sTxBuffer, (uint8_t *)msg, sizeof(msg) - 1);

            DEVICE_DELAY_US(1000000U);
        }
From what I understand, that g_bUSBConfigured will flip to true once it's ready to send. However, my device manager is not even recognizing my PCB.
Am I missing some initialization step?
For reference, I've attached my sysconfig file as well.
  • Hi, 

    Which versoin of C2000Ware are you using?  Are you using the "TMDSCNCD28388D" control card to run this example ? 

    Best Regards

    Siddharth

  • Hi Siddharth,

    I'm using a custom PCB with the F28388. I can't share the schematic but basically the USBD_N and USBD_P lines are routed through a USBLC6-2SC6 TVS voltage clamp, then routed out to a 10118194-0001LF MicroUSB receptacle. The receptacle is grounded, shielded, and has the VCC pin provided with voltage from the PCB.

    I'm using C2000Ware 5.02.00.00.

  • Hi, 

    You can look at the schematic of the TMDSCNCD28388D and compare it with your custom board. 

    usb_ex1_dev_serial example is specifically developed and validated on the TMDSCNCD28388D board. In this example, the USB is enumnerated as a virtual com port and demonstrates transmit & receptoin of data from another SCI port on the device.

    Best Regards

    Siddharth

  • Oh, so the usb_ex1_dev_serial example transmits and receives to a different SCI port on the microcontroller? I would guess this was made for some kind of development board or sample board?

  • Yes, this example is specific for the TMDSCNCD28388D board. The SCI pins of the MCU are connected to the  USB-to-UART adapter on the XDS110 emulator on this board.  When you send data , it sends over these pins and resends it to the host using the USB (enumerated virtual COM Port)

    Best Regards

    Siddharth

  • Okay, good to know. Thank you.

    Could you provide me a sample of code that serves as a USB echo without the SCI? Just uses the DP/DN default pins for USB communication. For reference, our architecture just has the DP/DN pins for the microcontroller going out to a USB mini header. If I have an application on the PC (Host) side, can you provide me with a sample that will simply wait for a transmission from the host, then echo it back?

  • Here's a sample of my main that just serves to output "Hello world" continuously. Is there anything I am missing from this code that would prevent it from working as intended? What am I missing from it? And what would I need to add to add the "wait for host then echo" functionality?

    int
    main(void)
    {
    //Initialization
    Device_init();
    Device_initGPIO();

    //Interrupts
    Interrupt_initModule();
    Interrupt_initVectorTable();

    //Tx and Rx Buffer Inits
    USBBufferInit(&g_sTxBuffer);
    USBBufferInit(&g_sRxBuffer);

    //USB ISR
    Interrupt_register(INT_USBA, &INT_myUSB0_ISR);
    Interrupt_register(INT_myUSB0, &INT_myUSB0_ISR);

    //Clock and remaining initialization
    SysCtl_setAuxClock(DEVICE_AUXSETCLOCK_CFG_USB);
    Board_init();
    C2000Ware_libraries_init();
    USBDCDCInit(0, &g_sCDCDevice);
    USBGPIOEnable();
    Interrupt_enableGlobal();


    Zero byte counters
    ui32RxCount = 0;
    ui32TxCount = 0;

    g_bUSBConfigured = true;
    while(1)
    {
    if (g_bUSBConfigured)
    {
    const char msg[] = "Hello world\r\n";

    (void)USBBufferWrite(&g_sTxBuffer, (uint8_t *)msg, sizeof(msg) - 1);

    DEVICE_DELAY_US(1000000U);
    }
    }
    }

  • Are you able to see the virtual com port on this host side?

    Best Regards

    Siddharth

  • Hi,


    No, after I run this, I can't see the virtual COM port setup on the windows side

  • hi

    You should be able to see the Virtual COM port since this is not related to SCI.  Can you check the schematic of the TMDSCNCD28388D board and see how the USB pins are connected.

    Best Regards

    Siddharth