Skip to content
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

umtprd + functions fs Read Error (-64480) v1.3.6 #36

Closed
iabdalkader opened this issue Jun 5, 2020 · 1 comment
Closed

umtprd + functions fs Read Error (-64480) v1.3.6 #36

iabdalkader opened this issue Jun 5, 2020 · 1 comment

Comments

@iabdalkader
Copy link

Hi, I'm getting this error when trying to run umtprd with ffs: incoming_packet : Read Error (-64480)!

This is the stripped down config:

loop_on_disconnect 1
storage "/home"  "home folder" "rw"

manufacturer "test"
product "test"
serial "123456"
interface "MTP"

usb_vendor_id   0x1234
usb_product_id  0x5678
usb_class       0x6
usb_subclass    0x1     
usb_protocol    0x1     
usb_dev_version 0x3008

usb_functionfs_mode 0x1
usb_dev_path   "/dev/ffs-mtp/ep0"
usb_epin_path  "/dev/ffs-mtp/ep1"
usb_epout_path "/dev/ffs-mtp/ep2"
usb_epint_path "/dev/ffs-mtp/ep3"
usb_max_packet_size 0x200

And this is the script I use to setup the gadget and start umtprd (basically the umtprd-ffs.sh examples) I run it from /home/

#!/bin/sh

mkdir cfg
mount none cfg -t configfs

mkdir cfg/usb_gadget/g1
cd cfg/usb_gadget/g1

mkdir configs/c.1

mkdir functions/ffs.mtp

mkdir strings/0x409
mkdir configs/c.1/strings/0x409

echo 0x0100 > idProduct
echo 0x1D6B > idVendor

echo "01234567" > strings/0x409/serialnumber
echo "Viveris Technologies" > strings/0x409/manufacturer
echo "The Viveris Product !" > strings/0x409/product

echo "Conf 1" > configs/c.1/strings/0x409/configuration
echo 120 > configs/c.1/MaxPower

ln -s functions/ffs.mtp configs/c.1

mkdir /dev/ffs-mtp
mount -t functionfs mtp /dev/ffs-mtp

# Start the umtprd service
umtprd > /home/umtp_log 2>&1 &

cd /

sleep 1

# enable the usb functions
ls /sys/class/udc/ > /home/cfg/usb_gadget/g1/UDC

dmesg output on the host when the device is connected:

[ 2138.381204] usb 1-6: new high-speed USB device number 39 using xhci_hcd
[ 2138.398729] usb 1-6: New USB device found, idVendor=1d6b, idProduct=0100, bcdDevice= 4.19
[ 2138.398735] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2138.398738] usb 1-6: Product: The Viveris Product !
[ 2138.398741] usb 1-6: Manufacturer: Viveris Technologies
[ 2138.398743] usb 1-6: SerialNumber: 01234567

The output from running mtpfs on the host:

Listing raw device(s)
Device 0 (VID=1d6b and PID=0100) is UNKNOWN in libmtp v1.1.17.
Please report this VID/PID and the device model to the libmtp development team
   Found 1 device(s):
   1d6b:0100 @ bus 1, dev 39
Attempting to connect device
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device
Unable to open raw device 0

I have also attached the umtprd debug output (compiled with -DDEBUG)... Am I doing anything wrong ? Please let me know if I can help debug this better.
umtp_log.txt

@iabdalkader iabdalkader changed the title umtprd + functions fs Read Error (-64480) umtprd + functions fs Read Error (-64480) v1.3.6 Jun 5, 2020
@iabdalkader
Copy link
Author

Hi I just saw issue #27 and un-commenting the buffers fixes it. I'm Not using an iMX based hardware, maybe the defaults should be lower since this seems to be a general issue.. Anyway, thanks and sorry for the noise!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant