Closed cederom closed 4 years ago
The problem is:
pyocd/probe/pydapaccess/interface/pyusb_backend.py
, line 104
, in dev.detach_kernel_driver(interface_number)
. Simply commenting out this line allows me to debug with no problem as user. Is there any other reason we want to detach any interface here?NotImplementedError
, but does not catch usb.core.USBError: [Errno None] Other error
. Should we catch all exceptions here? Maybe except Errno None
?Any hints welcome @flit :-)
Got back to this problem even with simple pyocd reset
after update. Will look into it and propose a solution :-)
Note: All kernel modules related to umodem/ucom/u3g are unloaded and devd
is not working so no modules are loaded upon device attach. I observed a problem with umodem
module but it should not interfere with pyOCD operations right? Anyways serial port comes handy to talk with Target over DAPLink and also it is necessary for my LTE modem to operate so unloading is not an option :-)
Allright, the pyOCD tries to unload kernel driver for interface 3 on DAPLink, that is HID CMSIS-DAP. We do not really want to detach HID driver for the whole system and normal user is not permitted to. Nothing happens if we skip that unload, DAPLink works fine.. also nothing was handled in the exception handler anyway.. so I have changed source to simply catch all exceptions and print some debug and warning messages that may come useful :-)
The only minor issue left is that exception raises [None] Other error
code / message. FreeBSD has its own LibUSB implementation. It looks like the error codes may differ between implementations. Someone reported similar problem with LimeSDR device. I will look into it in a free moment.. but the blocker seems to be fixed :-)
Patch committed to the master. Closing. Thank you @flit :-)
Hello world :-) I have noticed a problem with kernel detach on usb when starting the gdbserver as standard user, it works when running as root, all permissions for user are granted to access the usb devices except kernel operations, will have to find if that detach is really necessary to operate..