Custom board- problem with USB. SOLVED

Author
kuku
Junior Member
  • Total Posts : 116
  • Reward points : 0
  • Joined: 2012/03/03 08:05:54
  • Location: 0
  • Status: offline
2019/04/17 05:11:20 (permalink)
0

Custom board- problem with USB. SOLVED

I try to run USB HOST on PIC32MZ2064DAH176 device who is on my board. So, I comiple msd_basic without BSP in configuration, set up clock and add one led. It works on MEBII with DAG169 device. Problem is with my board. Here I have 12MHz oscillator so in MHC I change only some clock settings. Next, when I plug USB stick then program stay at case APP_STATE_WAIT_FOR_DEVICE_ATTACH
I look's like MZ try to talk with stick when I plug it (attachment 1 and 2) but I'm too stupid to understand what is wrong.
post edited by kuku - 2019/04/17 14:23:59

Attached Image(s)

#1

2 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 5842
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    kuku
    Junior Member
    • Total Posts : 116
    • Reward points : 0
    • Joined: 2012/03/03 08:05:54
    • Location: 0
    • Status: offline
    Re: Custom board- problem with USB 2019/04/17 09:36:50 (permalink)
    4 (2)
    Thanks for help, but still not work ;/
     
    ;)
    -----------
    Main timer work with proper frequency so clock looks ok.
    __ISR( _USB_VECTOR , IPL4AUTO)_IntHandler_USB_stub from system_interrupt.c is called when I connect/disconect stick. APP_SYSFSEventHandler is not called. 
     
    At each connection is called APP_USBHostEventHandler with case USB_HOST_EVENT_DEVICE_UNSUPPORTED
    This event is generated from usb_host.c file, function void _USB_HOST_MakeDeviceReady, exactly from this code

                case USB_HOST_DEVICE_STATE_WAITING_FOR_GET_DEVICE_DESCRIPTOR_SHORT:

                    /* Check if the Device Descriptor was obtained */
                    if ( deviceObj->controlTransferObj.controlIRP.status == USB_HOST_IRP_STATUS_COMPLETED )
                    {
                        /* The IRP completed. deviceObj->deviceDescriptor has the device
                         * descriptor. We can move to addressing state. */

                        deviceObj->deviceState = USB_HOST_DEVICE_STATE_SET_ADDRESS;

                        /* Reset the enumeration failure count */
                        deviceObj->enumerationFailCount = 0;

                        SYS_DEBUG_PRINT(SYS_ERROR_INFO, "\r\nUSB Host Layer: Bus %d Device Descriptor obtained. Setting device address.", busIndex);

                    }
                    else if ( deviceObj->controlTransferObj.controlIRP.status < USB_HOST_IRP_STATUS_COMPLETED )
                    {
                        /* The IRP failed. We will either reset the device or place
                         * it in an error state. In either case the control pipe
                         * should be closed. */

                        deviceObj->hcdInterface->hostPipeClose(deviceObj->controlPipeHandle);

                        /* Release the device is enumerating flag. This will give
                         * another device the chance to start enumerating. The
                         * enumeration of this device will be re-attempted after
                         * the possible enumeration of the other device. */
                        busObj->deviceIsEnumerating = false;

                        /* Check if we should retry the enumeration sequence */
                        if (deviceObj->enumerationFailCount < USB_HOST_ENUMERATION_RETRY_COUNT)
                        {
                            /* Yes we should retry. Update the retry count */
                            deviceObj->enumerationFailCount ++ ;

                            /* Set device state for reset */
                            deviceObj->deviceState = USB_HOST_DEVICE_STATE_WAITING_FOR_ENUMERATION;
                            SYS_DEBUG_PRINT(SYS_ERROR_DEBUG, "\r\nUSB Host Layer: Bus %d Device Descriptor Request Failed. Trying again.", busIndex);
                        }
                        else
                        {
                            /* We tried three times but were not able to get a proper
                             * device response. Place the device in an error state. */

                            deviceObj->deviceState = USB_HOST_DEVICE_STATE_ERROR;
                            SYS_DEBUG_PRINT(SYS_ERROR_DEBUG, "\r\nUSB Host Layer: Bus %d Device Request Failed 3 times. Device not supported.", busIndex);
                            if(gUSBHostObj.hostEventHandler != NULL)
                            {
                                /* Send an event to the application */
                                gUSBHostObj.hostEventHandler( USB_HOST_EVENT_DEVICE_UNSUPPORTED , NULL, gUSBHostObj.context );
                            }
                        }
                    }


    What can be mean?. Distortion on D+/D-?
    ----------------------------------------------
    SOLVED
    I delete TVS from data line. I must make mistake and place PESD5V0. It have 75pF who is definitely too much for USB.
    post edited by kuku - 2019/04/17 14:23:37
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5