- if (buffer[2] & 0x08) {
- LOG_DEBUG("CMSIS-DAP Protocol Error @ %d (wrong parity)", buffer[1]);
+ uint8_t *resp = dap->response;
+ if (resp[0] != CMD_DAP_TFER) {
+ LOG_ERROR("CMSIS-DAP command mismatch. Expected 0x%" PRIx8
+ " received 0x%" PRIx8, CMD_DAP_TFER, resp[0]);
+ queued_retval = ERROR_FAIL;
+ goto skip;
+ }
+
+ uint8_t transfer_count = resp[1];
+ uint8_t ack = resp[2] & 0x07;
+ if (resp[2] & 0x08) {
+ LOG_DEBUG("CMSIS-DAP Protocol Error @ %d (wrong parity)", transfer_count);