Hi snoopy,

I don't have answer to you question but just sharing my thoughts.

Though double buffering is used, there will be cases when your both buffer
are filled by host and FSG has not taken data from either. In that case OUT
transactions should be NAKed by the your controller. This is generally taken
care by the controller itself in hardware.

IMHO, your last bulk out transaction is neither ACKed or NAKed by your
controller. Hence, host eventually times out and proceeds with USB bus
reset.
ACK/NAK of transaction is controller h/w job. I don't know s3c2410 h/w but
it should have some status indication for FIFO busy status for both the
buffers. Check these values when your transaction fails.

As, a trial you can make your code to respond faster. Remove all printks in
write_10 path. Even remove call to vfs_write and from file_storage.c and
simply return success there. This may lead to knew code insight as host will
receive data in sufficient time.

Thanks,
Kalpesh


2009/3/24 snoppy1314 <snoppy1...@163.com>

>            Hi, everyone:
>
> I use the s3c2410_udc.c, file_storage.c and others in drivers/usb/gadget
> to make my PDA acts as a USB disk to PC.
> When my PDA is connected with PC, it can be realized as a usb disk, I can
> also copy files from PDA to PC.But the question is:files cann't be copied
> from PC to PDA.After use BUS HOUND and printk, I found some reasons, but
> don't know how to do next.
> 1. when receive WRITE(10) from PC, PDA do as follow(it's defined in
> file_storage.c)
> 1.1 check buffer 1 is empty?--yes-->receive data from usb, and save data to
> buffer 1
> 1.2 check buffer 2 is empty?--yes-->receive data from usb, and save data to
> buffer 2
> 1.3 check buffer 1 is full?--yes-->write data in buffer 1 to Flash
>  1.4 check buffer 2 is full?--yes-->write data in buffer 2 to Flash
> 1.5 go back to 1.1, until data ends
> The question is :in step 1.1, for example, when receive 4096 bytes data
> from PC, PDA only receive 4032 bytes(receive 63 tims, for each 64 bytes),
> the last bulk_out interrupt is not received but receive a interrupt
> (EP_INT_REG=USB_INT_REG=0, PWR_REG=0, EP0_CSR=0) and after some seconds, a
> reset interrupt with bulk_out interrupt is received and usb bus is reset.
> Who can tell me how the interrupt (EP_INT_REG=USB_INT_REG=0, PWR_REG=0,
> EP0_CSR=0)  is produced when it's not EP interrupt or USB interrupt?
> Who can tell me why the last bulk_out interrupt is not received by PDA?
>
> thanks in advance!
>
> Yours 施金前
>
> 2009-03-24
> ------------------------------
> snoppy1314
>

<<spacer.gif>>

Reply via email to