if (!queued_seq_count)
return;
- DEBUG_JTAG_IO("Flushing %d queued sequences (%d bytes) with %d pending scan results to capture",
+ LOG_DEBUG_IO("Flushing %d queued sequences (%d bytes) with %d pending scan results to capture",
queued_seq_count, queued_seq_buf_end, pending_scan_result_count);
/* prep CMSIS-DAP packet */
}
#ifdef CMSIS_DAP_JTAG_DEBUG
- DEBUG_JTAG_IO("USB response buf:");
+ LOG_DEBUG_IO("USB response buf:");
for (int c = 0; c < queued_seq_buf_end + 3; ++c)
printf("%02X ", buffer[c]);
printf("\n");
/* copy scan results into client buffers */
for (int i = 0; i < pending_scan_result_count; ++i) {
struct pending_scan_result *scan = &pending_scan_results[i];
- DEBUG_JTAG_IO("Copying pending_scan_result %d/%d: %d bits from byte %d -> buffer + %d bits",
+ LOG_DEBUG_IO("Copying pending_scan_result %d/%d: %d bits from byte %d -> buffer + %d bits",
i, pending_scan_result_count, scan->length, scan->first + 2, scan->buffer_offset);
#ifdef CMSIS_DAP_JTAG_DEBUG
for (uint32_t b = 0; b < DIV_ROUND_UP(scan->length, 8); ++b)
static void cmsis_dap_add_jtag_sequence(int s_len, const uint8_t *sequence, int s_offset,
bool tms, uint8_t *tdo_buffer, int tdo_buffer_offset)
{
- DEBUG_JTAG_IO("[at %d] %d bits, tms %s, seq offset %d, tdo buf %p, tdo offset %d",
+ LOG_DEBUG_IO("[at %d] %d bits, tms %s, seq offset %d, tdo buf %p, tdo offset %d",
queued_seq_buf_end,
s_len, tms ? "HIGH" : "LOW", s_offset, tdo_buffer, tdo_buffer_offset);
return;
if (s_len > 64) {
- DEBUG_JTAG_IO("START JTAG SEQ SPLIT");
+ LOG_DEBUG_IO("START JTAG SEQ SPLIT");
for (int offset = 0; offset < s_len; offset += 64) {
int len = s_len - offset;
if (len > 64)
len = 64;
- DEBUG_JTAG_IO("Splitting long jtag sequence: %d-bit chunk starting at offset %d", len, offset);
+ LOG_DEBUG_IO("Splitting long jtag sequence: %d-bit chunk starting at offset %d", len, offset);
cmsis_dap_add_jtag_sequence(
len,
sequence,
tdo_buffer == NULL ? 0 : (tdo_buffer_offset + offset)
);
}
- DEBUG_JTAG_IO("END JTAG SEQ SPLIT");
+ LOG_DEBUG_IO("END JTAG SEQ SPLIT");
return;
}
/* queue a sequence of bits to clock out TMS, executing if the buffer is full */
static void cmsis_dap_add_tms_sequence(const uint8_t *sequence, int s_len)
{
- DEBUG_JTAG_IO("%d bits: %02X", s_len, *sequence);
+ LOG_DEBUG_IO("%d bits: %02X", s_len, *sequence);
/* we use a series of CMD_DAP_JTAG_SEQ commands to toggle TMS,
because even though it seems ridiculously inefficient, it
allows us to combine TMS and scan sequences into the same
tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
tms_scan_bits = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
- DEBUG_JTAG_IO("state move from %s to %s: %d clocks, %02X on tms",
+ LOG_DEBUG_IO("state move from %s to %s: %d clocks, %02X on tms",
tap_state_name(tap_get_state()), tap_state_name(tap_get_end_state()),
tms_scan_bits, tms_scan);
cmsis_dap_add_tms_sequence(&tms_scan, tms_scan_bits);
/* Execute a JTAG scan operation by queueing TMS and TDI/TDO sequences */
static void cmsis_dap_execute_scan(struct jtag_command *cmd)
{
- DEBUG_JTAG_IO("%s type:%d", cmd->cmd.scan->ir_scan ? "IRSCAN" : "DRSCAN",
+ LOG_DEBUG_IO("%s type:%d", cmd->cmd.scan->ir_scan ? "IRSCAN" : "DRSCAN",
jtag_scan_type(cmd->cmd.scan));
/* Make sure there are no trailing fields with num_bits == 0, or the logic below will fail. */
for (int i = 0; i < cmd->cmd.scan->num_fields; i++, field++) {
scan_size += field->num_bits;
- DEBUG_JTAG_IO("%s%s field %d/%d %d bits",
+ LOG_DEBUG_IO("%s%s field %d/%d %d bits",
field->in_value ? "in" : "",
field->out_value ? "out" : "",
i,
field->num_bits);
if (i == cmd->cmd.scan->num_fields - 1 && tap_get_state() != tap_get_end_state()) {
- DEBUG_JTAG_IO("Last field and have to move out of SHIFT state");
+ LOG_DEBUG_IO("Last field and have to move out of SHIFT state");
/* Last field, and we're leaving IRSHIFT/DRSHIFT. Clock last bit during tap
* movement. This last field can't have length zero, it was checked above. */
cmsis_dap_add_jtag_sequence(
0);
tap_set_state(tap_state_transition(tap_get_state(), 0));
} else {
- DEBUG_JTAG_IO("Internal field, staying in SHIFT state afterwards");
+ LOG_DEBUG_IO("Internal field, staying in SHIFT state afterwards");
/* Clocking part of a sequence into DR or IR with TMS=0,
leaving TMS=0 at the end so we can continue later */
cmsis_dap_add_jtag_sequence(
cmsis_dap_state_move();
}
- DEBUG_JTAG_IO("%s scan, %i bits, end in %s",
+ LOG_DEBUG_IO("%s scan, %i bits, end in %s",
(cmd->cmd.scan->ir_scan) ? "IR" : "DR", scan_size,
tap_state_name(tap_get_end_state()));
}
static void cmsis_dap_execute_pathmove(struct jtag_command *cmd)
{
- DEBUG_JTAG_IO("pathmove: %i states, end in %i",
+ LOG_DEBUG_IO("pathmove: %i states, end in %i",
cmd->cmd.pathmove->num_states,
cmd->cmd.pathmove->path[cmd->cmd.pathmove->num_states - 1]);
static void cmsis_dap_execute_runtest(struct jtag_command *cmd)
{
- DEBUG_JTAG_IO("runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles,
+ LOG_DEBUG_IO("runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles,
cmd->cmd.runtest->end_state);
cmsis_dap_end_state(cmd->cmd.runtest->end_state);
static void cmsis_dap_execute_stableclocks(struct jtag_command *cmd)
{
- DEBUG_JTAG_IO("stableclocks %i cycles", cmd->cmd.runtest->num_cycles);
+ LOG_DEBUG_IO("stableclocks %i cycles", cmd->cmd.runtest->num_cycles);
cmsis_dap_stableclocks(cmd->cmd.runtest->num_cycles);
}
static void cmsis_dap_execute_tms(struct jtag_command *cmd)
{
- DEBUG_JTAG_IO("TMS: %d bits", cmd->cmd.tms->num_bits);
+ LOG_DEBUG_IO("TMS: %d bits", cmd->cmd.tms->num_bits);
cmsis_dap_cmd_DAP_SWJ_Sequence(cmd->cmd.tms->num_bits, cmd->cmd.tms->bits);
}