-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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 CDC could be not flush (IDFGH-12509) #13518
Comments
Hi @yizi15 , To excluding the possibility of the ble interfere, is the problem with cdc still present when you disable the ble client and server? To have more information regarding the problem is that possible:
|
@roma-jam the code without ble is also flush fail, |
(1373950) UsbRecvCb: at msg AT+box_info? (1374073) ql_usb_flush_inter: inter free_heap 313395 min_heap 309991 (1374398) UsbRecvCb: at msg AT+box_info? (1374574) ql_usb_flush_inter: inter free_heap 313395 min_heap 309991 W (1375076) tusb_cdc_acm: Flush failed (1375075) ql_usb_flush_inter: inter free_heap 313395 min_heap 309991 W (1375577) tusb_cdc_acm: Flush failed in devKit ,the probability of this problem occurring is high, especially after plugging and unplugging the USB cable. The usb rx normal. but tx use another PC also not work. |
add some log in // pre-check to help reducing mutex lock |
Hi @yizi15, Which version of espressif TinyUSB do you use? It should be >= 0.15.0.5 (more info here: #12360 (comment)) Based on your last input, it seems that the problem is more connected to the „data transfer problem after several plug-unplug actions with usb cdc device“, not simultanious using usb and ble. Does that seem rigth? |
version of esp_tinyusb is |
@roma-jam , The version of tinyusb is 0.15.1 is version.yml but
The version of tinyusb is 0.0.0 in version.yml, version: 0.14.3`in idf_component.yml.
|
I delete before component and modify the main/idf_component.yml
This problem will still occur, but the probability has decreased
|
Great, thanks for sharing the log. (It is better to use the latest version though). Now, the logic. in the code there is a
Based in both events, the In all other cases there could be a problems on both sides, so it is better to use that strategy. |
the log is abnormal, the
|
@roma-jam Version specifications for "espressif/tinyusb" are invalid. when
|
in the umount_cb set the ready_flag false may work, after plug-unplug about 6 mins and not fail. |
Based on the example you provided, the data length should be 149 bytes. Please, review the logic of the event, when the data transfer start is triggered. |
@roma-jam my code could start the data transfer after the |
@roma-jam |
@roma-jam at the version
only the tud_umount_cb and pc cant open the serial again, the reappearance dont need pc any operator, and no matter with ready_flag
|
Hi @yizi15, Sorry for the delay. May I ask you:
Thanks. |
Hi @yizi15 , We have release new version of espressif/tinyusb (v.0.15.0~8) and it could (there is a possibility your issue is connected espressif/tinyusb#23, but I didn't get an answer on my previous question) Could you try to verify your problem with several plug/unplug with new version? Thanks |
@roma-jam the |
|
previous dont have vbus gpio init, and the init no work. the vbus pin high 2.9V, low 0.1V |
therer is a dump log, my env cant parser the dump of esp32 |
Answers checklist.
IDF version.
v5.1.2
Espressif SoC revision.
esp32s3
Operating System used.
Windows
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
PowerShell
Development Kit.
ESP32-S3-WROOM-1 MCN8R8
Power Supply used.
External 5V
What is the expected behavior?
USB CDC can work in full duplex at 5M baud rate
What is the actual behavior?
USB CDC can only receive under unknown conditions, and flush always returns a timeout(500ms). tinyusb_cdcacm_write_flush(TINYUSB_CDC_ACM_0, 500);
Steps to reproduce.
Debug Logs.
No response
More Information.
usb cdc works most of the time,and flush fail cant recover
The text was updated successfully, but these errors were encountered: