uMTP-Responder icon indicating copy to clipboard operation
uMTP-Responder copied to clipboard

error when writing to cfg/usb_gadget/g1/UDC (error : Device or resource busy)

Open poelguedj opened this issue 5 years ago • 1 comments

Hello

I am trying to use uMTP-responder on a nanoPi Neo Core with a mini-shield (https://wiki.friendlyarm.com/wiki/index.php/Mini_Shield_for_NanoPi_NEO_Core/Core2) and linux armbian FriendlyArm distribution.

I have build umtprd with the Makefile with no error. Then I copied the file umtprd into /usr/bin I copied also the file umtprd.conf (from the subfolder conf) into /etc/umtprd/umtprd.conf Then I have launched the script umtprd-ffs.sh with the sudo command But the last line of the script: ls /sys/class/udc/ > cfg/usb_gadget/g1/UDC gives an error message : ls: write error: Device or resource busy

Interactively, the shell command ls /sys/class/udc works and returns musb-hdrc.4.auto

But, if I type the command echo musb-hdrc.4.auto >cfg/usb_gadget/g1/UDC, we have the same error: bash: echo: write error: Device or resource busy

Then the problem occurs when we try to write the standard output into the file cfg/usb_gadget/g1/UDC

Do you have an idea to resolve this issue on the nanopi platform ?

poelguedj avatar Mar 23 '21 16:03 poelguedj

Maybe the usb interface is already used / initialized by something else ?

jfdelnero avatar Mar 23 '21 22:03 jfdelnero