# Atmel EDBG-based Tools Protocols
Enveloped AVR commands, responses & events

### Unwrapping AVR responses

To RECEIVE an AVR response from the EDBG, a AVR_RSP packet must be sent (ie: polling for responses)

Table 31. Wrapping AVR_RSP

Field | Size | Description
--- | --- | ---
AVR_RSP | 1 byte | 0x81

The response to this send is:

Table 32. Unwrapping AVR_RSP

Field | Size | Description
--- | --- | ---
AVR_RSP | 1 byte | 0x81
FragmentInfo | 1 byte | 0x00: More fragments required (m < n) 0x01: Full packet received, will be processed (m == n)
Size | 2 byte, MSB first | Number of response bytes
Response | N bytes | Enveloped AVR response

FragmentInfo 0x00 indicates that no response data is available, and the rest of the packet is ignored.

Note that the "synchronous" nature of the AVR CMD-RSP functionality must be preserved even when running over this CMSIS-DAP wrapper – this means that every one command results in one and only one response, and that response must be read out before the following command can be issued.

Prev | Up | Next
| Home |