Is there anything special I have to do other than:
FIFORESET = 0x80; SYNCDELAY;
FIFORESET = 4; SYNCDELAY;
FIFORESET = 8; SYNCDELAY;
FIFORESET = 0x00; SYNCDELAY;
EP8AUTOINLENH = (32) >> 8; SYNCDELAY;
EP8AUTOINLENL = (32) & 0xff; SYNCDELAY;
EP4FIFOCFG = bmWORDWIDE; SYNCDELAY;
EP4FIFOCFG = bmAUTOOUT | bmWORDWIDE; SYNCDELAY;
EP8FIFOCFG = bmZEROLENIN | bmWORDWIDE; SYNCDELAY;
EP8FIFOCFG = bmZEROLENIN | bmAUTOIN | bmWORDWIDE; SYNCDELAY;
...to reset slave FIFO endpoints 4 and 8 and re-arm them? I'm trying to make my application robust against USB faults, and when I unplug the USB cable during operation, plug it back in, and reset the host program, I can't get data through endpoints 4 and 8. The above code is executed via a vendor-specific command before attempting to push data through the FIFOs. Everything works fine again after I hard reset the FX2, but after a USB fault of any kind I can't reestablish data throughput (control transactions via EP0/1 work fine), which makes me think something's not getting reset correctly. What else can I poke to clear the FX2's state properly?
Thanks,
Nick
|