application: improve swd result display

This commit is contained in:
King Kévin 2021-03-22 18:48:40 +01:00
parent 54bf18caa1
commit 1b7ffaf432
1 changed files with 4 additions and 7 deletions

View File

@ -342,26 +342,23 @@ static void command_swd_scan(void* argument)
} else { } else {
printf("(invalid: RAO != 1)"); printf("(invalid: RAO != 1)");
} }
puts("\n");
retry = 0; // no need to retry since we found a valid response
break; break;
case SWD_ACK_NOREPLY: // the is no SWD here case SWD_ACK_NOREPLY: // the is no SWD here
puts("no reply");
retry = 0; // no need to retry retry = 0; // no need to retry
break; break;
case SWD_ACK_WAIT: // not allowed for DPIDR case SWD_ACK_WAIT: // not allowed for DPIDR
case SWD_ACK_FAULT: // not allowed for DPIDR case SWD_ACK_FAULT: // not allowed for DPIDR
default: // invalid ACK default: // invalid ACK
if (!swd_read(&data)) { // read the data printf("\nSWD possible: SWCLK=CH%02u SWDIO=CH%02u, garbage data=0x%08x\n", swclk, swdio, data);
puts("parity error ");
}
printf("garbage data %+08x ", data);
swd_turnaround(1); // switch from reading to writing
break; break;
} }
if (retry) { if (retry) {
retry--; // decrement retry count retry--; // decrement retry count
} }
} }
puts("\n"); putc('.');
swd_release_pins(); // release pins swd_release_pins(); // release pins
} // end SWDIO } // end SWDIO
} // end SWCLK } // end SWCLK