Dear all
i play with the USB device library from the libstock, and PIC32MX450F256H.
i need to send to the host about 512 bytes.
as i read, the maximum packet size is 64 bytes, so i need to send 8 packets.
i tried in a loop with the "USBDev_SendPacket(1, @USBbuffer, 64)" procedure.
but it seem that i loose some bytes during the transaction
Please, how can i be sure that the packet is send, then i can send the next one ?
Thanks, best regards
Phil
USBDev_SendPacket(1, @USBbuffer, 64) question
- uros.cvetinovic
- mikroElektronika team
- Posts: 803
- Joined: 14 Dec 2015 09:24
Re: USBDev_SendPacket(1, @USBbuffer, 64) question
Hi Phil,
Unfortunately, we didn't test USB device library with packages which size is larger than 64 bytes.
Library is written to work within FS USB specification, therefore we can't recommend you sending packets larger than 64 bytes,
because FS USB specification allows packets with maximum sizes of 64 bytes.
It's possible to send larger packages without any loss, but it simply can't be guaranteed within the specification, so we haven't tested it.
Best regards,
Uros
Unfortunately, we didn't test USB device library with packages which size is larger than 64 bytes.
Library is written to work within FS USB specification, therefore we can't recommend you sending packets larger than 64 bytes,
because FS USB specification allows packets with maximum sizes of 64 bytes.
It's possible to send larger packages without any loss, but it simply can't be guaranteed within the specification, so we haven't tested it.
Best regards,
Uros
Re: USBDev_SendPacket(1, @USBbuffer, 64) question
Hi Phil,
There is a function USBDev_DataSentHandler(uint8_t ep) called when the packet is sent.
In my application I set a flag on this function to allow others packets to be sent.
Regards,
Rodrigo
There is a function USBDev_DataSentHandler(uint8_t ep) called when the packet is sent.
In my application I set a flag on this function to allow others packets to be sent.
Regards,
Rodrigo
Re: USBDev_SendPacket(1, @USBbuffer, 64) question
Hi All,
- ME team : as often, you read too fast ...
- Rodrigo : yes i found this DataSentHandler procedure, and try exactly as you suggest..
but unfortunately, was unlucky .. maybe a problem in my code, was late in the night !
thanks for you confirmation, will check it again
regards
- ME team : as often, you read too fast ...
- Rodrigo : yes i found this DataSentHandler procedure, and try exactly as you suggest..
but unfortunately, was unlucky .. maybe a problem in my code, was late in the night !
thanks for you confirmation, will check it again
regards
- uros.cvetinovic
- mikroElektronika team
- Posts: 803
- Joined: 14 Dec 2015 09:24
Re: USBDev_SendPacket(1, @USBbuffer, 64) question
Hi,
I just wanted to say that we can not guarantee that there wouldn't be data lost when sending packages larger than 64 bytes,
although there is a function USBDev_RegisterDataSentHandler().
As I mentioned before, unfortunately, we didn't test USB device library with packages which size is larger than 64 bytes.
But there are users, just like Rodrigo, who implemented a way to set a flag on this function to allow other packages to be sent.
Best regards,
Uros
I just wanted to say that we can not guarantee that there wouldn't be data lost when sending packages larger than 64 bytes,
although there is a function USBDev_RegisterDataSentHandler().
As I mentioned before, unfortunately, we didn't test USB device library with packages which size is larger than 64 bytes.
But there are users, just like Rodrigo, who implemented a way to set a flag on this function to allow other packages to be sent.
Best regards,
Uros
Re: USBDev_SendPacket(1, @USBbuffer, 64) question
Uros,
as just want to say that you read too fast too !
i didn't say that a send packet larger than 64 bytes !!
i try to send multiples packet of 64 bytes EACH ! .. 8 packets of 64 bytes each ..
need to investigate more with the DataSentHandler procedure
regards
as just want to say that you read too fast too !
i didn't say that a send packet larger than 64 bytes !!
i try to send multiples packet of 64 bytes EACH ! .. 8 packets of 64 bytes each ..
need to investigate more with the DataSentHandler procedure
regards