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: No disconnect event report in usb msc device mode.

Part Number: TM4C1294NCPDT

Hi 

When I plug usb device mode into PC as MSC, the call back function can report : USB_EVENT_CONNECTED.

uint32_t USBDMSCEventCallback(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgParam, void *pvMsgData)

And the device can working well like a usb flash dongle to read write SPI nor flash.

But when I remove from PC, the USB_EVENT_DISCONNECTED doesnt issued and stay in "g_eMSCState = MSC_DEV_READ;"

I use this example code from sample code :https://github.com/yuvadm/tiva-c/tree/master/boards/dk-tm4c129x/usb_dev_msc

Any idea which steps I have confused or doing wrong?? BTW, i am working on 1294XL EVM.

  • Hi,

      We cannot support third-party project you download from github. If you want to debug their code, I will suggest you contact the author. In TivaWare library, we have a usb_dev_msc in C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\dk-tm4c129x\usb_dev_msc. Although this example is developed for a board that contains the LCD screen, you can remove code related to LCD and port the code to TM4C1294NCPDT. 

  • Thanks for yor quick reply.

    Actually I was porting from here:

     C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\dk-tm4c129x\usb_dev_msc

    Sorry for i though they are the same then let you confused. I haven't check that...

    Yes, i have remove LCD parts and DMA related.

  • Hi,

     Reading the USB library user's guide, it may have something to do with how USB0VBUS is connected.  See below.

    2.23.2.10 pfnDisconnectHandler
    The pfnDisconnectHandler callback is made whenever the USB Device API detects that the device
    has been disconnected from the bus.
    If this member of sCallbacks is set to NULL, the USB Device API does not inform the device code
    when a disconnection event occurs.
    Note: The USB_EVENT_DISCONNECTED event is not reported to the application if the MCU’s
    PB1/USB0VBUS pin is connected to a fixed +5 Volts rather than directly to the VBUS pin on the
    USB connector or if the USB controller is configured to force device mode.