1 /***************************************************************************
2 * Copyright (C) 2007 by Juergen Stuber <juergen@jstuber.net> *
3 * based on Dominic Rath's and Benedikt Sauter's usbprog.c *
5 * Copyright (C) 2008 by Spencer Oliver *
6 * spen@spen-soft.co.uk *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22 ***************************************************************************/
28 #include "replacements.h"
37 /* enable this to debug communication
40 #define _DEBUG_USB_COMMS_
43 #ifdef _DEBUG_JTAG_IO_
44 #define DEBUG_JTAG_IO(expr ...) LOG_DEBUG(expr)
46 #define DEBUG_JTAG_IO(expr ...)
52 #define JLINK_WRITE_ENDPOINT 0x02
53 #define JLINK_READ_ENDPOINT 0x81
55 #define JLINK_USB_TIMEOUT 1000
57 #define JLINK_IN_BUFFER_SIZE 8192
58 #define JLINK_OUT_BUFFER_SIZE 8192
59 #define JLINK_EMU_RESULT_BUFFER_SIZE 64
61 /* Global USB buffers */
62 static u8 usb_in_buffer
[JLINK_IN_BUFFER_SIZE
];
63 static u8 usb_out_buffer
[JLINK_OUT_BUFFER_SIZE
];
64 static u8 usb_emu_result_buffer
[JLINK_EMU_RESULT_BUFFER_SIZE
];
66 /* Constants for JLink command */
67 #define EMU_CMD_VERSION 0x01
68 #define EMU_CMD_SET_SPEED 0x05
69 #define EMU_CMD_GET_STATE 0x07
70 #define EMU_CMD_HW_JTAG3 0xcf
71 #define EMU_CMD_HW_RESET0 0xdc
72 #define EMU_CMD_HW_RESET1 0xdd
73 #define EMU_CMD_HW_TRST0 0xde
74 #define EMU_CMD_HW_TRST1 0xdf
76 /* max speed 12MHz v5.0 jlink */
77 #define JLINK_MAX_SPEED 12000
79 /* External interface functions */
80 static int jlink_execute_queue(void);
81 static int jlink_speed(int speed
);
82 static int jlink_speed_div(int speed
, int* khz
);
83 static int jlink_khz(int khz
, int *jtag_speed
);
84 static int jlink_register_commands(struct command_context_s
*cmd_ctx
);
85 static int jlink_init(void);
86 static int jlink_quit(void);
88 /* CLI command handler functions */
89 static int jlink_handle_jlink_info_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
91 /* Queue command functions */
92 static void jlink_end_state(tap_state_t state
);
93 static void jlink_state_move(void);
94 static void jlink_path_move(int num_states
, tap_state_t
*path
);
95 static void jlink_runtest(int num_cycles
);
96 static void jlink_scan(int ir_scan
, enum scan_type type
, u8
*buffer
, int scan_size
, scan_command_t
*command
);
97 static void jlink_reset(int trst
, int srst
);
98 static void jlink_simple_command(u8 command
);
99 static int jlink_get_status(void);
101 /* J-Link tap buffer functions */
102 static void jlink_tap_init(void);
103 static int jlink_tap_execute(void);
104 static void jlink_tap_ensure_space(int scans
, int bits
);
105 static void jlink_tap_append_step(int tms
, int tdi
);
106 static void jlink_tap_append_scan(int length
, u8
*buffer
, scan_command_t
*command
);
108 /* Jlink lowlevel functions */
109 typedef struct jlink_jtag
111 struct usb_dev_handle
* usb_handle
;
114 static jlink_jtag_t
*jlink_usb_open(void);
115 static void jlink_usb_close(jlink_jtag_t
*jlink_jtag
);
116 static int jlink_usb_message(jlink_jtag_t
*jlink_jtag
, int out_length
, int in_length
);
117 static int jlink_usb_write(jlink_jtag_t
*jlink_jtag
, int out_length
);
118 static int jlink_usb_read(jlink_jtag_t
*jlink_jtag
, int expected_size
);
119 static int jlink_usb_read_emu_result(jlink_jtag_t
*jlink_jtag
);
121 /* helper functions */
122 static int jlink_get_version_info(void);
124 #ifdef _DEBUG_USB_COMMS_
125 static void jlink_debug_buffer(u8
*buffer
, int length
);
128 static jlink_jtag_t
* jlink_jtag_handle
;
130 /***************************************************************************/
131 /* External interface implementation */
133 jtag_interface_t jlink_interface
=
136 .execute_queue
= jlink_execute_queue
,
137 .speed
= jlink_speed
,
138 .speed_div
= jlink_speed_div
,
140 .register_commands
= jlink_register_commands
,
145 static int jlink_execute_queue(void)
147 jtag_command_t
*cmd
= jtag_command_queue
;
157 DEBUG_JTAG_IO("end_state: %i", cmd
->cmd
.end_state
->end_state
);
159 if (cmd
->cmd
.end_state
->end_state
!= TAP_INVALID
)
161 jlink_end_state(cmd
->cmd
.end_state
->end_state
);
166 DEBUG_JTAG_IO( "runtest %i cycles, end in %i", cmd
->cmd
.runtest
->num_cycles
, \
167 cmd
->cmd
.runtest
->end_state
);
169 if (cmd
->cmd
.runtest
->end_state
!= TAP_INVALID
)
171 jlink_end_state(cmd
->cmd
.runtest
->end_state
);
173 jlink_runtest(cmd
->cmd
.runtest
->num_cycles
);
177 DEBUG_JTAG_IO("statemove end in %i", cmd
->cmd
.statemove
->end_state
);
179 if (cmd
->cmd
.statemove
->end_state
!= TAP_INVALID
)
181 jlink_end_state(cmd
->cmd
.statemove
->end_state
);
187 DEBUG_JTAG_IO("pathmove: %i states, end in %i", \
188 cmd
->cmd
.pathmove
->num_states
, \
189 cmd
->cmd
.pathmove
->path
[cmd
->cmd
.pathmove
->num_states
- 1]);
191 jlink_path_move(cmd
->cmd
.pathmove
->num_states
, cmd
->cmd
.pathmove
->path
);
195 DEBUG_JTAG_IO("scan end in %i", cmd
->cmd
.scan
->end_state
);
197 if (cmd
->cmd
.scan
->end_state
!= TAP_INVALID
)
199 jlink_end_state(cmd
->cmd
.scan
->end_state
);
202 scan_size
= jtag_build_buffer(cmd
->cmd
.scan
, &buffer
);
203 DEBUG_JTAG_IO("scan input, length = %d", scan_size
);
205 #ifdef _DEBUG_USB_COMMS_
206 jlink_debug_buffer(buffer
, (scan_size
+ 7) / 8);
208 type
= jtag_scan_type(cmd
->cmd
.scan
);
209 jlink_scan(cmd
->cmd
.scan
->ir_scan
, type
, buffer
, scan_size
, cmd
->cmd
.scan
);
213 DEBUG_JTAG_IO("reset trst: %i srst %i", cmd
->cmd
.reset
->trst
, cmd
->cmd
.reset
->srst
);
217 if (cmd
->cmd
.reset
->trst
== 1)
219 tap_set_state(TAP_RESET
);
221 jlink_reset(cmd
->cmd
.reset
->trst
, cmd
->cmd
.reset
->srst
);
225 DEBUG_JTAG_IO("sleep %i", cmd
->cmd
.sleep
->us
);
227 jtag_sleep(cmd
->cmd
.sleep
->us
);
231 LOG_ERROR("BUG: unknown JTAG command type encountered");
237 return jlink_tap_execute();
240 /* Sets speed in kHz. */
241 static int jlink_speed(int speed
)
245 if (speed
<= JLINK_MAX_SPEED
)
247 /* check for RTCK setting */
251 usb_out_buffer
[0] = EMU_CMD_SET_SPEED
;
252 usb_out_buffer
[1] = (speed
>> 0) & 0xff;
253 usb_out_buffer
[2] = (speed
>> 8) & 0xff;
255 result
= jlink_usb_write(jlink_jtag_handle
, 3);
263 LOG_ERROR("J-Link setting speed failed (%d)", result
);
264 return ERROR_JTAG_DEVICE_ERROR
;
269 LOG_INFO("Requested speed %dkHz exceeds maximum of %dkHz, ignored", speed
, JLINK_MAX_SPEED
);
275 static int jlink_speed_div(int speed
, int* khz
)
282 static int jlink_khz(int khz
, int *jtag_speed
)
289 static int jlink_register_commands(struct command_context_s
*cmd_ctx
)
291 register_command(cmd_ctx
, NULL
, "jlink_info", jlink_handle_jlink_info_command
, COMMAND_EXEC
,
296 static int jlink_init(void)
300 jlink_jtag_handle
= jlink_usb_open();
302 if (jlink_jtag_handle
== 0)
304 LOG_ERROR("Cannot find jlink Interface! Please check connection and permissions.");
305 return ERROR_JTAG_INIT_FAILED
;
309 while (check_cnt
< 3)
311 if (jlink_get_version_info() == ERROR_OK
)
313 /* attempt to get status */
323 LOG_INFO("J-Link initial read failed, don't worry");
326 LOG_INFO("J-Link JTAG Interface ready");
334 static int jlink_quit(void)
336 jlink_usb_close(jlink_jtag_handle
);
340 /***************************************************************************/
341 /* Queue command implementations */
343 static void jlink_end_state(tap_state_t state
)
345 if (tap_is_state_stable(state
))
347 tap_set_end_state(state
);
351 LOG_ERROR("BUG: %i is not a valid end state", state
);
356 /* Goes to the end state. */
357 static void jlink_state_move(void)
361 u8 tms_scan
= tap_get_tms_path(tap_get_state(), tap_get_end_state());
363 for (i
= 0; i
< 7; i
++)
365 tms
= (tms_scan
>> i
) & 1;
366 jlink_tap_append_step(tms
, 0);
369 tap_set_state(tap_get_end_state());
372 static void jlink_path_move(int num_states
, tap_state_t
*path
)
376 for (i
= 0; i
< num_states
; i
++)
378 if (path
[i
] == tap_state_transition(tap_get_state(), false))
380 jlink_tap_append_step(0, 0);
382 else if (path
[i
] == tap_state_transition(tap_get_state(), true))
384 jlink_tap_append_step(1, 0);
388 LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_name(tap_get_state()), tap_state_name(path
[i
]));
392 tap_set_state(path
[i
]);
395 tap_set_end_state(tap_get_state());
398 static void jlink_runtest(int num_cycles
)
402 tap_state_t saved_end_state
= tap_get_end_state();
404 /* only do a state_move when we're not already in IDLE */
405 if (tap_get_state() != TAP_IDLE
)
407 jlink_end_state(TAP_IDLE
);
411 /* execute num_cycles */
412 for (i
= 0; i
< num_cycles
; i
++)
414 jlink_tap_append_step(0, 0);
417 /* finish in end_state */
418 jlink_end_state(saved_end_state
);
419 if (tap_get_state() != tap_get_end_state())
425 static void jlink_scan(int ir_scan
, enum scan_type type
, u8
*buffer
, int scan_size
, scan_command_t
*command
)
427 tap_state_t saved_end_state
;
429 jlink_tap_ensure_space(1, scan_size
+ 8);
431 saved_end_state
= tap_get_end_state();
433 /* Move to appropriate scan state */
434 jlink_end_state(ir_scan
? TAP_IRSHIFT
: TAP_DRSHIFT
);
436 /* Only move if we're not already there */
437 if (tap_get_state() != tap_get_end_state())
440 jlink_end_state(saved_end_state
);
443 jlink_tap_append_scan(scan_size
, buffer
, command
);
445 /* We are in Exit1, go to Pause */
446 jlink_tap_append_step(0, 0);
448 tap_set_state(ir_scan
? TAP_IRPAUSE
: TAP_DRPAUSE
);
450 if (tap_get_state() != tap_get_end_state())
456 static void jlink_reset(int trst
, int srst
)
458 LOG_DEBUG("trst: %i, srst: %i", trst
, srst
);
460 /* Signals are active low */
463 jlink_simple_command(EMU_CMD_HW_RESET1
);
467 jlink_simple_command(EMU_CMD_HW_RESET0
);
472 jlink_simple_command(EMU_CMD_HW_TRST1
);
476 jlink_simple_command(EMU_CMD_HW_TRST0
);
480 static void jlink_simple_command(u8 command
)
484 DEBUG_JTAG_IO("0x%02x", command
);
486 usb_out_buffer
[0] = command
;
487 result
= jlink_usb_write(jlink_jtag_handle
, 1);
491 LOG_ERROR("J-Link command 0x%02x failed (%d)", command
, result
);
495 static int jlink_get_status(void)
499 jlink_simple_command(EMU_CMD_GET_STATE
);
500 result
= jlink_usb_read(jlink_jtag_handle
, 8);
504 int vref
= usb_in_buffer
[0] + (usb_in_buffer
[1] << 8);
505 LOG_INFO("Vref = %d.%d TCK = %d TDI = %d TDO = %d TMS = %d SRST = %d TRST = %d\n", \
506 vref
/ 1000, vref
% 1000, \
507 usb_in_buffer
[2], usb_in_buffer
[3], usb_in_buffer
[4], \
508 usb_in_buffer
[5], usb_in_buffer
[6], usb_in_buffer
[7]);
512 LOG_ERROR("Vref too low. Check Target Power\n");
517 LOG_ERROR("J-Link command EMU_CMD_GET_STATE failed (%d)\n", result
);
523 static int jlink_get_version_info(void)
528 /* query hardware version */
529 jlink_simple_command(EMU_CMD_VERSION
);
530 result
= jlink_usb_read(jlink_jtag_handle
, 2);
534 len
= buf_get_u32(usb_in_buffer
, 0, 16);
535 result
= jlink_usb_read(jlink_jtag_handle
, len
);
539 usb_in_buffer
[result
] = 0;
540 LOG_INFO((char *)usb_in_buffer
);
545 LOG_ERROR("J-Link command EMU_CMD_VERSION failed (%d)\n", result
);
546 return ERROR_JTAG_DEVICE_ERROR
;
549 static int jlink_handle_jlink_info_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
551 if (jlink_get_version_info() == ERROR_OK
)
553 /* attempt to get status */
560 /***************************************************************************/
561 /* J-Link tap functions */
563 /* 2048 is the max value we can use here */
564 #define JLINK_TAP_BUFFER_SIZE 2048
566 static int tap_length
;
567 static u8 tms_buffer
[JLINK_TAP_BUFFER_SIZE
];
568 static u8 tdi_buffer
[JLINK_TAP_BUFFER_SIZE
];
569 static u8 tdo_buffer
[JLINK_TAP_BUFFER_SIZE
];
573 int first
; /* First bit position in tdo_buffer to read */
574 int length
; /* Number of bits to read */
575 scan_command_t
*command
; /* Corresponding scan command */
577 } pending_scan_result_t
;
579 #define MAX_PENDING_SCAN_RESULTS 256
581 static int pending_scan_results_length
;
582 static pending_scan_result_t pending_scan_results_buffer
[MAX_PENDING_SCAN_RESULTS
];
586 static void jlink_tap_init(void)
589 pending_scan_results_length
= 0;
592 static void jlink_tap_ensure_space(int scans
, int bits
)
594 int available_scans
= MAX_PENDING_SCAN_RESULTS
- pending_scan_results_length
;
595 int available_bits
= JLINK_TAP_BUFFER_SIZE
* 8 - tap_length
;
597 if (scans
> available_scans
|| bits
> available_bits
)
603 static void jlink_tap_append_step(int tms
, int tdi
)
606 int index
= tap_length
/ 8;
608 if (index
< JLINK_TAP_BUFFER_SIZE
)
610 int bit_index
= tap_length
% 8;
611 u8 bit
= 1 << bit_index
;
615 tms_buffer
[index
] |= bit
;
619 tms_buffer
[index
] &= ~bit
;
624 tdi_buffer
[index
] |= bit
;
628 tdi_buffer
[index
] &= ~bit
;
635 LOG_ERROR("jlink_tap_append_step, overflow");
639 static void jlink_tap_append_scan(int length
, u8
*buffer
, scan_command_t
*command
)
641 pending_scan_result_t
*pending_scan_result
= &pending_scan_results_buffer
[pending_scan_results_length
];
644 pending_scan_result
->first
= tap_length
;
645 pending_scan_result
->length
= length
;
646 pending_scan_result
->command
= command
;
647 pending_scan_result
->buffer
= buffer
;
649 for (i
= 0; i
< length
; i
++)
651 jlink_tap_append_step((i
< length
-1 ? 0 : 1), (buffer
[i
/8] >> (i
%8)) & 1);
653 pending_scan_results_length
++;
656 /* Pad and send a tap sequence to the device, and receive the answer.
657 * For the purpose of padding we assume that we are in idle or pause state. */
658 static int jlink_tap_execute(void)
668 /* Pad last byte so that tap_length is divisible by 8 */
669 while (tap_length
% 8 != 0)
671 /* More of the last TMS value keeps us in the same state,
672 * analogous to free-running JTAG interfaces. */
673 jlink_tap_append_step(last_tms
, 0);
676 byte_length
= tap_length
/ 8;
678 usb_out_buffer
[0] = EMU_CMD_HW_JTAG3
;
679 usb_out_buffer
[1] = 0;
680 usb_out_buffer
[2] = (tap_length
>> 0) & 0xff;
681 usb_out_buffer
[3] = (tap_length
>> 8) & 0xff;
684 for (i
= 0; i
< byte_length
; i
++)
686 usb_out_buffer
[tms_offset
+ i
] = tms_buffer
[i
];
689 tdi_offset
= tms_offset
+ byte_length
;
690 for (i
= 0; i
< byte_length
; i
++)
692 usb_out_buffer
[tdi_offset
+ i
] = tdi_buffer
[i
];
695 result
= jlink_usb_message(jlink_jtag_handle
, 4 + 2 * byte_length
, byte_length
);
697 if (result
== byte_length
)
699 for (i
= 0; i
< byte_length
; i
++)
701 tdo_buffer
[i
] = usb_in_buffer
[i
];
704 for (i
= 0; i
< pending_scan_results_length
; i
++)
706 pending_scan_result_t
*pending_scan_result
= &pending_scan_results_buffer
[i
];
707 u8
*buffer
= pending_scan_result
->buffer
;
708 int length
= pending_scan_result
->length
;
709 int first
= pending_scan_result
->first
;
710 scan_command_t
*command
= pending_scan_result
->command
;
713 buf_set_buf(tdo_buffer
, first
, buffer
, 0, length
);
715 DEBUG_JTAG_IO("pending scan result, length = %d", length
);
717 #ifdef _DEBUG_USB_COMMS_
718 jlink_debug_buffer(buffer
, byte_length
);
721 if (jtag_read_buffer(buffer
, command
) != ERROR_OK
)
724 return ERROR_JTAG_QUEUE_FAILED
;
727 if (pending_scan_result
->buffer
!= NULL
)
729 free(pending_scan_result
->buffer
);
735 LOG_ERROR("jlink_tap_execute, wrong result %d, expected %d", result
, byte_length
);
736 return ERROR_JTAG_QUEUE_FAILED
;
745 /*****************************************************************************/
746 /* JLink USB low-level functions */
748 static jlink_jtag_t
* jlink_usb_open()
750 struct usb_bus
*busses
;
752 struct usb_device
*dev
;
754 jlink_jtag_t
*result
;
756 result
= (jlink_jtag_t
*) malloc(sizeof(jlink_jtag_t
));
762 busses
= usb_get_busses();
764 /* find jlink_jtag device in usb bus */
766 for (bus
= busses
; bus
; bus
= bus
->next
)
768 for (dev
= bus
->devices
; dev
; dev
= dev
->next
)
770 if ((dev
->descriptor
.idVendor
== VID
) && (dev
->descriptor
.idProduct
== PID
))
772 result
->usb_handle
= usb_open(dev
);
774 /* usb_set_configuration required under win32 */
775 usb_set_configuration(result
->usb_handle
, dev
->config
[0].bConfigurationValue
);
776 usb_claim_interface(result
->usb_handle
, 0);
780 * This makes problems under Mac OS X. And is not needed
781 * under Windows. Hopefully this will not break a linux build
783 usb_set_altinterface(result
->usb_handle
, 0);
794 static void jlink_usb_close(jlink_jtag_t
*jlink_jtag
)
796 usb_close(jlink_jtag
->usb_handle
);
800 /* Send a message and receive the reply. */
801 static int jlink_usb_message(jlink_jtag_t
*jlink_jtag
, int out_length
, int in_length
)
806 result
= jlink_usb_write(jlink_jtag
, out_length
);
807 if (result
== out_length
)
809 result
= jlink_usb_read(jlink_jtag
, in_length
);
810 if (result
== in_length
|| result
== in_length
+1)
812 if (result
== in_length
)
814 /* Must read the result from the EMU too */
815 result2
= jlink_usb_read_emu_result(jlink_jtag
);
818 /* Check the result itself */
819 if (0 == usb_emu_result_buffer
[0])
825 LOG_ERROR("jlink_usb_read_emu_result (requested=0, result=%d)", usb_emu_result_buffer
[0]);
831 LOG_ERROR("jlink_usb_read_emu_result len (requested=1, result=%d)", result2
);
837 /* Check the result itself */
838 if (0 == usb_in_buffer
[result
-1])
844 LOG_ERROR("jlink_usb_read_emu_result (requested=0, result=%d)", usb_in_buffer
[result
]);
851 LOG_ERROR("usb_bulk_read failed (requested=%d, result=%d)", in_length
, result
);
857 LOG_ERROR("usb_bulk_write failed (requested=%d, result=%d)", out_length
, result
);
862 static int usb_bulk_write_ex(usb_dev_handle
*dev
, int ep
, char *bytes
, int size
,
865 int rc
= 0, tries
= 3, this_size
;
867 while (tries
&& size
) {
869 this_size
= usb_bulk_write (dev
, ep
, bytes
, size
, timeout
);
886 static int usb_bulk_read_ex(usb_dev_handle
*dev
, int ep
, char *bytes
, int size
,
889 int rc
= 0, tries
= 3, this_size
;
891 while (tries
&& size
) {
893 this_size
= usb_bulk_read (dev
, ep
, bytes
, size
, timeout
);
910 /* Write data from out_buffer to USB. */
911 static int jlink_usb_write(jlink_jtag_t
*jlink_jtag
, int out_length
)
915 if (out_length
> JLINK_OUT_BUFFER_SIZE
)
917 LOG_ERROR("jlink_jtag_write illegal out_length=%d (max=%d)", out_length
, JLINK_OUT_BUFFER_SIZE
);
921 result
= usb_bulk_write_ex(jlink_jtag
->usb_handle
, JLINK_WRITE_ENDPOINT
,
922 (char *)usb_out_buffer
, out_length
, JLINK_USB_TIMEOUT
);
924 DEBUG_JTAG_IO("jlink_usb_write, out_length = %d, result = %d", out_length
, result
);
926 #ifdef _DEBUG_USB_COMMS_
927 jlink_debug_buffer(usb_out_buffer
, out_length
);
932 /* Read data from USB into in_buffer. */
933 static int jlink_usb_read(jlink_jtag_t
*jlink_jtag
, int expected_size
)
935 int result
= usb_bulk_read_ex(jlink_jtag
->usb_handle
, JLINK_READ_ENDPOINT
,
936 (char *)usb_in_buffer
, expected_size
, JLINK_USB_TIMEOUT
);
938 DEBUG_JTAG_IO("jlink_usb_read, result = %d", result
);
940 #ifdef _DEBUG_USB_COMMS_
941 jlink_debug_buffer(usb_in_buffer
, result
);
946 /* Read the result from the previous EMU cmd into result_buffer. */
947 static int jlink_usb_read_emu_result(jlink_jtag_t
*jlink_jtag
)
949 int result
= usb_bulk_read_ex(jlink_jtag
->usb_handle
, JLINK_READ_ENDPOINT
,
950 (char *)usb_emu_result_buffer
, 1 /* JLINK_EMU_RESULT_BUFFER_SIZE */,
953 DEBUG_JTAG_IO("jlink_usb_read_result, result = %d", result
);
955 #ifdef _DEBUG_USB_COMMS_
956 jlink_debug_buffer(usb_emu_result_buffer
, result
);
961 #ifdef _DEBUG_USB_COMMS_
962 #define BYTES_PER_LINE 16
964 static void jlink_debug_buffer(u8
*buffer
, int length
)
971 for (i
= 0; i
< length
; i
+= BYTES_PER_LINE
)
973 snprintf(line
, 5, "%04x", i
);
974 for (j
= i
; j
< i
+ BYTES_PER_LINE
&& j
< length
; j
++)
976 snprintf(s
, 4, " %02x", buffer
[j
]);
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)