From nobody Mon Jan 13 22:08:32 2025 X-Original-To: usb@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX5xX62vWz5ksfh for ; Mon, 13 Jan 2025 22:08:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX5xX5N3rz3mrF for ; Mon, 13 Jan 2025 22:08:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736806112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e+jJehq24V2kRcbrnMMVG8/oRSWwL5BaXhc3juTfHtA=; b=SI6vExi29XDfjMxAsqgu5RNoE8tH3lQb9kKpAA6q42QWK1IXDhepsGvtv7pZwKhisY0M36 z0/e5+TFMnaKgkcrZldpQeV2JP4qWOoroAtzso5KGW1FBzGlvkUa4KxiYhrFwihbWMpf43 moUx5iGUNAwPNkCbzBNev/+Gnee41C25oRnRuSjqeqUPkqcFETXGGWDYcGckq4OfnOG/gA bFnkrSVg78ij0HDUBokcGpUqwEF/CmlfTZZcSRBOJspfSSg4KhVHUsjV6UIVw93sqNJk93 nuCnQCSRyePk8xXhFg4yY/eEoBiEQk6gFuBnxYJqzcVXT5SvqmToZXp8fgQp+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736806112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e+jJehq24V2kRcbrnMMVG8/oRSWwL5BaXhc3juTfHtA=; b=piLdcFd2/dmuDjTqeg/hqHSL22tZxA/SS+A7WbEkVZSEWmZcZQVfRn+hJ53hDqWBpBCKFc ZukNkgJ/EGAf1HmOLeRp3sdHtRVHir8w2W3zTj3nBgCu4Gaouji93BYlFvCTe0R/I9iXqI boN9UfxluSK5531I6dUQu+M5zlNL7DkEQ4HLQH3xRa9UiR+3gE9FL1n3x9rCY6ttjPvb8B aXzGOgHbQYRcmykCqZ0utcAp8g4tbGm4TbVdkdXCQcsUQSbyZYOOx730eHey2YqQIj+/vj 5l+kSLeInbZp30sr2IOTy7iKPeDoYGRr57q2GxEROGttXZS7k+A4hFuLHIZzoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736806112; a=rsa-sha256; cv=none; b=VwXZvbxIQj50KGGbbwRFB3ihpr5q5wjfh152XAOIi7mgjDwb0i4jTiQk8PL8QGIgf0Rvks cy1yYFX3juzoP1vXW6YzssP+dQhnaCNwwvlbn9eVhVaLCTsfzZ31K9XYl9LhFMfrw/7CjQ DYuAUO2Yw0mCc2FMQUipm6Dac6eQsMLDL+FPCVkplQorumLfhOEPHfV6yghlE264V3g15N nVRehKkhMPKak46UO/BtbrO3NP6NxyBrj5wnZcIG25ar1/vW6Xut0RudTJUBUXY17ufTyJ AHkfTZ0nctlBu2tmVl3zfgCQg6cSi1iviIDXuo+sgzPSmSwFkGAHpMW+P8OmGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX5xX4jkYznth for ; Mon, 13 Jan 2025 22:08:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 50DM8WCT084728 for ; Mon, 13 Jan 2025 22:08:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 50DM8WZm084727 for usb@FreeBSD.org; Mon, 13 Jan 2025 22:08:32 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 284042] FTDI: UART breaks JTAG Date: Mon, 13 Jan 2025 22:08:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: bsd@orsolic.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-usb List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-usb@freebsd.org Sender: owner-freebsd-usb@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D284042 Bug ID: 284042 Summary: FTDI: UART breaks JTAG Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: usb Assignee: usb@FreeBSD.org Reporter: bsd@orsolic.org I am using non-clone FTDI2232H (it should be original, it is part of ESPprog and survived FTDI's FTtool on Windows). FTDI is used for JTAG (channel 0) and UART (channel 1). If UART is also used, JTAG will work only for the first run, then it will f= ail. To make it work again unpluging and pluggin USB cable is needed. JTAG will work multiple times if UART is not used (eg "cu" is not run). If I comment functions uftdi_cfg_set_dtr() and uftdi_cfg_set_rts() in uftdi= .c then it works without problems (both JTAG and UART). Tried on -CURRENT from 2024.01.12. dmesg after connecting FTDI: uftdi0 on uhub0 uftdi0: on usbus0 uftdi1 on uhub0 uftdi1: on usbus0 usbconfig ugen0.2: at usbus0, cfg=3D0 md=3DHOST spd=3DHIGH (480Mbps) pwr= =3DON (500mA) OpenOCD run will succeed every time: openocd -f board/esp32p4-ftdi.cfg -c "init; reset; exit" Open On-Chip Debugger v0.12.0-eol-8078-g4071bf78-dirty (2024-12-27-18:08) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "jtag". To override= use 'transport select '. Info : clock speed 10000 kHz Info : JTAG tap: esp32p4.tap0 tap/device found: 0x00012c25 (mfg: 0x612 (Espressif Systems), part: 0x0012, ver: 0x0) Info : JTAG tap: esp32p4.tap1 tap/device found: 0x00012c25 (mfg: 0x612 (Espressif Systems), part: 0x0012, ver: 0x0) Info : [esp32p4.hp.cpu0] datacount=3D1 progbufsize=3D2 Info : [esp32p4.hp.cpu0] Core 0 made part of halt group 1. Info : [esp32p4.hp.cpu0] Examined RISC-V core; found 2 harts Info : [esp32p4.hp.cpu0] XLEN=3D32, misa=3D0x40901125 Info : [esp32p4.hp.cpu0] Examination succeed Info : [esp32p4.hp.cpu1] datacount=3D1 progbufsize=3D2 Info : [esp32p4.hp.cpu1] Core 1 made part of halt group 1. Info : [esp32p4.hp.cpu1] Examined RISC-V core; found 2 harts Info : [esp32p4.hp.cpu1] XLEN=3D32, misa=3D0x40901125 Info : [esp32p4.hp.cpu1] Examination succeed Info : [esp32p4.hp.cpu0] starting gdb server on 3333 Info : Listening on port 3333 for gdb connections Info : JTAG tap: esp32p4.tap0 tap/device found: 0x00012c25 (mfg: 0x612 (Espressif Systems), part: 0x0012, ver: 0x0) Info : JTAG tap: esp32p4.tap1 tap/device found: 0x00012c25 (mfg: 0x612 (Espressif Systems), part: 0x0012, ver: 0x0) Info : [esp32p4.hp.cpu0] Reset cause (24) - (JTAG CPU reset) Info : [esp32p4.hp.cpu1] Reset cause (24) - (JTAG CPU reset) But if something is using UART port (2nd channel on FTDI), OpenOCD will fail (which uses 1st channel on FTDI): cu -s 115200 -l /dev/cuaU1 openocd -f board/esp32p4-ftdi.cfg -c "init; reset; exit" Open On-Chip Debugger v0.12.0-eol-8078-g4071bf78-dirty (2024-12-27-18:08) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "jtag". To override= use 'transport select '. Info : clock speed 10000 kHz Error: JTAG scan chain interrogation failed: all ones Error: Check JTAG interface, timings, target power, etc. Error: Trying to use configured scan chain anyway... Error: esp32p4.tap0: IR capture error; saw 0x1f not 0x01 Warn : Bypassing JTAG setup events due to errors Error: [esp32p4.hp.cpu0] Unsupported DTM version: 15 Error: [esp32p4.hp.cpu0] Examination failed Warn : target esp32p4.hp.cpu0 examination failed Error: [esp32p4.hp.cpu1] Unsupported DTM version: 15 Error: [esp32p4.hp.cpu1] Examination failed Warn : target esp32p4.hp.cpu1 examination failed Info : [esp32p4.hp.cpu0] starting gdb server on 3333 Info : Listening on port 3333 for gdb connections Error: JTAG scan chain interrogation failed: all ones Error: Check JTAG interface, timings, target power, etc. Error: Trying to use configured scan chain anyway... Error: esp32p4.tap0: IR capture error; saw 0x1f not 0x01 Warn : Bypassing JTAG setup events due to errors Error: [esp32p4.hp.cpu0] Unsupported DTM version: 15 Error: [esp32p4.hp.cpu1] Unsupported DTM version: 15 Error: [esp32p4.hp.cpu0] Unsupported DTM version: -1 Error: [esp32p4.hp.cpu0] Unsupported DTM version: -1 Error: [esp32p4.hp.cpu0] Could not identify target type. Error: [esp32p4.hp.cpu1] Unsupported DTM version: -1 Error: [esp32p4.hp.cpu1] Could not identify target type. --=20 You are receiving this mail because: You are the assignee for the bug.=