AnsweredAssumed Answered

Problem using USB Library STM32f4

Question asked by Eder Andrade on May 21, 2014
Latest reply on May 23, 2014 by Amel N
Hello folks!

I'm developing a firmware using USB library of ST to STM32F407. My application  is a Tester that test the communication of each device and the problem is: I can test the first and second devide, but I can't go on with test routine... and I don't know what else I can do... please, If someone has already worked with this library and can help me, I'll fell glad... below my code...

USBD_Init(&USB_OTG_dev,USB_OTG_FS_CORE_ID,&USR_desc,&USBD_HID_cb,&USR_cb);
                                                                                        Delay_ms(10000);
                                                                                          /* "Conecta" o cabo USB na BeagleBone (5v, D+, D- e GND) */
                                                                                     Set_5V_GND_USB;
                                                                                                    Set_Test_BB;                                                                                                    
                                                                                                    
                                                                                                    /* Envia este vetor "Buffer_Transceive" pela USB */
                                                                                                    Buffer_Transceive[0] = 0xFF;
                                                                                                    Buffer_Transceive[1] = 'E';
                                                                                                    Buffer_Transceive[2] = 'N';
                                                                                                    Buffer_Transceive[3] = 'E';
                                                                                                    Buffer_Transceive[4] = 'R';
                                                                                                    Buffer_Transceive[5] = 'M';
                                                                                                    Buffer_Transceive[6] = 'A';
                                                                                                    Buffer_Transceive[7] = 'X';                                                                 
                                                                                                    
                                                                                                    do
                                                                                                    {
                                                                                                         USBD_HID_SendReport (&USB_OTG_dev, Buffer_Transceive, 8);     
                                                                                                         Delay_ms(500);                                                                                                         
                                                                                                    }
                                                                                                    /* Aguarda os dados retornarem */
                                                                                                    /* INCLUIR "TIMEOUT" */
                                                                                                    while(Buffer_Receive[1] == 0); 

                                                                                                         USB_OTG_StopDevice(&USB_OTG_dev);     
                                                                                                         DCD_DevDisconnect(&USB_OTG_dev);

And the code repeat to another device... is there something wrong 


Outcomes