-   Programming (
-   -   USB GadgetFS: write() function call blocks indefinitely (

OkCalis 09-09-2020 01:26 AM

USB GadgetFS: write() function call blocks indefinitely
I've been working on an ARM9 device with Linux kernel 3.2, which acts as a USB peripheral when connected to a PC. To this end, I use GadgetFS feature built within the kernel.
It's been working properly; however recently, I've encountered a frustrating issue: After receiving bulk commands and transmitting bulk data over USB for a random time interval, the "write()" function call starts to block indefinitely for no apparent reason, causing my Sender Posix Thread to become unresponsive. Restarting the application temporarily solves the problem (which makes me suspect that this is a software-related issue). I also tried closing the source, sink, and ep0 file descriptors and reopening them whenever this error occurs, but even after reopening the endpoints, the "write()" function never seems to work properly.
As for the source code, I'm using the one provided as an example at
What do you think could be causing this?
Thanks in advance,

astrogeek 09-15-2020 01:01 AM

Apparently not much help available for that problem here.

You might get a better response by going straight to the source where you obtained the code.

When posting questions here it is preferable to work up a minimal code example which demonstrates the problem, then post that code block along with your question. Asking others to go to another site to see your code, or to sift and debug a complete application's source code generally does not produce many interested parties.

Please review the Site FAQ for guidance in posting your questions and general forum usage. Especially, read the link in that page, How To Ask Questions The Smart Way. The more effort you put into understanding your problem and framing your questions, the better others can help!

Good luck!

All times are GMT -5. The time now is 10:45 AM.