Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jan 2025 00:44:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        usb@FreeBSD.org
Subject:   [Bug 284042] FTDI: UART breaks JTAG
Message-ID:  <bug-284042-19105-VKVtZjiTd5@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-284042-19105@https.bugs.freebsd.org/bugzilla/>
References:  <bug-284042-19105@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D284042

--- Comment #3 from Tomasz "CeDeROM" CEDRO <tomek@cedro.info> ---
(In reply to bsd from comment #2)
> I have 2 interfaces after connecting FTDI: /dev/cuaU0 and /dev/cuaU1.

Yup that seems to be the problem. I would try to exclude "JTAG" interface f=
rom
being attached by ucom driver (devd?) and only keep the uart port to be vis=
ible
as single /dev/cuaUn.

Maybe also this can be set inside FTDI configuration?

https://ftdichip.com/wp-content/uploads/2023/11/AN_551_FT4232HP_FT2232HP_FT=
232HP_Configuration_Guide.pdf


I have KT-LINK FT2232H based interface and it only shows as single /dev/cua=
U0:

https://ia803401.us.archive.org/34/items/manualzilla-id-5664958/5664958.pdf

Here is some history on how I added the KT-LINK to FreeBSD.. at first it was
two UART ports (/dev/cuaUn) and these were also interfering with JTAG
operations when used both at the same time but after UART was free then I w=
as
able to use JTAG again. Maybe it was exclusive I don't remember sorry.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D175893

As for today 14.2-RELEASE AMD64 I can see only one single UART port when
attaching KT-LINK. Maybe there is some quick or JTAG channel is excluded
somehow. You may use that as reference point.

ugen0.7: <Kristech KT-LINK> at usbus0
uftdi: skipping JTAG interface #0 for 'KT-LINK' at 0.7
uftdi0 on uhub17
uftdi0: <Kristech KT-LINK, class 0/0, rev 2.00/7.00, addr 6> on usbus0
ugen0.7: <Kristech KT-LINK> at usbus0 (disconnected)
uftdi0: at uhub17, port 1, addr 6 (disconnected)
uftdi0: detached

% ls /dev/cua*
/dev/cuaU0 /dev/cuaU0.init /dev/cuaU0.lock


Not that long ago I helped folks at AVRDUDE project to verify the FTDI driv=
er +
some new chip flashing method and I used and added KT-LINK configuration to
flash some chips I could not flash otherwise:

https://github.com/avrdudes/avrdude/issues/928

Looks like the "JTAG" part uses interface "A"?

Maybe this KT-LINK stuff could be of help to you somehow?

I am not sure if FT2232H can at all offer to work both with UART and JTAG at
the same time when attached to uftdi/ucom driver and then operated with
libftdi? Can you confirm this kind of operations on Linux or Windows as
reference point? This might be possible but you would have to detach the uc=
om
driver first from the JTAG part and assuming there are two interfaces expos=
ed
that can be claimed independently at the same time.

I know more modern "smart" debug probes (like DAPLink) use dedicated firmwa=
re
with RTOS that expose JTAG, UART, and MSC as separate USB interfaces of a
single device and these are handled separately allowing simultaneous operat=
ions
(these are in fact exclusive too at some point).

Alternatively if you work with ESP32 chips there is this new USB-Serial-JTAG
stuff that allows both Serial and JTAG transport over the built-in USB devi=
ce
interface. From what I read once these signals can be re-routed to external
GPIO and it should be possible to create a debug probe that way but I did n=
ot
have time to play with that:

https://docs.espressif.com/projects/esp-idf/en/stable/esp32s3/api-guides/us=
b-serial-jtag-console.html

https://docs.espressif.com/projects/esp-iot-solution/en/latest/usb/usb_over=
view/usb_serial_jtag.html

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-284042-19105-VKVtZjiTd5>