|
From: <873...@qq...> - 2021-08-06 03:01:52
|
[ 3.261012] [0005034f] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 3.261555] [0005034f] libusb: debug [handle_events] poll() 3 fds with timeout in 10000ms
[ 3.342028] [00050350] libusb: debug [linux_get_device_address] getting address for device: 1-4 detached: 0
[ 3.342039] [00050350] libusb: debug [linux_get_device_address] scan 1-4
[ 3.342087] [00050350] libusb: debug [linux_get_device_address] bus=1 dev=55
[ 3.342091] [00050350] libusb: debug [udev_hotplug_event] udev hotplug event. action: bind.
[ 3.342094] [00050350] libusb: error [udev_hotplug_event] ignoring udev action bind
[13.270864] [0005034f] libusb: debug [handle_events] poll() returned 0
[13.270888] [0005034f] libusb: debug [libusb_claim_interface] interface 3
[13.463141] [0005034f] libusb: debug [libusb_alloc_transfer] transfer 0x7fab68018790
[13.463160] [0005034f] libusb: debug [libusb_submit_transfer] transfer 0x7fab68018790
[13.463352] [0005034f] libusb: error [submit_control_transfer] submiturb failed error -1 errno=16
[13.463357] [0005034f] libusb: debug [libusb_free_transfer] transfer 0x7fab68018790
-1
[13.463404] [0005034f] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[13.463408] [0005034f] libusb: debug [handle_events] poll() 3 fds with timeout in 10000ms
Hi
Above is part of the logs where error occurred,I can see that I successfully claimed the interface 3, so I assume the kernel detachment is ok ? thanks
------------------ 原始邮件 ------------------
发件人: "Xiaofan Chen"<xia...@gm...>;
发送时间: 2021年8月6日(星期五) 上午9:18
收件人: "俊哲"<873...@qq...>;
抄送: "libusb-devel"<lib...@li...>;
主题: Re: [libusb] libusb_control_transfer return -1 errorno 16
On Thu, Aug 5, 2021 at 9:04 PM 俊哲 via libusb-devel
<lib...@li...> wrote:
>
> libusb_set_auto_detach_kernel_driver(dev_handle[1], true);
> libusb_claim_interface(dev_handle[1],3);
> unsigned char buffer[3]={0x02,0x01,0x01};
> rc= libusb_control_transfer(dev_handle[1],0x21,0x09, 0x0200,0x0300,buffer, 0x0300,0);
> qDebug()<<rc;
>
> Hi, I am using the above codes snippet to send instructions to my device so that it
> can enter DFU mode, but this function returns -1 errorno 16 through libusb debugging
> function, So I am not quite sure where the problem, I am using linux os to run my
> application, however,I also used bus hound(an powerful usb app only for windows OS)
> to send these instructions, the device successfully get into its DFU mode. The interface
> number I want to send data to is 3 by the way
Did you set up udev rule correctly? Or you can run your application
with sudo first
to see if that helps. If that helps, you need to set up udev rules to
have the right
permission to detach the kernel driver.
If that is not the problem, you need to post the debug log.
--
Xiaofan |