Re: [comedi] dt9812.c comedi driver loading issues
fred brooks <[email protected]> Tue, 1 Apr 2025 20:10:53 -0700 (PDT)
| Newsgroups | gmane.linux.comedi |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_99352_946763111.1743563453727
Content-Type: multipart/alternative;
boundary="----=_Part_99353_657217901.1743563453727"
------=_Part_99353_657217901.1743563453727
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Great, making some progress. Used windows to load the firmware on the=20
battery powered (to the PCB) DT9812, unplugged from that and reconnected=20
the normal USB plug to the Linux machine. Driver loads to the correct=20
product ID now on Linux dt9812.=20
Now there are issues with dt9812_read_info (it does read the correct=20
serial) but at least it's alive and able to be debugged.
[17404.053736] usb 1-1.3.4: new full-speed USB device number 25 using=20
ehci-platform
[17404.246561] usb 1-1.3.4: New USB device found, idVendor=3D0867,=20
idProduct=3D9812, bcdDevice=3D 0.04
[17404.246596] usb 1-1.3.4: New USB device strings: Mfr=3D1, Product=3D2,=
=20
SerialNumber=3D0
[17404.246616] usb 1-1.3.4: Product: DT ECON DAQ
[17404.246632] usb 1-1.3.4: Manufacturer: Data Translation
[17404.264882] comedi: version 0.7.76 - http://www.comedi.org
[17404.270408] comedi comedi0: USB DT9812 (ffff.ffff.0000) #0x0117fcd4
[17404.270451] comedi comedi0: driver 'dt9812' has successfully=20
auto-configured 'dt9812'.
[17404.272462] usbcore: registered new interface driver dt9812
On Monday, March 31, 2025 at 4:48:48=E2=80=AFAM UTC-7 Ian Abbott wrote:
> Hi Fred,
>
> On 2025-03-29 20:45, 'fred brooks' via Comedi: Linux Control and=20
> Measurement Device Interface wrote:
> >=20
> > Trying to get this to work with a DT9812 but am having some strange=20
> > problems. The first thing is the returned product ID is sort of reverse=
d=20
> > from the device model.
> > usb 4-1: New USB device found, idVendor=3D0867, idProduct=3D1298,=20
> > bcdDevice=3D 0.00
> >=20
> > The driver dt9812_usb_table in dt9812.c was changed to match that numbe=
r.
> >=20
> > static const struct usb_device_id dt9812_usb_table[] =3D {
> > { USB_DEVICE(0x0867, 0x1298) },
> > { }
> > };
> >=20
> > The original value inthe driver struct was (0x0867, 0x9812)
> >=20
> > Now the recompiled dt9812 module actually loads and tried to run but=
=20
> > this is the result:
> >=20
> > [240608.280804] comedi: version 0.7.76 - http://www.comedi.org <http://=
=20
> > www.comedi.org/>
> > [240608.298984] comedi comedi0: Wrong number of endpoints
> > [240608.298990] dt9812 3-9.3:1.0: driver 'dt9812' failed to auto-=20
> > configure device.
> > [240608.299072] usbcore: registered new interface driver dt9812
> >=20
> > The number of end points returned is zero.
> [snip]
> > Running Debian 6.12.20-amd64 and I also tried with an Orange PI arm64=
=20
> > machine with the same result after the driver modifications to match=20
> > the idProduct=3D1298
> >=20
> > Source of the error message.
> > static int dt9812_find_endpoints(struct comedi_device *dev)
> > {
> > struct usb_interface *intf =3D comedi_to_usb_interface(dev);
> > struct usb_host_interface *host =3D intf->cur_altsetting;
> > struct dt9812_private *devpriv =3D dev->private;
> > struct usb_endpoint_descriptor *ep;
> > int i;
> >=20
> > if (host->desc.bNumEndpoints !=3D 5) {
> > dev_err(dev->class_dev, "Wrong number of endpoints\n");
> > return -ENODEV;
> > }
> >=20
> > Yes, the DT9812 works using the Windows driver running Win11
>
> Looking at the "DT9812_Kmdf.inf" file from the Windows drivers installed=
=20
> by the "Omni-CD"
> https://files.digilent.com/#downloads/DTSoftware/Omni-CD/
> , in
> C:\Program Files (x86)\Data Translation\DeviceDriversEV\DT9812
> , the device ID USB\VID_0867&PID_1298 appears to be a "DT9812 Firmware=20
> Loader" device. That .inf file also supports "DT9812" (PID 0x9812),=20
> "DT9813" (PID 0x9813), and "DT9814" (PID 0x9814). The "DT9812 Firmware=20
> Loader" device uses a different kernel driver (.sys) file than the others=
:
>
> * DT9812 Firmware Loader: DT9812ld_x86.sys or dt9812ld_x64.sys
> * DT9812, DT9813, DT9814: DT9812k.sys or DT9812k_x64.sys
>
> Perhaps the ID changes after the firmware is updated? Or perhaps the=20
> "DT9812 Firmware Loader" device is a hardware re-spin of the old device?=
=20
> I don't really know, to be honest.
>
> --=20
> -=3D( Ian Abbott <[email protected]> || MEV Ltd. is a company )=3D-
> -=3D( registered in England & Wales. Regd. number: 02862268. )=3D-
> -=3D( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=3D-
> -=3D( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=3D-
>
--=20
You received this message because you are subscribed to the Google Groups "=
Comedi: Linux Control and Measurement Device Interface" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/comedi_list=
/2b1c7b84-2284-4354-8ae6-43b2f09377a3n%40googlegroups.com.
------=_Part_99353_657217901.1743563453727
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Great, making some progress. Used windows to load the firmware on the batte=
ry powered (to the PCB) DT9812, unplugged from that and reconnected the nor=
mal USB plug to the Linux machine.=C2=A0 Driver loads to the correct produc=
t ID now on Linux dt9812.=C2=A0<div>Now there are issues with=C2=A0dt9812_r=
ead_info (it does read the correct serial) but at least it's alive and able=
to be debugged.</div><div><br /></div><div>[17404.053736] usb 1-1.3.4: new=
full-speed USB device number 25 using ehci-platform<br />[17404.246561] us=
b 1-1.3.4: New USB device found, idVendor=3D0867, idProduct=3D9812, bcdDevi=
ce=3D 0.04<br />[17404.246596] usb 1-1.3.4: New USB device strings: Mfr=3D1=
, Product=3D2, SerialNumber=3D0<br />[17404.246616] usb 1-1.3.4: Product: D=
T ECON DAQ<br />[17404.246632] usb 1-1.3.4: Manufacturer: Data Translation<=
br />[17404.264882] comedi: version 0.7.76 - http://www.comedi.org<br />[17=
404.270408] comedi comedi0: USB DT9812 (ffff.ffff.0000) #0x0117fcd4<br />[1=
7404.270451] comedi comedi0: driver 'dt9812' has successfully auto-configur=
ed 'dt9812'.<br />[17404.272462] usbcore: registered new interface driver d=
t9812</div><div><br /><br /></div><div class=3D"gmail_quote"><div dir=3D"au=
to" class=3D"gmail_attr">On Monday, March 31, 2025 at 4:48:48=E2=80=AFAM UT=
C-7 Ian Abbott wrote:<br/></div><blockquote class=3D"gmail_quote" style=3D"=
margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-lef=
t: 1ex;">Hi Fred,
<br>
<br>On 2025-03-29 20:45, 'fred brooks' via Comedi: Linux Control an=
d=20
<br>Measurement Device Interface wrote:
<br>>=20
<br>> Trying to get this to work with a DT9812 but am having some strang=
e=20
<br>> problems. The first thing is the returned product ID is sort of re=
versed=20
<br>> from the device model.
<br>> =C2=A0usb 4-1: New USB device found, idVendor=3D0867, idProduct=
=3D1298,=20
<br>> bcdDevice=3D 0.00
<br>>=20
<br>> The driver dt9812_usb_table in dt9812.c was changed to match that =
number.
<br>>=20
<br>> static const struct usb_device_id dt9812_usb_table[] =3D {
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 { USB_DEVICE(0x0867, 0x1298) },
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 { }
<br>> };
<br>>=20
<br>> The original value inthe driver struct was=C2=A0=C2=A0(0x0867, 0x9=
812)
<br>>=20
<br>> Now the recompiled=C2=A0 dt9812 module actually loads and tried to=
run but=20
<br>> this is the result:
<br>>=20
<br>> [240608.280804] comedi: version 0.7.76 - <a href=3D"http://www.com=
edi.org" target=3D"_blank" rel=3D"nofollow" data-saferedirecturl=3D"https:/=
/www.google.com/url?hl=3Den&q=3Dhttp://www.comedi.org&source=3Dgmai=
l&ust=3D1743636713788000&usg=3DAOvVaw1umWeHWziEPtaoBYSQ2MTI">http:/=
/www.comedi.org</a> <http://=20
<br>> <a href=3D"http://www.comedi.org/" target=3D"_blank" rel=3D"nofoll=
ow" data-saferedirecturl=3D"https://www.google.com/url?hl=3Den&q=3Dhttp=
://www.comedi.org/&source=3Dgmail&ust=3D1743636713789000&usg=3D=
AOvVaw2nBF-7VIzzdzcTDWfwv4TR">www.comedi.org/</a>>
<br>> [240608.298984] comedi comedi0: Wrong number of endpoints
<br>> [240608.298990] dt9812 3-9.3:1.0: driver 'dt9812' failed t=
o auto-=20
<br>> configure device.
<br>> [240608.299072] usbcore: registered new interface driver dt9812
<br>>=20
<br>> The number of end points returned is zero.
<br>[snip]
<br>> Running Debian=C2=A06.12.20-amd64 and I also tried with an Orange =
PI arm64=20
<br>> machine with the same result after the driver modifications=C2=A0t=
o match=20
<br>> the=C2=A0idProduct=3D1298
<br>>=20
<br>> Source of the error message.
<br>> static int dt9812_find_endpoints(struct comedi_device *dev)
<br>> {
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct usb_interface *intf =3D comedi=
_to_usb_interface(dev);
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct usb_host_interface *host =3D i=
ntf->cur_altsetting;
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct dt9812_private *devpriv =3D de=
v->private;
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct usb_endpoint_descriptor *ep;
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 int i;
<br>>=20
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (host->desc.bNumEndpoints !=3D =
5) {
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dev_err(d=
ev->class_dev, "Wrong number of endpoints\n");
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -E=
NODEV;
<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
<br>>=20
<br>> Yes, the DT9812 works using the Windows driver=C2=A0 running Win11
<br>
<br>Looking at the "DT9812_Kmdf.inf" file from the Windows driver=
s installed=20
<br>by the "Omni-CD"
<br><a href=3D"https://files.digilent.com/#downloads/DTSoftware/Omni-CD/" t=
arget=3D"_blank" rel=3D"nofollow" data-saferedirecturl=3D"https://www.googl=
e.com/url?hl=3Den&q=3Dhttps://files.digilent.com/%23downloads/DTSoftwar=
e/Omni-CD/&source=3Dgmail&ust=3D1743636713789000&usg=3DAOvVaw3P=
tbzrsBYxuf_liFfOO37U">https://files.digilent.com/#downloads/DTSoftware/Omni=
-CD/</a>
<br>, in
<br>C:\Program Files (x86)\Data Translation\DeviceDriversEV\DT9812
<br>, the device ID USB\VID_0867&PID_1298 appears to be a "DT9812 =
Firmware=20
<br>Loader" device. That .inf file also supports "DT9812" (P=
ID 0x9812),=20
<br>"DT9813" (PID 0x9813), and "DT9814" (PID 0x9814). =
The "DT9812 Firmware=20
<br>Loader" device uses a different kernel driver (.sys) file than the=
others:
<br>
<br>* DT9812 Firmware Loader: DT9812ld_x86.sys or dt9812ld_x64.sys
<br>* DT9812, DT9813, DT9814: DT9812k.sys or DT9812k_x64.sys
<br>
<br>Perhaps the ID changes after the firmware is updated? Or perhaps the=
=20
<br>"DT9812 Firmware Loader" device is a hardware re-spin of the =
old device?=20
<br>I don't really know, to be honest.
<br>
<br>--=20
<br>-=3D( Ian Abbott <<a href data-email-masked rel=3D"nofollow">abb...@=
mev.co.uk</a>> || MEV Ltd. is a company )=3D-
<br>-=3D( registered in England & Wales. Regd. number: 02862268. )=3D=
-
<br>-=3D( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=3D=
-
<br>-=3D( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || <a href=3D"http://www.=
mev.co.uk" target=3D"_blank" rel=3D"nofollow" data-saferedirecturl=3D"https=
://www.google.com/url?hl=3Den&q=3Dhttp://www.mev.co.uk&source=3Dgma=
il&ust=3D1743636713789000&usg=3DAOvVaw0bQnm93y3mi0dQ1DHIecmf">www.m=
ev.co.uk</a> )=3D-
<br></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Comedi: Linux Control and Measurement Device Interface" group.<br=
/>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">comedi_=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
comedi_list/2b1c7b84-2284-4354-8ae6-43b2f09377a3n%40googlegroups.com?utm_me=
dium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/comedi_=
list/2b1c7b84-2284-4354-8ae6-43b2f09377a3n%40googlegroups.com</a>.<br />
------=_Part_99353_657217901.1743563453727--
------=_Part_99352_946763111.1743563453727--