cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 USB FS Device mode Programing

Jim Chacko
Associate II

Hi.

I am using STM32F407 discovery board programed in USB FS mode. The driver used is WINUSB. mY os IS WINDOWS 10.

I am using USF FS configured as ENDP1 OUT and ENDP1 IN. Both in bulk mode. I was managed to successfully enumerated with PC and managed to send Data from my c# application. But when i try to read , it shows success but zero bytes read.

My sequence of Program is like this

1) Receive bunch od data from ENDP1 OUT Endpoint.

2) Then Prerpare reply in Buffer

3) Write XFRSIZE and PKTCNT

4) Enable CNAK & EPENA

5) Then look for DTXFSTS1 for empty status

6) Fill the FIFO from Buffer

7) exit and wait manin code till ENDP1 XFRC trigger..

Everything looks fine but after XFRC triggered, i look in DTXFSTS1, it shows only 8 bytes reduced from the original count. XFRsize, PKTCNT shows 0.

Hope to receive advise.... Thanks in advance..

11 REPLIES 11

Set DIEPCTL.CNAK and EPENA before pushing data.

JW

[double post due to forum software bug]