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.

LM3S3748: All the USB example is hangged at USBDCDInit() if i calling function SysTickIntEnable();

Part Number: LM3S3748

Hello TI expert,

I know this LM3s3748 is very old and obsolete, but this time out company need make program for custommer on their deboard.

We need make firmware interface compputer by USB protocol.

Example we base on "SW-EK-LM3S3748-10636" pack.

Using SDK: keilc for arm uVision V5.31.0.

We rebuild all the USB example demo after install "SW-EK-LM3S3748-10636.exe" pack with path file: C:\StellarisWare\boards\ek-lm3s3748

But it seem all project is hangging.

After debugging i see that it hangging at USBDCDInit() function if call SysTickIntEnable(), 

If comment SysTickIntEnable() function it not hanging but cannot detect USB on Device anager system.

Bellow is my main code, i base on "USB_dev_bulk" example:

int main()
{
      unsigned long ulTxCount;
      unsigned long ulRxCount;

      // Not configured initially.
      g_bUSBConfigured = false;

      SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); // we using external crystall 16M
      g_bUSBConfigured = false;

      gpioInit();
      uartInit();
      UARTStdioInit(1);

      UARTprintf("Main start\n");

      SysCtlPeripheralEnable(USB_MUX_GPIO_PERIPH);
      GPIOPinTypeGPIOOutput(USB_MUX_GPIO_BASE, USB_MUX_GPIO_PIN);
      GPIOPinWrite(USB_MUX_GPIO_BASE, USB_MUX_GPIO_PIN, USB_MUX_SEL_DEVICE);


     SysTickPeriodSet(SysCtlClockGet() / SYSTICKS_PER_SECOND);
     SysTickIntEnable();   // it make hangging at USBDBulkInit()->USBDCDInit()->SysCtlClockGet()->SysCtlDelay() 
     SysTickEnable();

     // Initialize the transmit and receive buffers.
     USBBufferInit((tUSBBuffer *)&g_sTxBuffer);
     USBBufferInit((tUSBBuffer *)&g_sRxBuffer);

     // Pass our device information to the USB library and place the device on the bus.
     USBDBulkInit(0, (tUSBDBulkDevice *)&g_sBulkDevice);

     // Clear our local byte counters.
     ulRxCount = 0;
     ulTxCount = 0;

    while(1)
    {
           // blinkingLED();
           if(g_ulFlags & COMMAND_STATUS_UPDATE)
           {
                 // Clear the command flag
                 g_ulFlags &= ~COMMAND_STATUS_UPDATE;
           }
           if(ulTxCount != g_ulTxCount)
           {
                  // Take a snapshot of the latest transmit count.
                   ulTxCount = g_ulTxCount;

           }
           if(ulRxCount != g_ulRxCount)
           {
                  // Take a snapshot of the latest receive count.
                  ulRxCount = g_ulRxCount;
           }
      }
}

if call SysTickIntEnable() function, debug hangging in order of function call: USBDCDInit(ulIndex, psDevice->psPrivateBulkData->psDevInfo);->SysCtlClockGet(0x000010748)->SysCtlDelay(0x0000028C) like this picture

  • Hi,

      I wish I could help but I have no experience with LM3S MCU. Please also note that LM3S3748 is not recommended for new designs and therefore we can no longer provide technical support on e2e.  You can search e2e archives and see if you can find relevant answers to your question.  Did you try the stock example on LM3S LaunchPad or EVM? I suppose the original example is based on 8Mhz crystal. I don't know if changing to 16Mhz is the cause of the examples not working. Sorry for lack of guidance. 

  • Hi Mr Charles Tsal.

    Thank you for your reply.

    I will try to fix this issue.

    But in the StellarisWare folder after installed into C drive.

    I can not find the "usbdevice.c" and "usbdevicepriv.c". only  "usbdevice.h" and "usbdevicepriv.h"

    Can you guide me to get these files?

    I can debug with this check functions call of these file.

  • Hi,

      There are no usbdevice.c and usbdevicepriv.c files. I check the latest TivaWare for TM4C MCU as well. The function prototypes declared in usbdevice.h are public APIs that are defined in files like usbdenum.c. With that said, I encourage migrating to the latest TM4C MCU family for new developments.  

  • hello Charles Tsai.

    at this time we need make firmware follow customer request, so we can not change MCU to TM4C MCU.

    I have 2 question:

    1. Incase if we flash successfull firmware, do we seen USB device on decive manager tab?

    2. Do we need install any driver for LM3S3748 MCU before flash firmware?

  • 1. Incase if we flash successfull firmware, do we seen USB device on decive manager tab?

    2. Do we need install any driver for LM3S3748 MCU before flash firmware?

    As StellarisWare is very old, the driver information file (INF) for use with Windows SP Window Vista and Windows 7 can be found in C:/StellarisWare/windows_drivers. 
    For Windows 2000, the required INF file is in C:/StellarisWare/windows_drivers/win2K.

    See below.

    If you need the latest INF you will need to download TivaWare for TM4C. You may need to modify it as it is specific for TM4C usb_dev_bulk example. Look for the same INF file which will support the latest Windows.