-
Notifications
You must be signed in to change notification settings - Fork 5
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
USB OUT stall's on high bus load #2
Comments
Hi @lichtfeind, Please excuse this delayed reply. Your point looks relevant. It has been forwarded to our development teams for further analysis. I will keep you informed. To be sure I correctly understood, you suspect the below code block to cause the issue, mainly the two successive accesses to the buffer descriptor table via the
#define USB_DRD_SET_CHEP_CNT_RX_REG(pdwReg, wCount) \
do { \
uint32_t wNBlocks; \
\
(pdwReg) &= ~(USB_CNTRX_BLSIZE | USB_CNTRX_NBLK_MSK); \
\
if ((wCount) > 62U) \
{ \
USB_DRD_CALC_BLK32((pdwReg), (wCount), wNBlocks); \
} \
else \
{ \
if ((wCount) == 0U) \
{ \
(pdwReg) |= USB_CNTRX_BLSIZE; \
} \
else \
{ \
USB_DRD_CALC_BLK2((pdwReg), (wCount), wNBlocks); \
} \
} \
} while(0) /* USB_DRD_SET_CHEP_CNT_RX_REG */ With regards, |
ST Internal Reference: 191643 |
Hi @lichtfeind, Just wondering. Did you give it another try with the latest HAL-LL version available on GitHub to see whether the problem still persists? A number of fixes have been pushed since you first created this issue, some related to the LL USB driver. Please let me know and thank you in advance. With regards, |
Hi @ALABSTM,
The issue it that there is a small window, where both |
The problematic code is still in place, maybe this version fixes other problems, but not this one. |
I have a firmware running on the NUCLEO-G0B1RE that receives bulk out transfers over USB and echos them back.
The endpoint is setup for double buffering.
At high bus load some transfers are aborted with a STALL.
The firmware is ported by @marckleinebudde can be found here https://github.com/marckleinebudde/candleLight_fw/tree/stm32g0
I suspect the cause to be in Inc/stm32g0xx_ll_usb.h#L659.
It does two writes to the buffer descriptor table.
One to clear BLSIZE, NUM_BLOCK and COUNTn_RX and one the set BLSIZE and NUM_BLOCK.
This results in a small window in which NUM_BLOCK is 0 while the endpoint is valid.
As stated in RM0444 37.5.2
So either make sure COUNTn_RX is cleared without clearing NUM_BLOCK or setting STATRX to NAK while changing the entry.
The text was updated successfully, but these errors were encountered: