Skip to content

drivers: usb: stm32: usb_write size on bulk transfer problematic #49017

Answered by aurel32
JonathanVanWin asked this question in Q&A
Discussion options

You must be logged in to vote

it seems that in order to solve the bug, the hal should take care of transfers that don't finish with a short packet, send a Zero length packet.

I agree that the end of transfer is signaled from the the device side by a packet shorter than wMaxPacketSize. That said I disagree that it should be done in the HAL (or if so it should be made optional as you might want to do bulk transfers bigger than the RAM buffers). IMHO this is the responsibility of the application, which is the only one to know if the current data being sent is part of a bigger transfer or not. At least this is how this is done in Zephyr where usb_transfer() send send a ZLP by default if needed, but has the USB_TRANS_NO_ZLP

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by JonathanVanWin
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@JonathanVanWin
Comment options

@erwango
Comment options

erwango Aug 12, 2022
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug platform: STM32 ST Micro STM32
4 participants
Converted from issue

This discussion was converted from issue #47051 on August 12, 2022 12:41.