devel/urjtag broken / not working?

Recently, I installed the urjtag package on my FreeBSD 11.4 machine
Code:
tingo@kg-core2$ uname -a
FreeBSD kg-core2.kg4.no 11.4-RELEASE-p3 FreeBSD 11.4-RELEASE-p3 #0: Tue Sep  1 08:22:33 UTC 2020     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
urjtag
Code:
root@kg-core2# pkg info urjtag*
urjtag-2019.12
root@kg-core2# pkg options urjtag
urjtag - FTDI: on
urjtag - JEDEC: off
urjtag - NLS: on
urjtag - PYTHON: off
urjtag - USB: on
I connected up a DirtyJTAG adapter (aka STM32 "Blue Pill" with DirtyJTAG firmware). The JTAG adapter is correctly identified:
Code:
root@kg-core2# usbconfig -d ugen0.4
ugen0.4: <DirtyJTAG Jean THOMAS> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
root@kg-core2# ls -l /dev/ugen0.4 /dev/usb/0.4.0
lrwxr-xr-x  1 root  wheel         9 Nov  4 22:18 /dev/ugen0.4 -> usb/0.4.0
crw-rw----  1 root  operator  0x2d4 Nov  4 22:18 /dev/usb/0.4.0
and it has permissions so that my user can access it:
Code:
tingo@kg-core2$ groups tingo
tingo wheel operator video dialer cups
but, urjtag doesn't want to talk to the adapter
Code:
tingo@kg-core2$ jtag

UrJTAG 2019.12 #
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors

UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.

warning: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.

jtag> cable dirtyjtag
error: Couldn't connect to suitable USB device.
jtag> quit
I also tried with [command]sudo jtag[/command] - no difference
and I tried to build urjtag from ports - it fails in the same way.
Ideas? suggestions?
 
I have (of course) verified that this hardware works on a machine with a working urjtag (no, that machine doesn't run FreeBSD). Same version of urjtag.
 
Tested on another machine today, this one running FreeBSD 12.2-release:
Code:
# freebsd-version -ku
12.2-RELEASE
12.2-RELEASE
urjtag installed from packages (quarterly)
Code:
# pkg info urjtag*
urjtag-2019.12
# pkg options urjtag
urjtag - FTDI: on
urjtag - JEDEC: off
urjtag - NLS: on
urjtag - PYTHON: off
urjtag - USB: on
dirtyjtag adapter installed and confirmed (via usbconfig) to be present and detected, permissions on device files checked. Testing:
Code:
# jtag

UrJTAG 2019.12 #
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors

UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.

warning: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.

jtag> cable dirtyjtag
error: Couldn't connect to suitable USB device.
jtag> quit
Not working. What is going on here?
 
I also tried with a freshly compiled urjtag, downloaded source, applied the path in the port and built it.
Code:
$ src/apps/jtag/jtag

UrJTAG 2019.12 #
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors

UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.

warning: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.

jtag> cable dirtyjtag
error: Couldn't connect to suitable USB device.
jtag> quit
yes, still on the FreeBSD 12.2 machine.
 
I also tested with an Altera USB Blaster cable on the FreeBSD 12.2 machine
Code:
$ src/apps/jtag/jtag

UrJTAG 2019.12 #
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors

UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.

warning: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.

jtag> cable usbblaster
Connected to libftdi driver.
jtag> detect
Segmentation fault (core dumped)
I compiled urjtag from source, but everything else is installed from packages. Perhaps this is another "package X don't work on 12.2 because it was compiled for 12.1" situation?
 
Is UrJTAG still alive? Beside docs and four 404 on their website, I can't find any contact information on urjtag.org. Is there any alternative?
 
Hello,
I didn't know urjtag. I made a test on FB 12.2 and I have the same problem here with a DirtyJTAG "bluepill" and a jlink clone (SEGGER).
 
I just did some digging. In fact libusb is not detected with configure, so no USB device is detected. Can you replace the following line in Makefile and rebuild the package
Code:
USB_CONFIGURE_ON=               --with-libusb=/usr
by
Code:
USB_CONFIGURE_ON=
It's works for me with the DirtyJTAG, but not with the jlink:
Code:
jtag> cable jlink
J-Link initial read failed, don't worry (result=0)
Vref = 0.0 TCK=0 TDI=0 TDO=0 TMS=0 TRES=1 TRST=0
error: Resetting J-Link. Please retry the cable command.
error: libusb error: Vref too low. Possibly the target isn't powered or disconnected?
but I suspect it's broken
 
Heh, let me quickly test that:
Code:
tingo@kg-core1$ jtag

UrJTAG 2019.12 #
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors

UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.

warning: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.

jtag> bsdl path /home/tingo/doc/Altera/docs/fpga/bsdl/
jtag> cable dirtyjtag
jtag> detect
IR length: 10
Chain length: 1
Device Id: 00000010000011110001000011011101 (0x020F10DD)
  Filename:     /home/tingo/doc/Altera/docs/fpga/bsdl//EP4CE6E22.bsd
jtag> quit
yes - it works. Thank you! Do you want to update the PR, oOiOo ?
 
  • Thanks
Reactions: a6h
I also re-tested the Altera USB Blaster, with the fix that oOiOo figured out:
Code:
tingo@kg-core1$ jtag

UrJTAG 2019.12 #
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors

UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.

warning: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.

jtag> bsdl path /home/tingo/doc/Altera/docs/fpga/bsdl/
jtag> cable usbblaster
Connected to libftdi driver.
jtag> detect
Segmentation fault (core dumped)
not working, seems to be a different problem.
 
yes - it works. Thank you! Do you want to update the PR, oOiOo ?
I let you do it. libusb shoud not be an option since it's in the base system.

I also re-tested the Altera USB Blaster, with the fix that oOiOo figured out:
Code:
tingo@kg-core1$ jtag

UrJTAG 2019.12 #
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors

UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.

warning: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.

jtag> bsdl path /home/tingo/doc/Altera/docs/fpga/bsdl/
jtag> cable usbblaster
Connected to libftdi driver.
jtag> detect
Segmentation fault (core dumped)
not working, seems to be a different problem.
With a little chance, a core dump can be debug with truss.
Hope this help
 
  • Thanks
Reactions: a6h
Back
Top