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: launchpad

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: TM4C123GH6PM, AFE4490, AFE4404

Hi !

I am porting working code of tiva tm4c123gh6pm launchpad to tiva tm4c1294xl launchpad.

I am using USB_MODE_FORCE_DEVICE in the USBStackModeSet() function so that PB0,PB1 pins are ignored(since r25 & r29 r not populated in tm4c123 launchpad ).

After porting code to tm4c1294launchpad,it is not getting detected by computer as usb.It shows message usb device is not recognized & when we click message for details ,it shows following screen:-

usbdevice_not_detected.docx

In tm4c1294 launch pad pb0 & pb1 r connected to vbus & usb id pin.Is this causing problem? What changes(hardware/software) r required to get code working with this launchpad?

Thanks & regards,

Neelima

  • Hello Neelima,

    Can you please try using a TivaWare USB example for starters with the TM4C1294 LaunchPad? If any of the USB examples work then it will prove that the USB driver on your PC is working correctly and the issue is software based. Based on your description, I believe that will be the case, but need to test one aspect at a time so we don't focus on the wrong one.

    Also I will note that porting from TM4C123 to TM4C129 is not trivial and there are a lot of aspects to handle. You should review this document to understand all the differences between devices when porting: http://www.ti.com/lit/an/spma065/spma065.pdf

  • Hello Ralph,

    I have run usb_dev_cserial example (given for tm4c1294 starter )sucessfully on tm4c1294 launchpad.But this example uses composite cdc serial.

    So,Can we run usb_dev_serial example (given for tm4c123)which is non composite cdc serial with tm4c1294 launchpad after porting?

    Also,I have alresdy gone through spma065.

    Thanks & Regards,

    Neelima

  • Hello Neelima,

    Well if you want a non-composite CDC example, then I wouldn't recommend trying to port the usb_dev_serial example due to the amount of differences between the devices. Instead, I can provide you a working example for the TM4C1294 LaunchPad that I made a while back! That should get you going far quicker :)

    CCS Project: 4532.usb_dev_cdcserial.zip

  • Hello Ralph,

    I have run ur example successfully on tm4c1294 launchpad.
    So,I made changes in my code as per ur example code.Now the usb port was getting detected as" tivaware usb serial port" & not as my custom device.
    So,I made changes in usb_structs.c for my custom pid,vid & other usb parameters .Now,it was detected under other devices & asking for drivers which i installed successfully. But,after this process, usb is not getting detected.
    So,I run ur example code again to test usb detection problem.But usb is not getting detected.
    What could have gone wrong?The custom GUI with which i already have interfaced tm4c123 launchpad has their own drivers.
    Is it require to modify these drivers also?
    Or need hardware change i.e bypass pb0 & pb1 signals by cutting tracks on board.
    Pl.let me know .
    Thanks & Regards,

    Neelima
  • Hello Neelima,

    You don't need to modify the hardware, that's never been needed for any sort of USB application before.

    The issues certainly sounds like a driver issue or an issue with your custom GUI, especially given that you are modifying the PID/VID and other parameters.

    If the base TI example worked, then really it is up to you to understand how you are modifying it and how the OS (presuming Windows) will recognize the device after modifications are made.

    As far as the USB detection issue, I suspect that the OS remembers your modifications to the driver and thus doesn't enumerate the port the same still. This would be easy to test by just re-flashing my provided example and then plugging the board into a new PC and seeing what occurs.
  • Hello Ralph,

    As per ur suggestion,I tested ur  example code on another pc. Still, USBof launchpad is not getting detected as com port/composite device.See attached screenshot.

    other pc test.docx

    We have brought afe4490 evm & after evalution of it & our need for more led channel requirement,we shifted to afe4404 & built our own pcb & interfaced it with tm4c123 launchpad successfully.For this ,we referred TI afe4404 evm code & gui.

    The code with tm4c123 launchpad which is working was interfaced to afe4404 evmGUI to just crosscheck SPo2 waveform for testing purpose only.The tm4c123 launchpad was interfaced to our own afe pcb.Now,We have shifted to tm4c1294 launchpad for more memory requirement.

    So,it is important to porting from 123 to 1294 goes well.Pl.let me know what is going wrong with my process.

    I hope usb port of launchpad is not damaged by this exercise.

    The usb_struct.c file used for this is modified as per ur example code & is attached for ur ref.In this usblib/device/usbdcomp.h is included newly.

    //*****************************************************************************
    //
    // usb_serial_structs.c - Data structures defining this CDC USB device.
    //
    // Copyright (c) 2012-2017 Texas Instruments Incorporated.  All rights reserved.
    // Software License Agreement
    // 
    // Texas Instruments (TI) is supplying this software for use solely and
    // exclusively on TI's microcontroller products. The software is owned by
    // TI and/or its suppliers, and is protected under applicable copyright
    // laws. You may not combine this software with "viral" open-source
    // software in order to form a larger program.
    // 
    // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
    // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
    // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
    // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
    // DAMAGES, FOR ANY REASON WHATSOEVER.
    // 
    // This is part of revision 2.1.4.178 of the EK-TM4C1294XL Firmware Package.
    //
    //*****************************************************************************
    
    #include <stdbool.h>
    #include <stdint.h>
    
    #include "inc/hw_types.h"
    #include "driverlib/usb.h"
    #include "usblib/usblib.h"
    #include "usblib/usbcdc.h"
    #include "usblib/usb-ids.h"
    #include "usblib/device/usbdevice.h"
    #include "usblib/device/usbdcdc.h"
    #include "usblib/device/usbdcomp.h"//19.12.17
    #include "usb_structs.h"//19.12.17
    //19.12.17 #include "usb_serial_structs.h"
    
    //*****************************************************************************
    //
    // The languages supported by this device.
    //
    //*****************************************************************************
    const uint8_t g_pui8LangDescriptor[] =
    {
        4,
        USB_DTYPE_STRING,
        USBShort(USB_LANG_EN_US)
    };
    
    //*****************************************************************************
    //
    // The manufacturer string.
    //
    //*****************************************************************************
    const uint8_t g_pui8ManufacturerString[] =
    {
        (17 + 1) * 2,
        USB_DTYPE_STRING,
        'T', 0, 'e', 0, 'x', 0, 'a', 0, 's', 0, ' ', 0, 'I', 0, 'n', 0, 's', 0,
        't', 0, 'r', 0, 'u', 0, 'm', 0, 'e', 0, 'n', 0, 't', 0, 's', 0,
    };
    
    //*****************************************************************************
    //
    // The product string.
    //
    //*****************************************************************************
    const uint8_t g_pui8ProductString[] =
    {
     /*19.12.17   2 + (16 * 2),
        USB_DTYPE_STRING,
        'V', 0, 'i', 0, 'r', 0, 't', 0, 'u', 0, 'a', 0, 'l', 0, ' ', 0,
        'C', 0, 'O', 0, 'M', 0, ' ', 0, 'P', 0, 'o', 0, 'r', 0, 't', 0
    */
     	2 + (18 * 2),
        USB_DTYPE_STRING,
        'M', 0, 'S', 0, 'P', 0, '4', 0, '3', 0, '0', 0,
    		'-', 0,	'U', 0, 'S', 0,	'B', 0, ' ', 0, 'E', 0, 
    	  'x', 0, 'a', 0,	'm', 0, 'p', 0, 'l', 0, 'e', 0
    
    };
    
    //*****************************************************************************
    //
    // The serial number string.
    //
    //*****************************************************************************
    const uint8_t g_pui8SerialNumberString[] =
    {
     2 + (1 * 2),
     //19.12.17  2 + (8 * 2),
        USB_DTYPE_STRING,
           '0',0x00,
           //19.12.17 '1', 0, '2', 0, '3', 0, '4', 0, '5', 0, '6', 0, '7', 0, '8', 0
    };
    
    //*****************************************************************************
    //
    // The control interface description string.
    //
    //*****************************************************************************
    const uint8_t g_pui8ControlInterfaceString[] =
    {
    2 + (22 * 2),
    //19.12.17    2 + (21 * 2),
        USB_DTYPE_STRING,
        	'V',0,'i',0,'r',0,'t',0,'u',0,'a',0,
    		'l',0,' ',0,'C',0,'O',0,'M',0,' ',0,
    		'P',0,'o',0,'r',0,'t',0,' ',0,'(',0,
    		'C',0,'D',0,'C',0,')',0
    		/*19.12.17  'A', 0, 'C', 0, 'M', 0, ' ', 0, 'C', 0, 'o', 0, 'n', 0, 't', 0,
        'r', 0, 'o', 0, 'l', 0, ' ', 0, 'I', 0, 'n', 0, 't', 0, 'e', 0,
        'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0*/
    };
    
    //*****************************************************************************
    //
    // The configuration description string.
    //
    //*****************************************************************************
    const uint8_t g_pui8ConfigString[] =
    {
     2 + (10 * 2),
     //19.12.17    2 + (26 * 2),
        USB_DTYPE_STRING,
        /*19.12.17  'S', 0, 'e', 0, 'l', 0, 'f', 0, ' ', 0, 'P', 0, 'o', 0, 'w', 0,
        'e', 0, 'r', 0, 'e', 0, 'd', 0, ' ', 0, 'C', 0, 'o', 0, 'n', 0,
        'f', 0, 'i', 0, 'g', 0, 'u', 0, 'r', 0, 'a', 0, 't', 0, 'i', 0,
        'o', 0, 'n', 0*/
         	'M',0,'S',0,'P',0,'4',0,'3',0,'0',0,
    		' ',0,'U',0,'S',0,'B',0,
    };
    
    //*****************************************************************************
    //
    // The descriptor string table.
    //
    //*****************************************************************************
    const uint8_t * const g_pui8StringDescriptors[] = //19.12.17
    {
        g_pui8LangDescriptor,
        g_pui8ManufacturerString,
        g_pui8ProductString,
        g_pui8SerialNumberString,
        g_pui8ControlInterfaceString,
        g_pui8ConfigString
    };
    
    #define NUM_STRING_DESCRIPTORS (sizeof(g_pui8StringDescriptors) /            \
                                    sizeof(uint8_t *))//19.12.17
    
    //*****************************************************************************
    //
    // CDC device callback function prototypes.
    //
    //*****************************************************************************
    uint32_t RxHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue,
                 void *pvMsgData);
    uint32_t TxHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue,
                 void *pvMsgData);
    uint32_t ControlHandler(void *pvCBData, uint32_t ui32Event,
                   uint32_t ui32MsgValue, void *pvMsgData);
    
    //*****************************************************************************
    //
    // The CDC device initialization and customization structures. In this case,
    // we are using USBBuffers between the CDC device class driver and the
    // application code. The function pointers and callback data values are set
    // to insert a buffer in each of the data channels, transmit and receive.
    //
    // With the buffer in place, the CDC channel callback is set to the relevant
    // channel function and the callback data is set to point to the channel
    // instance data. The buffer, in turn, has its callback set to the application
    // function and the callback data set to our CDC instance structure.
    //
    //*****************************************************************************
    tUSBDCDCDevice g_sCDCDevice =
    {
     //19.12.17 USB_VID_TI_1CBE,
     //19.12.17    USB_PID_SERIAL,
         USB_VID_TI_2047,
         USB_PID_EVM,
        0,
        USB_CONF_ATTR_SELF_PWR,
        ControlHandler,
        (void *)&g_sCDCDevice,
        USBBufferEventCallback,
        (void *)&g_sRxBuffer,
        USBBufferEventCallback,
        (void *)&g_sTxBuffer,
        g_pui8StringDescriptors,//19.12.17
        NUM_STRING_DESCRIPTORS
    };
    
    //*****************************************************************************
    //
    // Receive buffer (from the USB perspective).
    //
    //*****************************************************************************
    uint8_t g_pui8USBRxBuffer[UART_BUFFER_SIZE];
    tUSBBuffer g_sRxBuffer =
    {
        false,                          // This is a receive buffer.
        RxHandler,                      // pfnCallback
        (void *)&g_sCDCDevice,          // Callback data is our device pointer.
        USBDCDCPacketRead,              // pfnTransfer
        USBDCDCRxPacketAvailable,       // pfnAvailable
        (void *)&g_sCDCDevice,          // pvHandle
        g_pui8USBRxBuffer,              // pui8Buffer
        UART_BUFFER_SIZE,               // ui32BufferSize
    };
    
    //*****************************************************************************
    //
    // Transmit buffer (from the USB perspective).
    //
    //*****************************************************************************
    uint8_t g_pui8USBTxBuffer[UART_BUFFER_SIZE];
    tUSBBuffer g_sTxBuffer =
    {
        true,                           // This is a transmit buffer.
        TxHandler,                      // pfnCallback
        (void *)&g_sCDCDevice,          // Callback data is our device pointer.
        USBDCDCPacketWrite,             // pfnTransfer
        USBDCDCTxPacketAvailable,       // pfnAvailable
        (void *)&g_sCDCDevice,          // pvHandle
        g_pui8USBTxBuffer,              // pui8Buffer
        UART_BUFFER_SIZE,               // ui32BufferSize
    };
    

    Thanks & Regards,

    Neelima

  • Hello Neelima,

    Ummm... The device is right there... Look at Ports (COM & LPT) - Stellaris Virtual Serial Port (COM4) - that is the TM4C board with CDC properly initialized.

    This also means the USB port is certainly not damaged, and I've never heard of a port ever being damaged by changing software so I would not worry about board damage as you work on your application.

    When porting from TM4C123 to TM4C129 I would recommend the following:
    1) Port one peripheral at a time
    2) For all DriverLib calls, look into what the API's do and see if there are differences you need to account for between the processors due to hardware differences. This usually would be most applicable for configuration APIs.
    3) Reference the document I shared before for the difference between devices for each of your peripheral so you know what to look out for when porting firmware over. It also mentions which API's changed between devices as well as which are added. It may be that for the TM4C129 you need to use some of the newer APIs as well, and to understand that you should reference the example code we provide with TivaWare for each peripheral you are porting. The USB CDC example I provided should be your go-to for the USB portion.

  • Hi Ralph,

    Thanks for porting suggestions.

    I don't see virtual com port which after serial usb driver installation becomes Tivaware USB Serial port as seen when running ur program first time.See attached screenshot.cdc_serial screen.docx

    Also, launchpad examples which i have already tested before checking my code like usb_dev_bulk & usb_dev_cserial r not working.For bulk it gives error code 1167(The device is not connected.) And for other usb_dev_cserial example,Tivaware USB Serial port & Tivaware USB Serial command port r not seen.

    Hope u understand my problem.

    Thanks & Regards,

    Neelima

  • Hello Neelima,

    Which OS are you using? Win 7? Win 10? Are you using the TivaWare examples "out of the box" and unmodified?

    neelima g said:


    I don't see virtual com port which after serial usb driver installation becomes Tivaware USB Serial port as seen when running ur program first time.



    I don't understand this comment in relation to the images you've shared both of which have a Virtual Serial Port displayed in Device Manager, can you elaborate please?
  • Hi Ralph,

    I am using windows 7 OS.The other pc on which i tested again for usb detection issue is Windows xp.

    I am asking for device usb detection & not icdi usb detection problem.

    I am using tivaware board examples for ek-1294xl w.o modification.

    Thanks & Regards,

    Neelima

  • Hello Neelima,

    Those examples are well tested on Win 7 and shouldn't have issues.

    For the composite example, it isn't unusual for the second device port to show up under "Universal Serial Bus controllers" as a "USB Composite Device".

    For the Bulk example, I am not clear how you are getting that error. Does Windows pop that up? CCS? In any event, for Error Code 1167, the E2E threads related to Bulk example all were resolved when correct driver was used, so you may need to have Windows install the driver specifically for your Bulk example from the TivaWare provided drivers.

    As far as Win XP goes, I can't test it myself, but it also should not have issues otherwise I'd suspect we'd have gotten posts about that, though it is an old OS so can't guarantee that 100%.
  • Hi Ralph,
    I have no doubts about tivaware examples.
    I am not understanding why usb port of tm4c1294 of launchpad(device usb) is not getting detected now.
    I will review again my code & the whole process I have done.
    Thanks & Regards,
    Neelima