-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
jtag serial drive write function loses characters when rx ring buffer… (IDFGH-10925) #12119
Conversation
Hi @jjsch-dev usb_serial_jtag_write_bytes never returning 0 is a real issue. We will fix this. The API will return 0 when write fails. Change this to -1 is a breaking change that we can't do. From the VFS side, losing data when ringbuffer full is a expected behavior. We can't detect the connection to host, so we use the fifo overflow as indication. |
Hi @ginkgm, thanks for the explanation, if you want I'll close the PR. |
… size on success.
Hi @ginkgm, I modified the return of usb_serial_jtag_write_bytes to return 0 on failure and the size on success, and reverted the change to usbjtag_tx_char_via_driver. |
@jjsch-dev thanks for creating the PR! |
@chipweinberger, thanks for the comment. |
@jjsch-dev Yes, this time changes is absolutely correct, I already have an internal PR to fix this, and that will be merged soon. Thanks for your contribution. |
@mythbuster5, thanks for the confirmation, I will wait the merge. |
…e data randomly, Closes espressif#12119, Closes espressif#11344, Closes espressif#9318 Closes espressif#11192
upon examining the code, I noticed that the usbjtag_tx_char_via_driver function contains a comparison that checks whether an immediate send operation succeeds. However, the return value from usb_serial_jtag_write_bytes is always 1, which prevents the intended logic to try blocking for 50 mS, but also a return that always skyp the bloking try.