Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stm32g0b USB stall #156

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

marckleinebudde
Copy link
Collaborator

@marckleinebudde marckleinebudde commented Jan 18, 2023

Under high CAN-TX load the endpoint on the stm32g0b will stall, this PR fixes the issue.

@marckleinebudde marckleinebudde changed the title Fix stm32g0b usb stall Fix stm32g0b USB stall Jan 18, 2023
@marckleinebudde
Copy link
Collaborator Author

marckleinebudde commented Jan 18, 2023

@lichtfeind has opened an issue STMicroelectronics/stm32g0xx-hal-driver#2 to fix this problem upstream.

ASELSTM and others added 2 commits February 13, 2023 09:20
Cherry-picked from upstream commit Fixes: e289146768cf ("[LL][USB] Use
correct macro to clear RXBD register block numbers")

https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git
Having two writes to clean and set COUNTn_RX and NUM_BLOCK results in
a small windows in which COUNTn_RX and NUM_BLOCK are zero.

This results in a stall as the buffer is empty (ready to receive) but
also has no space to receive the package into.

Signed-off-by: Jonas Martin <[email protected]>
@fenugrec fenugrec merged commit dffacde into candle-usb:master Mar 3, 2023
@fenugrec
Copy link
Collaborator

fenugrec commented Mar 3, 2023

Thanks. Sorry for the delay; I was hoping ST would update the library 'soon' as that would have been preferable to having local fixes (see #157 for my dilemma...)

@marckleinebudde marckleinebudde deleted the fix-stm32g0b-usb-stall branch March 3, 2023 20:48
@marckleinebudde
Copy link
Collaborator Author

At least it's on their dashboard now: https://github.com/orgs/STMicroelectronics/projects/3#card-87981733

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants