AnsweredAssumed Answered

Send multi-packet data with USB Host library

Question asked by ragazzi.valerio on Dec 2, 2015
Latest reply on Apr 26, 2018 by Frost Lin
Hi, I'm using the STM32F407 with USB Host library, in high-speed.
I want to communicate via USB with a smartphone.
When i send a packet of 64 bytes everything works. If I send a packet, for example, of 94 bytes, the first time send all 94 bytes, the second time I tried again to send 94 bytes or less, the smartphone receives the last 94 - 64 = 30 bytes. Why?

This
is my code for sending:

uint8_t do_ping = 1;
uint8_t buff[512];
sprintf(buff,"CAN source address: %d \n TSC1 speed [rpm]: %d "
            "\n Override Control mode: \n Override priority: \n", buff_TSC1.address, speed_rpm);
USBH_Delay(800);
while(USBH_OK != USBH_BulkSendData (&hUSB_Host, buff, strlen(buff), pipe_numOUT, do_ping));
USBH_Delay(500);

Someone can explain me how sending multi packet? Thank you



Outcomes