Blue Pill: USB CDC hangs (LED stops) when PC sends 193+ bytes at once, 192 bytes works. Known issue? #3113
Unanswered
yyoshida01234-create
asked this question in
WiKi
Replies: 1 comment
|
I need to work on the USB for the next release. It is a know issue. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm seeing a hang on a Blue Pill when receiving more than 192 bytes over USB CDC, and I'd like to know if this is a known problem or if I'm missing something.
Symptom
When the PC sends 193 bytes or more in one burst, the MCU stops completely (the LED blink in
loop()stops) and only recovers after reset / re-plug.192 bytes or fewer work fine.
Since 192 = 64 × 3, I suspect it is related to the CDC receive queue size.
Environment
Sketch (USB CDC <-> USART2 bridge)
Nothing in
loop()blocks, so I suspect the problem is in the USB CDC layer rather than the sketch.Additional tests
CDC_OUT_EPchanged fromPCD_DBL_BUFtoPCD_SNG_BUFinusbd_ep_conf.c: [NG]What I suspect
The USART side is slower than USB, so the 192-byte receive queue fills up, and the hang seems to occur when reception is resumed after the sketch reads data. This looks similar to #804 (OUT endpoint double buffer getting out of sync after NAKs), but I haven't confirmed it is the same cause.
Questions
PCD_SNG_BUFchange or a largerCDC_RECEIVE_QUEUE_BUFFER_SIZE?Thanks!
All reactions