Open dragonmux opened 3 days ago
Following on from the discussion, could we please have you re-run your JTAG scan with a higher verbosity level - 8 only turns on PROTO diagnostics which isn't especially useful here unfortunately. For this we're going to need INFO + TARGET + PROBE, which is (1 + 4 + 16) or in other words, 21 for blackmagic -tjv 21
. Hopefully that provides some more information on what actually came back from trying to do that DPIDR read and gives much needed additional information for interpreting the spec and part behaviour.
There you go
❯ blackmagic -tjv21
Black Magic Debug App d896778
for Black Magic Probe, ST-Link v2 and v3, CMSIS-DAP, J-Link and FTDI (MPSSE)
Using 1d50:6018 81D749A3 Black Magic Debug
Black Magic Probe d896778
Remote is Black Magic Probe d896778
Running in Test Mode
Target voltage: 1.8V
Speed set to 1.951MHz for JTAG
Resetting TAP
remote_jtag_init
Change state to Shift-DR
Scanning out ID codes
Return to Run-Test/Idle
Change state to Shift-IR
Scanning out IRs
Return to Run-Test/Idle
Change state to Shift-DR
Return to Run-Test/Idle
ID code 0x4ba06477: ADIv5 JTAG-DP port.
Enumerated 1 devices
0: IR length = 4, ID 4ba06477
-> IR prescan: 0, postscan: 0
-> DR prescan: 0, postscan: 0
Failed to read DPIDR
Given target number 1 not available max 0
The SWD scan fails as well unfortunately
❯ blackmagic -tv21
Black Magic Debug App d896778
for Black Magic Probe, ST-Link v2 and v3, CMSIS-DAP, J-Link and FTDI (MPSSE)
Using 1d50:6018 81D749A3 Black Magic Debug
Black Magic Probe d896778
Remote is Black Magic Probe d896778
Running in Test Mode
Target voltage: 1.8V
Speed set to 1.951MHz for SWD
remote_swd_init
Switching out of dormant state into SWD
remote_v0_swd_seq_out 32 clock_cycles: ffffffff
remote_v0_swd_seq_out 28 clock_cycles: 0fffffff
remote_v0_swd_seq_out 32 clock_cycles: 6209f392
remote_v0_swd_seq_out 32 clock_cycles: 86852d95
remote_v0_swd_seq_out 32 clock_cycles: e3ddafe9
remote_v0_swd_seq_out 32 clock_cycles: 19bc0ea2
remote_v0_swd_seq_out 12 clock_cycles: 000001a0
remote_v0_swd_seq_out 32 clock_cycles: ffffffff
remote_v0_swd_seq_out 32 clock_cycles: 0fffffff
remote_v0_swd_seq_out 8 clock_cycles: 000000a5
remote_v0_swd_seq_in 3 clock_cycles: 00000007
remote_v0_swd_seq_in_parity 32 clock_cycles: ffffffff ERR
remote_v0_swd_seq_out 8 clock_cycles: 00000000
Deprecated JTAG to SWD sequence
remote_v0_swd_seq_out 32 clock_cycles: ffffffff
remote_v0_swd_seq_out 28 clock_cycles: 0fffffff
remote_v0_swd_seq_out 16 clock_cycles: 0000e79e
remote_v0_swd_seq_out 32 clock_cycles: ffffffff
remote_v0_swd_seq_out 32 clock_cycles: 0fffffff
remote_v0_swd_seq_out 8 clock_cycles: 000000a5
remote_v0_swd_seq_in 3 clock_cycles: 00000007
remote_v0_swd_seq_in_parity 32 clock_cycles: ffffffff ERR
remote_v0_swd_seq_out 8 clock_cycles: 00000000
No usable DP found
No target found
Ack, the SWD side might well need #1959 to work then if this part implements dormant state. We'll try and get that PR reviewed today to check it's inserting a fully correct JTAG -> DS sequence and that it runs through the JTAG-or-SWD state machine correctly.
With regards to the JTAG side of this, that didn't produce as much output as we were expecting, so could you please crank the debug output further to -v 45
(ie blackmagic -tjv 45
)? This should detail the exact DPIDR traffic that got generated. Unfortunately it will also make the JTAG chain scan very verbose.
Next try ;)
I'll give #1959 a try tomorrow as well.
Thanks, I really appreciate the effort!
Thank you very much! We'll dig into the logs in a bit and go decoding E104
(in before this turns out we need to do dormant-to-JTAG sequences or something) and use this information to really dig into the ADIv6 spec sections on JTAG DP's. We'll update this issue to let you know how we're getting on and you'll probably see a new branch created aimed at fixing this.
Okay, so - it turns out that we were correct to think there would need to be some low-level changes for ADIv6 JTAG - they split out the OK/FAULT codes for the ACK and BMD is interpreting the OK ACK code as an invalid ACK here. Hence E104 which is indicating the firmware threw an exception in response. A fix for that is now available on feature/adiv6-jtag-support though we are certain that branch will not work correctly yet as we didn't yet get past the low-level aspects. Hopefully it get significantly further though. You will need to upgrade your probe's firmware for this to work.
Here are the logs from feature/adiv6-jtag-support, looks quite the same unfortunately.
Discussed in https://github.com/blackmagic-debug/blackmagic/discussions/1969