Author Topic: My USB HID and Generic_Hid Code  (Read 6121 times)

CodeFreak

  • Member
  • ***
  • Posts: 2
My USB HID and Generic_Hid Code
« on: October 31, 2017, 07:38:34 am »
Dear friends
Hope everything be at your convenience.
I'm beginner in Coding. I just configured my own device and as I compile and execute generic_hid.c code, following message will appear;

Code: [Select]
Unable to find the device.
both code and my device configuration has been attached.
Thanks

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: My USB HID and Generic_Hid Code
« Reply #1 on: October 31, 2017, 09:18:42 am »
Windows Device Manager will tell you if the device installed. If not, check the setupapi device installation file:

https://docs.microsoft.com/en-us/windows-hardware/drivers/install/setupapi-device-installation-log-entries

If yes, use single-stepping and breakpoints to determine what your application is seeing when it looks for the device.

A protocol analyzer can also offer clues:

http://janaxelson.com/development_tools.htm#analyzers

CodeFreak

  • Member
  • ***
  • Posts: 2
Re: My USB HID and Generic_Hid Code
« Reply #2 on: November 02, 2017, 03:41:17 am »
Dear Jan Axelson
Thanks for your reply. Information in "USB_Cfg.txt" file acquired by Ubuntu terminal. And I'm sure that the OS detected my device.
but as I try to debug and execute generic_hid.c compiled file, following note appears;

Code: [Select]
141      int r = 1;
(gdb) s
143      r = libusb_init(NULL);
(gdb)
libusb_init (context=0x0) at core.c:2063
2063 {
(gdb)
2065 char *dbg = getenv("LIBUSB_DEBUG");
(gdb)
2063 {
(gdb)
2065 char *dbg = getenv("LIBUSB_DEBUG");
(gdb)
__GI_getenv (name=name@entry=0x7ffff7bce296 "LIBUSB_DEBUG") at getenv.c:34
34 getenv.c: No such file or directory.
(gdb)
35 in getenv.c
(gdb)
strlen () at ../sysdeps/x86_64/strlen.S:66
66 ../sysdeps/x86_64/strlen.S: No such file or directory.
(gdb)
67 in ../sysdeps/x86_64/strlen.S
(gdb)
68 in ../sysdeps/x86_64/strlen.S
(gdb)


I don't have any idea, what should I do.
« Last Edit: November 02, 2017, 08:05:10 am by CodeFreak »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: My USB HID and Generic_Hid Code
« Reply #3 on: November 02, 2017, 01:24:09 pm »
You are receiving multiple "No such file or directory" errors.

Thus I would look at your paths. A web search on this might offer some help:

"no such file or directory" linux