0
0
Fork 0

fix(dap): Only setup SWD port when using SPI speed

Connection problems may occur at SPI speeds when DAP_Connect and
DAP_SWJ_Clock are called in different orders.

Let's setup SWD at SPI rates to avoid potential timing issues.

(cherry picked from commit a89be4248eb7676109183183b0360dd57e02f039)
This commit is contained in:
windowsair 2024-06-09 11:09:04 +08:00 committed by kerms
parent 2426e56191
commit 0d8d7a014f
1 changed files with 2 additions and 1 deletions

View File

@ -236,7 +236,8 @@ static uint32_t DAP_Connect(const uint8_t *request, uint8_t *response) {
#if (DAP_SWD != 0)
case DAP_PORT_SWD:
DAP_Data.debug_port = DAP_PORT_SWD;
PORT_SWD_SETUP();
if (SWD_TransferSpeed != kTransfer_SPI)
PORT_SWD_SETUP();
break;
#endif
#if (DAP_JTAG != 0)