Skip to content

Commit 40b3dcf

Browse files
sandeepmistryfacchinm
authored andcommitted
Add retry count when waiting for JTAG response
1 parent e72779d commit 40b3dcf

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
Binary file not shown.

bootloaders/zero/board_driver_jtag.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,12 @@ int mbCmdSend(uint32_t* data, int len)
653653
jtagWriteBuffer(MB_BASE, (const uint8_t *)data, 1);
654654
#endif
655655

656+
int retries = 1000;
656657
do {
658+
if (retries-- < 0) {
659+
return -1;
660+
}
661+
657662
jtagReadBuffer(MB_BASE, (uint8_t*)&ret, 1);
658663
} while (ret);
659664

0 commit comments

Comments
 (0)