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.

TM4C123GH6PM: USB0 is peripheral isn't functioning, USB_O_IS got never changed, but 0

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: EK-TM4C123GXL

Dear E2E forumers, I'm trying to communicate with TM4C123GH6PM on lunch pad board via usb. Provided stellaris example doesn't work either. My code constantly poll interrupt status register. and it never got changed but 0, regardless of usb host signals.It looks like a hardware issue Does any one made usb working on this part?

main...., etc.

while(1){

ui8Status = HWREGB( USB0_BASE+ USB_O_IS)

UARTprintf("\nUSBIntStatusControl=%x..\n",ui8Status);

};

  • Hello Alexander,

    Do you have the USB cable plugged into the port on the left side of the LaunchPad and have you switched the the USB selection switch on the top of the board from "Debug" to "Device"?
  • Yes,Ralph, Cabling is ok. I supply board from ICDI usb connector and power switch is at proper position. All LEDs are working. Lets do not talk about windows driver, I tryied it on Win 10, the part doesn't enumerate. Lets also drop from discussion about ti's usblib, it looks like it is hardware issue, since I'm checking IS register directly.
    Connecting /disconnecting usb on device side as well lsusb doesn't change USB_O_IS state, that remains zero always.

  • Hello Alexander,

    But you are saying the EK-TM4C123GXL LaunchPad is not working with our TI provided USB examples? The only hardware issues I could think of then are that either you have a faulty USB cable, or that the right USB port is not being used. Do you have two USB cables plugged in? If not, you cannot use the ICDI port for USB. The ICDI is for programming and backchannel UART. USB is only offered on the port on the left hand side of the board.

    Did you make any changes to the TivaWare project? If you want to attach it, I can test it out on my LaunchPad?

    Do you see any indication a USB device is noticed by Windows 10 in device manager?
  • Ralph, 1st of all thank you so much for your time. Yes,EK-TM4C123GXL LaunchPad is not working with TI provided USB example(usb_bulk_dev), that is true.
    I'm using 2 cables in ||- one for icdi, one for device usb connector. so, the UART is working, I'm able to print out msgs from my routine. The functionality of USB0 peripheral module is at question.

  • Ralph, Win10 see ICDI , but not recognise it - that is clearly driver issue, the device side of usb isn't seen by win10- and this is hardware issue, as it is proved on linux OS. Interrupt status register has 0 state and isn't changing the state, regardless of host signals, that are viewable with wireshark. I will publish the code a bit later, I need to massage it a little bit to squize into A4 format.Actually, you may easy check status of registerUSB0_BASE+ USB_O_IS, no need for my routine, that just prints out that statusof reg. in infinite loop.
    thanks,
    Alex.
  • Greetings,

    Might the 'absence' of (both)  '0Ω resistors'  R25 & R29 account for poster's situation?      Several staff members recall both resistors - in the past - being present/accounted for!

    Neither firm nor I employ USB w/this board - yet this appears  a 'reasonable' explanation...     (one hopes)

    A 'quick/dirty' test  simply sees the placement of wire jumpers at screen locations R25 & R29.      (found just above the LPad's (aka lunch box's) J1/J3 header.)

    [edit]  Staff's (working) lunch-break uncovered:

    "OTG functionality can be enabled by populating R25 and R29 with 0-Ω resistors.    These resistors connect the USB ID and USB VBUS signals to PB0 and PB1."    Thus - resistor  'addition' - may NOT prove the cure!

  • Hello cb1,

    The TivaWare usb_dev_bulk example runs fine without those resistors populated. I loaded the example usb_dev_bulk onto my EK-TM4C123GXL LaunchPad, and the device enumerated under TivaWare Bulk Devices as "Generic Bulk Device" in Windows Device Manager.

    Hello Alexander,

    I appreciate your inputs, but standing from where I am, dismissing issues like Windows Drivers so handily especially when reporting the ICDI is not recognized is an issue from my POV.

    First off let me clearly state, unless we manage to discover the LaunchPad is defective, which no evidence points to it, there is no hardware issue on the board itself. The thought this is a hardware issue and not a misunderstanding on how to utilize the example project or a Windows driver issue is mistaken.

    I have tested the usb_dev_bulk example mimicking your setup with 2 USB cables attached and using both switch configurations. The Bulk port and the ICDI port are both correctly recognized in Windows 10.

    Now Windows 10 has had it's share of issues with Tiva devices and we had to release new drivers specifically to address that. Therefore the next step I will ask you to take is to go into Device Manager and install the correct driver software for both the ICDI port and the USB Bulk port.

    The Windows USB device drivers can be downloaded from: software-dl.ti.com/.../SW-TM4C-2.1.4.178.PATCH-1.0.zip

    The Stellaris ICDI drivers can be download from: www.ti.com/.../stellaris_icdi_drivers

    Note that in Device Manager, the Bulk Device may show up under the "Universal Serial Bus controllers" menu.

    Please install these latest drivers and report back on what appears in Device Manager and if you have seen any change in functionality of the base TivaWare usb_dev_bulk example (without any modifications made!).

  • OPss!! yes, you r right! R25,29 are not populated..I do not know could it be a reason, unfortunately, my soldering station was taken by my son and I will not have it before weekend.......... So, will install shorts soon and report back after. Thank you, Ralph, for the hint. Hope all will work, when my son return me my soldering station, do not want to switch to another kit, since only Ti kit allows simultaneous usage of UART and usb, device modes.BTW, any special reason, why it usefull to eliminate R25,29?
  • Hello Alexander,

    Those resistors, as cb1 edited in his post after realizing it, are only needed for USB OTG. They have nothing to do with solving your problem. As I said in my post, the usb_dev_bulk example will run fine without them.

    Please address the points regarding drivers and that the usb_dev_bulk example is used as delivered in TivaWare and see if that gets your board running as you are expecting.
  • Dear  RAlph, I populated the  R25,29, and as you told it did not helped. I can't make usb_dev_bulk from SW-TM4C-2.1.4.178/examples/boards/dk-tm4c123g   working. Could you please publish your working code tp let me try it? The  one that I downloaded from TI site a l-o-o-ong time ago refuse to enumerate and even isn't compatible with LED blink.
    Thanks,

    Alex

  • Ralph,is the SW-TM4C-2.1.4.178/examples/boards/dk-tm4c123g/usb_dev_bulk is the latest and greatest example? I'm using it and it doesn't work!! Drivers are all refreshed!!!! Any other thoughts? May you please zip and publish your working code??
    Alex.
  • Hello Alexander,

    I think this explains the issue... my understanding is the board you have is the EK-TM4C123GXL. The DK-TM4C123G is a very different board and the software examples aren't directly compatible!

    Please look for the same example in the SW-TM4C-2.1.4.178/examples/boards/ek-tm4c123gxl folder and try that.

  • //*****************************************************************************
    //
    // usb_dev_bulk.c - Main routines for the generic bulk device example.
    //
    // Copyright (c) 2011-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 DK-TM4C123G Firmware Package.
    //
    //*****************************************************************************
    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_memmap.h"
    #include "driverlib/debug.h"
    #include "driverlib/gpio.h"
    #include "driverlib/sysctl.h"
    
    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/hw_ints.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/debug.h"
    #include "driverlib/fpu.h"
    #include "driverlib/gpio.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/systick.h"
    #include "driverlib/timer.h"
    #include "driverlib/uart.h"
    #include "driverlib/rom.h"
    #include "grlib/grlib.h"
    #include "usblib/usblib.h"
    #include "usblib/usb-ids.h"
    #include "usblib/device/usbdevice.h"
    #include "usblib/device/usbdbulk.h"
    #include "utils/uartstdio.h"
    #include "utils/ustdlib.h"
    #include "drivers/cfal96x64x16.h"
    #include "usb_bulk_structs.h"
    
    //*****************************************************************************
    //
    //! \addtogroup example_list
    //! <h1>USB Generic Bulk Device (usb_dev_bulk)</h1>
    //!
    //! This example provides a generic USB device offering simple bulk data
    //! transfer to and from the host.  The device uses a vendor-specific class ID
    //! and supports a single bulk IN endpoint and a single bulk OUT endpoint.
    //! Data received from the host is assumed to be ASCII text and it is
    //! echoed back with the case of all alphabetic characters swapped.
    //!
    //! A Windows INF file for the device is provided on the installation CD and
    //! in the C:/ti/TivaWare_C_Series-x.x/windows_drivers directory of TivaWare
    //! releases.  This INF contains information required to install the WinUSB
    //! subsystem on WindowsXP and Vista PCs.  WinUSB is a Windows subsystem
    //! allowing user mode applications to access the USB device without the need
    //! for a vendor-specific kernel mode driver.
    //!
    //! A sample Windows command-line application, usb_bulk_example, illustrating
    //! how to connect to and communicate with the bulk device is also provided.
    //! The application binary is installed as part of the ``TivaWare for C Series
    //! PC Companion Utilities'' package (SW-TM4C-USB-WIN) on the installation CD
    //! or via download from http://www.ti.com/tivaware .  Project files are
    //! included to allow the examples to be built using 
    //! Microsoft Visual Studio 2008.  Source code for this application can be
    //! found in directory ti/TivaWare_C_Series-x.x/tools/usb_bulk_example.
    //
    //*****************************************************************************
    void gpio4led_init(void);
    void gpio4led_init(void)
    {
        //
        // Enable the GPIO port that is used for the on-board LED.
        //
    HEllo Ralph, thank you so much for your help. I copied my code below per your request. It is original usb_dev_bulk Ti's example, I only copied     LED related lines from blink Ti's example, to indicate that rthe routin is flasghed and running T issues - as I reported before:
    1. Thy system failed to enumerate device, no any debug output from usb module on /dev/ttyACM0, that means that USB0 module is dead




    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // // Check if the peripheral access is enabled. // while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOF)) { ;; }; // // Enable the GPIO pin for the LED (PF3). Set the direction as output, and // enable the GPIO pin for digital function. // GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,0xf); } //***************************************************************************** // // The system tick rate expressed both as ticks per second and a millisecond // period. // //***************************************************************************** #define SYSTICKS_PER_SECOND 100 #define SYSTICK_PERIOD_MS (1000 / SYSTICKS_PER_SECOND) //0x08-green ox02-red 0x04-blue uint8_t led=0x02; //***************************************************************************** // // The global system tick counter. // //***************************************************************************** volatile uint32_t g_ui32SysTickCount = 0; volatile uint32_t g_ui32Flags = 0; //***************************************************************************** // // Variables tracking transmit and receive counts. // //***************************************************************************** volatile uint32_t g_ui32TxCount = 0; volatile uint32_t g_ui32RxCount = 0; #ifdef DEBUG uint32_t g_ui32UARTRxErrors = 0; #endif //***************************************************************************** // // Debug-related definitions and declarations. // // Debug output is available via UART0 if DEBUG is defined during build. // //***************************************************************************** //***************************************************************************** // // Map all debug print calls to UARTprintf in debug builds. // //***************************************************************************** #define DEBUG_PRINT UARTprintf //***************************************************************************** // // Compile out all debug print calls in release builds. // //***************************************************************************** //#define DEBUG_PRINT while(0) ((int32_t (*)(char *, ...))0) //***************************************************************************** // // Graphics context used to show text on the color LCD display. // //***************************************************************************** tContext g_sContext; //***************************************************************************** // // Flags used to pass commands from interrupt context to the main loop. // //***************************************************************************** #define COMMAND_PACKET_RECEIVED 0x00000001 #define COMMAND_STATUS_UPDATE 0x00000002 char *g_pcStatus; //***************************************************************************** // // Global flag indicating that a USB configuration has been set. // //***************************************************************************** static volatile bool g_bUSBConfigured = false; //***************************************************************************** // // The error routine that is called if the driver library encounters an error. // //***************************************************************************** #ifdef DEBUG void __error__(char *pcFilename, uint32_t ui32Line) { UARTprintf("Error at line %d of %s\n", ui32Line, pcFilename); while(1) { } } #endif //***************************************************************************** // // Interrupt handler for the system tick counter. // //***************************************************************************** void SysTickIntHandler(void) { // // Update our system tick counter. // g_ui32SysTickCount++; } //***************************************************************************** // // Receive new data and echo it back to the host. // // \param psDevice points to the instance data for the device whose data is to // be processed. // \param pi8Data points to the newly received data in the USB receive buffer. // \param ui32NumBytes is the number of bytes of data available to be processed. // // This function is called whenever we receive a notification that data is // available from the host. We read the data, byte-by-byte and swap the case // of any alphabetical characters found then write it back out to be // transmitted back to the host. // // \return Returns the number of bytes of data processed. // //***************************************************************************** static uint32_t EchoNewDataToHost(tUSBDBulkDevice *psDevice, uint8_t *pi8Data, uint_fast32_t ui32NumBytes) { uint_fast32_t ui32Loop, ui32Space, ui32Count; uint_fast32_t ui32ReadIndex; uint_fast32_t ui32WriteIndex; tUSBRingBufObject sTxRing; // // Get the current buffer information to allow us to write directly to // the transmit buffer (we already have enough information from the // parameters to access the receive buffer directly). // USBBufferInfoGet(&g_sTxBuffer, &sTxRing); // // How much space is there in the transmit buffer? // ui32Space = USBBufferSpaceAvailable(&g_sTxBuffer); // // How many characters can we process this time round? // ui32Loop = (ui32Space < ui32NumBytes) ? ui32Space : ui32NumBytes; ui32Count = ui32Loop; // // Update our receive counter. // g_ui32RxCount += ui32NumBytes; // // Dump a debug message. // DEBUG_PRINT("Received %d bytes\n", ui32NumBytes); // // Set up to process the characters by directly accessing the USB buffers. // ui32ReadIndex = (uint32_t)(pi8Data - g_pui8USBRxBuffer); ui32WriteIndex = sTxRing.ui32WriteIndex; while(ui32Loop) { // // Copy from the receive buffer to the transmit buffer converting // character case on the way. // // // Is this a lower case character? // if((g_pui8USBRxBuffer[ui32ReadIndex] >= 'a') && (g_pui8USBRxBuffer[ui32ReadIndex] <= 'z')) { // // Convert to upper case and write to the transmit buffer. // g_pui8USBTxBuffer[ui32WriteIndex] = (g_pui8USBRxBuffer[ui32ReadIndex] - 'a') + 'A'; } else { // // Is this an upper case character? // if((g_pui8USBRxBuffer[ui32ReadIndex] >= 'A') && (g_pui8USBRxBuffer[ui32ReadIndex] <= 'Z')) { // // Convert to lower case and write to the transmit buffer. // g_pui8USBTxBuffer[ui32WriteIndex] = (g_pui8USBRxBuffer[ui32ReadIndex] - 'Z') + 'z'; } else { // // Copy the received character to the transmit buffer. // g_pui8USBTxBuffer[ui32WriteIndex] = g_pui8USBRxBuffer[ui32ReadIndex]; } } // // Move to the next character taking care to adjust the pointer for // the buffer wrap if necessary. // ui32WriteIndex++; ui32WriteIndex = (ui32WriteIndex == BULK_BUFFER_SIZE) ? 0 : ui32WriteIndex; ui32ReadIndex++; ui32ReadIndex = (ui32ReadIndex == BULK_BUFFER_SIZE) ? 0 : ui32ReadIndex; ui32Loop--; } // // We've processed the data in place so now send the processed data // back to the host. // USBBufferDataWritten(&g_sTxBuffer, ui32Count); DEBUG_PRINT("Wrote %d bytes\n", ui32Count); // // We processed as much data as we can directly from the receive buffer so // we need to return the number of bytes to allow the lower layer to // update its read pointer appropriately. // return(ui32Count); } //***************************************************************************** // // Shows the status string on the display. // // \param psContext is a pointer to the graphics context representing the // display. // \param pi8Status is a pointer to the string to be shown. // //***************************************************************************** void DisplayStatus(tContext *psContext, char *pcStatus) { // // Clear the line with black. // GrContextForegroundSet(&g_sContext, ClrBlack); GrStringDrawCentered(psContext, " ", -1, GrContextDpyWidthGet(psContext) / 2, 16, true); // // Draw the new status string // DEBUG_PRINT("%s\n", pcStatus); GrContextForegroundSet(&g_sContext, ClrWhite); GrStringDrawCentered(psContext, pcStatus, -1, GrContextDpyWidthGet(psContext) / 2, 16, true); } //***************************************************************************** // // Handles bulk driver notifications related to the transmit channel (data to // the USB host). // // \param pvCBData is the client-supplied callback pointer for this channel. // \param ui32Event identifies the event we are being notified about. // \param ui32MsgValue is an event-specific value. // \param pvMsgData is an event-specific pointer. // // This function is called by the bulk driver to notify us of any events // related to operation of the transmit data channel (the IN channel carrying // data to the USB host). // // \return The return value is event-specific. // //***************************************************************************** uint32_t TxHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue, void *pvMsgData) { // // We are not required to do anything in response to any transmit event // in this example. All we do is update our transmit counter. // if(ui32Event == USB_EVENT_TX_COMPLETE) { g_ui32TxCount += ui32MsgValue; } // // Dump a debug message. // DEBUG_PRINT("TX complete %d\n", ui32MsgValue); return(0); } //***************************************************************************** // // Handles bulk driver notifications related to the receive channel (data from // the USB host). // // \param pvCBData is the client-supplied callback pointer for this channel. // \param ui32Event identifies the event we are being notified about. // \param ui32MsgValue is an event-specific value. // \param pvMsgData is an event-specific pointer. // // This function is called by the bulk driver to notify us of any events // related to operation of the receive data channel (the OUT channel carrying // data from the USB host). // // \return The return value is event-specific. // //***************************************************************************** uint32_t RxHandler(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue, void *pvMsgData) { // // Which event are we being sent? // switch(ui32Event) { // // We are connected to a host and communication is now possible. // case USB_EVENT_CONNECTED: { g_bUSBConfigured = true; g_pcStatus = "Host connected."; g_ui32Flags |= COMMAND_STATUS_UPDATE; // // Flush our buffers. // USBBufferFlush(&g_sTxBuffer); USBBufferFlush(&g_sRxBuffer); break; } // // The host has disconnected. // case USB_EVENT_DISCONNECTED: { g_bUSBConfigured = false; g_pcStatus = "Host disconn."; g_ui32Flags |= COMMAND_STATUS_UPDATE; break; } // // A new packet has been received. // case USB_EVENT_RX_AVAILABLE: { tUSBDBulkDevice *psDevice; // // Get a pointer to our instance data from the callback data // parameter. // psDevice = (tUSBDBulkDevice *)pvCBData; // // Read the new packet and echo it back to the host. // return(EchoNewDataToHost(psDevice, pvMsgData, ui32MsgValue)); } // // Ignore SUSPEND and RESUME for now. // case USB_EVENT_SUSPEND: case USB_EVENT_RESUME: break; // // Ignore all other events and return 0. // default: break; } return(0); } //***************************************************************************** // // Configure the UART and its pins. This must be called before UARTprintf(). // //***************************************************************************** void ConfigureUART(void) { // // Enable the GPIO Peripheral used by the UART. // ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); // // Enable UART0 // ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); // // Configure GPIO Pins for UART mode. // ROM_GPIOPinConfigure(GPIO_PA0_U0RX); ROM_GPIOPinConfigure(GPIO_PA1_U0TX); ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); // // Use the internal 16MHz oscillator as the UART clock source. // UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC); // // Initialize the UART for console I/O. // UARTStdioConfig(0, 115200, 16000000); // UARTStdioConfig(0, 115200, 16000000); } //***************************************************************************** // // This is the main application entry function. // //***************************************************************************** int main(void) { volatile uint32_t ui32Loop; uint32_t ui32TxCount; uint32_t ui32RxCount; tRectangle sRect; char pcBuffer[16]; // Enable lazy stacking for interrupt handlers. This allows floating-point // instructions to be used within interrupt handlers, but at the expense of // extra stack usage. // ROM_FPULazyStackingEnable(); // // Set the clocking to run from the PLL at 50MHz // ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); ConfigureUART(); gpio4led_init(); DEBUG_PRINT("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.Tiva C Hello USB>>>>>>>>>>>>>>>>>>>>>\n"); goto usbinit; //goto mainloop; // // Not configured initially. // g_bUSBConfigured = false; // // Initialize the display driver. //CFAL96x64x16Init(); // // Initialize the graphics context. // GrContextInit(&g_sContext, &g_sCFAL96x64x16); // // Fill the top part of the screen with blue to create the banner. // sRect.i16XMin = 0; sRect.i16YMin = 0; sRect.i16XMax = GrContextDpyWidthGet(&g_sContext) - 1; sRect.i16YMax = 9; // GrContextForegroundSet(&g_sContext, ClrDarkBlue); GrRectFill(&g_sContext, &sRect); // // Change foreground for white text. // GrContextForegroundSet(&g_sContext, ClrWhite); // // Put the application name in the middle of the banner. // GrContextFontSet(&g_sContext, g_psFontFixed6x8); GrStringDrawCentered(&g_sContext, "usb-dev-bulk", -1, GrContextDpyWidthGet(&g_sContext) / 2, 4, 0); // // Show the various static text elements on the color STN display. // GrStringDraw(&g_sContext, "Tx bytes:", -1, 0, 32, false); GrStringDraw(&g_sContext, "Rx bytes:", -1, 0, 42, false); // // Enable the GPIO peripheral used for USB, and configure the USB // pins. // // Enable the system tick. // ROM_SysTickPeriodSet(ROM_SysCtlClockGet() / SYSTICKS_PER_SECOND); ROM_SysTickIntEnable(); ROM_SysTickEnable(); usbinit: ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL); ROM_GPIOPinTypeUSBAnalog(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1); ROM_GPIOPinTypeUSBAnalog(GPIO_PORTL_BASE, GPIO_PIN_6 | GPIO_PIN_7); // // Show the application name on the display and UART output. // DEBUG_PRINT("\nTiva C Series USB bulk device example\n"); DEBUG_PRINT("---------------------------------\n\n"); // // Tell the user what we are up to. // DisplayStatus(&g_sContext, "Configuring USB"); // // Initialize the transmit and receive buffers. // USBBufferInit(&g_sTxBuffer); USBBufferInit(&g_sRxBuffer); // // Pass our device information to the USB library and place the device // on the bus. // USBDBulkInit(0, &g_sBulkDevice); // // Wait for initial configuration to complete. //DisplayStatus(&g_sContext, "Waiting for host"); // // Clear our local byte counters. // ui32RxCount = 0; ui32TxCount = 0; // // Main application loop. // // mainloop: while(1) { // // Turn on the LED. // GPIOPinWrite(GPIO_PORTF_BASE, led, led); // // Delay for a bit. // for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++) { ;; }; // // Turn off the LED. // GPIOPinWrite(GPIO_PORTF_BASE,led, 0x0); // // Delay for a bit. // for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++) { ;; }; // // Have we been asked to update the status display? // if(g_ui32Flags & COMMAND_STATUS_UPDATE) { // // Clear the command flag // g_ui32Flags &= ~COMMAND_STATUS_UPDATE; DisplayStatus(&g_sContext, g_pcStatus); } // // Has there been any transmit traffic since we last checked? // if(ui32TxCount != g_ui32TxCount) { // // Take a snapshot of the latest transmit count. // ui32TxCount = g_ui32TxCount; // // Update the display of bytes transmitted by the UART. // usnprintf(pcBuffer, 16, " %d ", ui32TxCount); GrStringDraw(&g_sContext, pcBuffer, -1, 48, 32, true); } // // Has there been any receive traffic since we last checked? // if(ui32RxCount != g_ui32RxCount) { // // Take a snapshot of the latest receive count. // ui32RxCount = g_ui32RxCount; // // Update the display of bytes received by the UART. // usnprintf(pcBuffer, 16, " %d ", ui32RxCount); GrStringDraw(&g_sContext, pcBuffer, -1, 48, 42, true); } } }

  • Hello Alexander,

    Can you elaborate why you posted that code? You just need to import the correct CCS projects for your specific evaluation board.
  • Hello Ralph,

    q1. I posted this code because on your reply you mentioned that you may try it in your environment, if I publish it

    2. I posted it in hope that someone may spot an error

    3. I try usb_dev_bulk project from ek.-123gxl folder. the result is the same!!! nor linux, nor windows enumerates it proper!

    4. An attempt to install win drivers from D:\SW-TM4C-2.1.4.178.PATCH-1.0(1)\windows_drivers cause error, see snapshot below

    5. Device manager see the board as ICDI- this is correct and  as a Generic bulk driver - correct, but OS failed to read device descriptor proper...

  • Hello Alexander,

    The hash file error occurred with a date mismatch with the device drivers a few releases ago. However, that is resolved in the latest drivers and I went back to confirm that is the case.

    Can you try uninstalling the current driver for the Bulk Device and then attempting to re-install with the Patch driver? That potentially could fix it.

    Maybe that will work, but my bigger concern would be that it may not uninstall the prior driver thoroughly enough to resolve the issue.

    Right now what probably is occurring is that there is another driver already installed using the same .inf name. We have seen that error with drivers that have been changed to include different devices, but the original was still installed by the same .inf name. The driver files are stored by the .inf file name, and having multiple but different drivers using the name confuses Windows. So if that original remains then Windows may continue to get it's wires crossed.
  • Ralph, following your instructions I copied original usb_dev_bulk project into Windows domain and opened it with ccs. However an attempt to build it printed out further errors:

    **** Build of configuration Debug for project usb_dev_bulk **** aaaany thoughts about it? Would you be so kind to publishyour working code? Is it anyhow different from officially released example?
    Best,
    Alex.

    "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k all Building target: "usb_dev_bulk.out" Invoking: ARM Linker "C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.2.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -O2 --define=ccs="ccs" --define=PART_LM4F120H5QR --define=TARGET_IS_BLIZZARD_RA1 --define=UART_BUFFERED --define=PART_TM4C123GH6PM -g --gcc --diag_warning=225 --display_error_number --gen_func_subsections=on --abi=eabi --ual -z -m"usb_dev_bulk_ccs.map" --heap_size=0 --stack_size=1024 -i"C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.2.LTS/lib" -i"C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.2.LTS/include" --reread_libs --display_error_number --warn_sections --xml_link_info="usb_dev_bulk_linkInfo.xml" --rom_model -o "usb_dev_bulk.out" "./startup_ccs.obj" "./usb_bulk_structs.obj" "./usb_dev_bulk.obj" "./utils/uartstdio.obj" "./utils/ustdlib.obj" "../tm4c123gh6pm.cmd" "../usb_dev_bulk_ccs.cmd" -llibc.a -l"C:/StellarisWare/driverlib/ccs-cm4f/Debug/driverlib-cm4f.lib" -l"C:/StellarisWare/usblib/ccs-cm4f/Debug/usblib-cm4f.lib" <Linking> "../usb_dev_bulk_ccs.cmd", line 47: error #10263: FLASH memory range has already been specified "../usb_dev_bulk_ccs.cmd", line 47: error #10264: FLASH memory range overlaps existing memory range FLASH "../usb_dev_bulk_ccs.cmd", line 49: error #10263: SRAM memory range has already been specified "../usb_dev_bulk_ccs.cmd", line 49: error #10264: SRAM memory range overlaps existing memory range SRAM "../usb_dev_bulk_ccs.cmd", line 70: warning #10190-D: absolute symbol "__STACK_TOP" being redefined "../usb_dev_bulk_ccs.cmd", line 70: warning #10190-D: absolute symbol "__STACK_TOP" being redefined "../usb_dev_bulk_ccs.cmd", line 70: warning #10190-D: absolute symbol "__STACK_TOP" being redefined error #10010: errors encountered during linking; "usb_dev_bulk.out" not built >> Compilation failure makefile:149: recipe for target 'usb_dev_bulk.out' failed gmake: *** [usb_dev_bulk.out] Error 1 gmake: Target 'all' not remade because of errors. **** Build Finished ****

  • UB0 module controlled by stellaris usblib still failed to enumerate, particularly, descriptor isn't Tx-ed proper during enumeration process However it is definitely correct point , thank you very much for it!
    Alex.
  • Hello Alexander,

    I have made zero modifications from what is delivered with TivaWare.

    It looks on the surface like your project somehow has multiple .cmd files now.

    You mention 'copy' with regards to the CCS project, that makes me weary you didn't add it to CCS correctly.

    DId you use the Project -> Import CCS Project option? That is how you should add the project to CCS. By directing to the the folder C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c123gxl\usb_dev_bulk it will pull the CCS project from TivaWare and link all dependencies correctly.
  • Ralph, I'm trying to compile C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c123gxl/usb_dev_bulk and have following errors:
    LD gcc/usb_dev_bulk.axf startup_gcc.o:(.isr_vector+0x0): multiple definition of `g_pfnVectors' gcc/startup_gcc.o:(.isr_vector+0x0): first defined here startup_gcc.o: In function `ResetISR': startup_gcc.c:(.text.ResetISR+0x0): multiple definition of `ResetISR' gcc/startup_gcc.o:startup_gcc.c:(.text.ResetISR+0x0): first defined here gcc/startup_gcc.o:(.isr_vector+0xf0): undefined reference to `USB0_ISR_handler' startup_gcc.o:(.isr_vector+0xf0): undefined reference to `USB0_ISR_handler' make: *** [..//makedefs:223: gcc/usb_dev_bulk.axf] Error 1

    I imported project, not copyed it. Are you still insisting that it is windows driver problem?? I searched through all folders in C:/ti and discovered that USB0_ISR_handler is nowhere defined. No wonder code failed to enumerate... May I ask fifth time: Would you be so kind to publish your working example?YOU told that you did not modified official Ti example, so publishing would not cause any violation. The only explanation I have - I do not have official Ti example properly downloaded....That is why I ask you to publish example code...
    Best,

    Alex.

  • Hello Alexander,

    Those errors appear to be from GCC Compiler, not CCS. Which Compiler are you using?

    I'll attach my project but the build issue isn't going to be project related...

    All I have done is correct imported the example from TivaWare and then zipped it from my workspace: 8741.usb_dev_bulk.zip

  • Ralph, errors generated by gcc, but caused by code, isn't it?

  • Hello Alexander,

    I am not familiar with GCC, so I can't really speak to what is causing those errors. Is there any particular reason you swapped from CCS to GCC?

    Also I agree that USB0_ISR_handler isn't in TivaWare. I don't know where you got that function from if you didn't add it yourself. Note that if you import a project into CCS, then it lives in your workspace and not TivaWare, so any mods would not show up in TivaWare. If you inherited a project from someone else, that could be why the USB0_ISR_handler is present?
  • In other words, usually errors caused by code, not compiler, right? I choose GCC, because I already have working gcc toolchain for Arm Mcu-s CCS is just IDE, and I have much more powerfull tools installed, while prefer plain aditors and CLI.
    THanks,
    Alex.
  • Hello Alexander,

    Not all errors that can occur are code related, some can be linker/compiler related, but reviewing the ones you are running into, they are definitely code related. The ISR is not defined properly and there is a duplicate declarations of g_pfnVectors.
  • Correct!please note, that  this code obtained with  tirex, that is why I asked you, whether you can publish your working code,known to enumerate properly, to compare apples with apples and exclude other things, but code itself and libraries.
    Thanks,

    Alex.

  • Hello Alexander,

    I provided it here: e2e.ti.com/.../2660799
  • Also since you mentioned tirex, I tested out the project both via download and CCS Cloud and have no issues building or getting the bulk device to enumerate within my Windows 10 system after loading the code to the LaunchPad.
  • Hello Ralph, thank you very much for sharing working example. I imported project from your archive in win10 enviroment. but attempt to compile it failed with the following errors:

    so, somehow usb_dev_bulk_ccs.cmd file got corrupted or my env. isn't tuned very well, I have all ibraries in C:\StellarisWare and toolchain in C:\ti- all installed from Ti's exe files with default settings.

    However in my linux environment I compiled code succesfully, but it still failed to enumerate, but printed out some messages related to usb. That make me think that I do not have proper version of usblib library FRankly Speaking at this point I'm lost and do not know how to make Ti's usb_dev_bulk example working....
    Thank you for your efforts to help me. May be you can point me, where can I download latest usblib?
    Sincerely,
    Alex.

  • Hello Alexander,

    You can download TivaWare from: http://www.ti.com/tool/SW-TM4C This has usblib, all examples, all documentation etc.

    You shouldn't be using anything from StellarisWare, that may be part of the issue with conflicts.

    Also you may want to consider using a fresh CCS workspace in case something with that CCS workspace is contributing to the issue. I'm not expert with CCS but I've heard of times that fresh workspaces help resolve odd linking issues.