Detailed description
- This is a minor new feature, akin to OpenOCD
reset_config srst_pulls_trst.
- The existing problem is AT32F403A in JTAG transport disappearing during
load/reset, as if nRST falling edge asserts TRST. Thus it's impossible to flash it, SWD is required (and it does protocol recovery).
- The PR solves it by adding intermediate JTAG-DP related sequences every time Cortex-M targets are reset.
35-bit DPACC/APACC of 8974008e:7 (<<3, + 7) is 0x44ba00477, and 0x4ba00477 is JTAG-DP v0 IDCODE. So I assume IR gets loaded with IDCODE as if TAP is reset.
BMD has internal IR cache for all JTAG devices. If this device is selected, its IR should be changed to DPACC/APACC/ABORT for next access. If another device is selected but this target was reset by a shared nRST network, then IR should be changed to BYPASS for daisy-chain operation to continue.
A new function, adiv5_jtag_ensure_idle(), is added to struct debug_port, and NULL-checked to not break SWD transport.
This is tested on BMDA+blackpill-f411ce and at32f403acgu7 to fix flash loading.
TODO: BMDA CMSIS-DAP backend for JTAG sequences?
Your checklist for this pull request
Closing issues
## Detailed description
* This is a minor new feature, akin to OpenOCD `reset_config srst_pulls_trst`.
* The existing problem is AT32F403A in JTAG transport disappearing during `load`/reset, as if nRST falling edge asserts TRST. Thus it's impossible to flash it, SWD is required (and it does protocol recovery).
* The PR solves it by adding intermediate JTAG-DP related sequences every time Cortex-M targets are reset.
35-bit DPACC/APACC of 8974008e:7 (<<3, + 7) is 0x44ba00477, and 0x4ba00477 is JTAG-DP v0 IDCODE. So I assume IR gets loaded with IDCODE as if TAP is reset.
BMD has internal IR cache for all JTAG devices. If this device is selected, its IR should be changed to DPACC/APACC/ABORT for next access. If another device is selected but this target was reset by a shared nRST network, then IR should be changed to BYPASS for daisy-chain operation to continue.
A new function, `adiv5_jtag_ensure_idle()`, is added to struct debug_port, and NULL-checked to not break SWD transport.
This is tested on BMDA+blackpill-f411ce and at32f403acgu7 to fix flash loading.
TODO: BMDA CMSIS-DAP backend for JTAG sequences?
## Your checklist for this pull request
* [x] I've read the [Code of Conduct](https://github.com/blackmagic-debug/blackmagic/blob/main/CODE_OF_CONDUCT.md)
* [x] I've read the [guidelines for contributing](https://github.com/blackmagic-debug/blackmagic/blob/main/CONTRIBUTING.md) to this repository
* [x] It builds for hardware native (see [Building the firmware](https://github.com/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-firmware))
* [x] It builds as BMDA (see [Building the BMDA](https://github.com/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-app))
* [x] I've tested it to the best of my ability
* [x] My commit messages provide a useful short description of what the commits do
## Closing issues