CMSIS-DAP: DAP_SWD_Sequence

| CMSIS-DAP Version 1.2.0 (Proposal) Interface Firmware for CoreSight Debug Access Port

- Main Page
- Usage and Description
- Reference

All Functions Groups Pages
DAP_SWD_Sequence
SWD Commands

Generate SWD sequence and output on SWDIO or capture input from SWDIO data. More...

Generate SWD sequence and output on SWDIO or capture input from SWDIO data.

Note
  The DAP_SWD_Sequence is only available when DAP_Info with ID=0xF0 (Capabilities) returns in Info0 - Bit 5: 1 = DAP_SWD_Sequence is implemented.

The DAP_SWD_Sequence Command is used to generate special sequences in SWD mode on the pins SWCLK and SWDIO. For example, for SWD multi-drop target selection (see picture) it is required to put the SWDIO pin to input mode (where it is not driven).

SWD sequence for multi-drop target selection

- For mode=0 (output: SWDIO is driven), the data for the SWDIO pin are part of the DAP_SWD_Sequence Command.
- For mode=1 (input: SWDIO is not driven), the data from the SWDIO pin are captured and returned as part of the DAP_SWD_Sequence Response.

DAP_SWD_Sequence Command:

| BYTE | BYTE **********| BYTE *********| BYTE ******|
> 0x21 | Sequence Count | Sequence Info | SWDIO Data |
|******|****************|///////////////|++++++++++++|

- Sequence Count: Number of Sequences
- Sequence Info: Contains number of SWCLK cycles and SWDIO mode
  - Bit 5 .. 0: Number of TCK cycles: 1 .. 64 (64 encoded as 0)
  - Bit 6: reserved
  - Bit 7: mode: 0=output (SWDIO Data in command), 1=input (SWDIO Data in response)
- SWDIO Data (only for output mode): Data generated on SWDIO
  - One bit for each TCK cycle
  - LSB transmitted first, padded to BYTE boundary

DAP_SWD_Sequence Response:

| BYTE | BYTE **| BYTE ******|
< 0x14 | Status | SWDIO Data |
|******|********|++++++++++++|

- SWDIO Data (only for input mode): Data captured from SWDIO
  - One bit for each SWCLK cycle for input mode
  - LSB received first, padded to BYTE boundary
- Status: Response Status