cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using USB Library STM32f4

ederandrade1
Associate
Posted on May 21, 2014 at 13:34

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 

#host #usb #stm32f407 #cdc
1 REPLY 1
Amel NASRI
ST Employee
Posted on May 23, 2014 at 10:55

Please try to edit your post & format the code using ''Format Code Block'' feature (see left top corner) so that it become easier to read.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.