Skip to content

Commit 6709ceb

Browse files
committed
esp_usb_jtag: fixed writeTDI with end and tms transition: now integrated instead of distinct sequence. Fixed TDI value with tms transition. Working with ECP5
1 parent 9873db3 commit 6709ceb

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/esp_usb_jtag.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,8 @@ int esp_usb_jtag::writeTDI(const uint8_t *tx, uint8_t *rx, uint32_t len, bool en
713713
_tdi = (tx[curr_pos >> 3] >> (curr_pos & 7)) & 1; // get i'th bit from rx
714714
if (_verbose)
715715
cerr << (int)_tdi;
716+
if (end && curr_pos == len - 1)
717+
_tms = 1;
716718
const uint8_t cmd = CMD_CLK(tdo, _tdi, _tms); // with TDO capture
717719
if(is_high_nibble) { // 1st (high nibble) = data
718720
tx_buf[tx_buffer_idx] = prev_high_nibble = cmd << 4;
@@ -773,13 +775,5 @@ int esp_usb_jtag::writeTDI(const uint8_t *tx, uint8_t *rx, uint32_t len, bool en
773775
if (_verbose)
774776
printSuccess("WriteTDI: end");
775777

776-
#if 1
777-
if (end) {
778-
// TODO support end (DR_SHIFT, IR_SHIFT)
779-
_tms = 1;
780-
tx_buf[0] = CMD_FLUSH << 4 | CMD_CLK(0, 1, _tms); // FIXME: TDI must be read from buffer
781-
xfer(tx_buf, NULL, 1);
782-
}
783-
#endif
784778
return EXIT_SUCCESS;
785779
}

0 commit comments

Comments
 (0)