AdamLaurie / mphidflash

Automatically exported from code.google.com/p/mphidflash
GNU General Public License v3.0
31 stars 19 forks source link

Can't debug usb connection on linux (fix included) #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. connect board with PIC, forgetting to set Linux udev rules for file 
permissions
2. run "mphidflash -w EBF_EBBv13_and_above.hex -r" and receive "Error: Device 
not found (is device attached and in Bootloader mode?)"
3. run "mphidflash -d3 -w EBF_EBBv13_and_above.hex -r" and receive only the 
same error.

What is the expected output? What do you see instead?

With "-d 3" expected to see a lot of debugging output. Saw none. When I hacked 
in hid_set_usb_debug() into usb-linux.c (see patch below), I got the debug 
output I needed.

You might also want to consider changing the error message hint from "is device 
attached and in Bootloader mode?" to include something about access or 
permissions.

What version of the product are you using? On what operating system?

1.4 on Ubuntu 10.04 x86_64

Please provide any additional information below.

v1.4 Code was downloaded from
https://code.google.com/p/eggbotcode/downloads/detail?name=mphidflash_1_4.zip&ca
n=2&q=

diff -u mphidflash-1.4.orig/usb-linux.c mphidflash/usb-linux.c
--- mphidflash-1.4.orig/usb-linux.c 2010-07-09 22:02:38.000000000 -0400
+++ mphidflash/usb-linux.c  2010-12-22 12:48:48.342691545 -0500
@@ -82,6 +82,11 @@
    matcher.product_id = productID;
    matcher.matcher_fn = NULL;

+   if (debugLevel >= DEBUG_USB) {
+       hid_set_debug(HID_DEBUG_ALL);
+       hid_set_usb_debug(HID_DEBUG_ALL);
+   }
+
    if(HID_RET_SUCCESS == hid_init()) {
        status = ERR_USB_INIT2;
        if((hid = hid_new_HIDInterface())) {

Original issue reported on code.google.com by rper...@gmail.com on 22 Dec 2010 at 6:10

GoogleCodeExporter commented 8 years ago
patch applied.

Original comment by fnargwibble on 30 Jun 2014 at 7:40