Go Down

Topic: USB state blocks on "Wait SOF" (Read 390 times) previous topic - next topic

slecorne

Hello,

I try to make working a Sparkfun USB Shield with an Arduino Mega. I have modified "USB_desc" sample sketch in order to show the current USB state with time in milliseconds (following http://www.circuitsathome.com/). I can see state changing from "Reset device" to "Wait SOF", but after nothing hapens. I have tried different USB devices connected to the USB host shield, but the behavior is always the same.

This is what is displayed :

Code: [Select]

Start
202 - 0x20: Settle
403 - 0x30: Reset device
404 - 0x40: Wait reset complete
405 - 0x50: Wait SOF


Thanks for suggestions.

St├ęphane.

slecorne

Hello,

I eventually have my joystick working !
The problem was that the MAX3421e was never set to "host" state. I modified Usb.cpp, line 465 :

Code: [Select]

        case USB_ATTACHED_SUBSTATE_SETTLE:              //setlle time for just attached device
            if( delay < millis() ) {
                // Host mode
                tmpdata = regRd(rMODE) |= 0x01;
                regWr( rMODE, tmpdata );
               
                usb_task_state = USB_ATTACHED_SUBSTATE_RESET_DEVICE;
                }
            break;


Regards.

Go Up