#define PIN_RXD0 PINC0
#define PIN_TXD0 OUTC1
#define PIN_RESET_2 PINC2
-/* PC3 Not Connecte */
+/* PC3 Not Connected */
/* PC4 Not Connected */
#define PIN_RTCK PINC5
#define PIN_WR OUTC6
*
* Data stored in EP2 OUT buffer is shifted into the JTAG chain via TDI, TDO
* data is not sampled.
- * The TAP-FSM state is alyways left in the PAUSE-DR/PAUSE-IR state.
+ * The TAP-FSM state is always left in the PAUSE-DR/PAUSE-IR state.
*
* Maximum achievable TCK frequency is 142 kHz for ULINK clocked at 24 MHz.
*
*
* Data stored in EP2 OUT buffer is shifted into the JTAG chain via TDI, TDO
* data is not sampled.
- * The TAP-FSM state is alyways left in the PAUSE-DR/PAUSE-IR state.
+ * The TAP-FSM state is always left in the PAUSE-DR/PAUSE-IR state.
*
* Maximum achievable TCK frequency is 97 kHz for ULINK clocked at 24 MHz.
*
*
* Data stored in EP2 OUT buffer is shifted into the JTAG chain via TDI, TDO
* data is sampled and stored in the EP2 IN buffer.
- * The TAP-FSM state is alyways left in the PAUSE-DR/PAUSE-IR state.
+ * The TAP-FSM state is always left in the PAUSE-DR/PAUSE-IR state.
*
* Maximum achievable TCK frequency is 100 kHz for ULINK clocked at 24 MHz.
*
*
* Data stored in EP2 OUT buffer is shifted into the JTAG chain via TDI, TDO
* data is sampled and stored in the EP2 IN buffer.
- * The TAP-FSM state is alyways left in the PAUSE-DR/PAUSE-IR state.
+ * The TAP-FSM state is always left in the PAUSE-DR/PAUSE-IR state.
*
* Maximum achievable TCK frequency is 78 kHz for ULINK clocked at 24 MHz.
*
*
* Maximum achievable TCK frequency is 375 kHz for ULINK clocked at 24 MHz.
*
- * @param count number of TCK clock cyclces to generate.
+ * @param count number of TCK clock cycles to generate.
*/
void jtag_clock_tck(uint16_t count)
{
/**
* Generate TCK clock cycles at variable frequency.
*
- * Maximum achieveable TCK frequency is 166.6 kHz for ULINK clocked at 24 MHz.
+ * Maximum achievable TCK frequency is 166.6 kHz for ULINK clocked at 24 MHz.
*
- * @param count number of TCK clock cyclces to generate.
+ * @param count number of TCK clock cycles to generate.
*/
void jtag_slow_clock_tck(uint16_t count)
{
/* Most commands do not transfer IN data. To save code space, we write 0 to
* usb_in_bytecount here, then modify it in the switch statement below where
- * neccessary */
+ * necessary */
usb_in_bytecount = 0;
switch (OUT2BUF[cmd_id_index] /* Command ID */) {
volatile __xdata __at 0x7FE8 struct setup_data setup_data;
/* Define number of endpoints (except Control Endpoint 0) in a central place.
- * Be sure to include the neccessary endpoint descriptors! */
+ * Be sure to include the necessary endpoint descriptors! */
#define NUM_ENDPOINTS 2
__code struct usb_device_descriptor device_descriptor = {
case JTAG_TLR_RESET:
LOG_DEBUG_IO("statemove end in %i", cmd->cmd.statemove->end_state);
bitq_end_state(cmd->cmd.statemove->end_state);
- bitq_state_move(tap_get_end_state()); /* uncoditional TAP move */
+ bitq_state_move(tap_get_end_state()); /* unconditional TAP move */
break;
case JTAG_PATHMOVE:
tmp[0] = 0x00; /* exit OCD1 mode */
buspirate_serial_write(fd, tmp, 1);
usleep(10000);
- /* We ignore the return value here purposly, nothing we can do */
+ /* We ignore the return value here on purpose, nothing we can do */
buspirate_serial_read(fd, tmp, 5);
if (strncmp((char *)tmp, "BBIO1", 5) == 0) {
tmp[0] = 0x0F; /* reset BP */
LOG_INFO("CMSIS-DAP: Interface Initialised (JTAG)");
}
- /* Be conservative and supress submiting multiple HID requests
+ /* Be conservative and suppress submitting multiple HID requests
* until we get packet count info from the adaptor */
cmsis_dap_handle->packet_count = 1;
pending_queue_len = 12;
return ERROR_FAIL;
} else if (ret == JAYLINK_ERR_DEV_NOT_AVAILABLE) {
LOG_ERROR("Channel is not available for the requested amount of data. "
- "%" PRIu32 " bytes are avilable.", length);
+ "%" PRIu32 " bytes are available.", length);
free(buf);
return ERROR_FAIL;
} else if (ret != JAYLINK_OK) {
* @bits: TMS bits to be written (bit0, bit1 .. bitN)
* @nb_bits: number of TMS bits (between 1 and 8)
*
- * Write a serie of TMS transitions, where each transition consists in :
+ * Write a series of TMS transitions, where each transition consists in :
* - writing out TCK=0, TMS=<new_state>, TDI=<???>
* - writing out TCK=1, TMS=<new_state>, TDI=<???> which triggers the transition
* The function ensures that at the end of the sequence, the clock (TCK) is put
* jtag_vpi_path_move - ask a TMS sequence transition to JTAG
* @cmd: path transition
*
- * Write a serie of TMS transitions, where each transition consists in :
+ * Write a series of TMS transitions, where each transition consists in :
* - writing out TCK=0, TMS=<new_state>, TDI=<???>
* - writing out TCK=1, TMS=<new_state>, TDI=<???> which triggers the transition
* The function ensures that at the end of the sequence, the clock (TCK) is put
*
* Launch a JTAG IR-scan or DR-scan
*
- * Returns ERROR_OK if OK, ERROR_xxx if a read/write error occured.
+ * Returns ERROR_OK if OK, ERROR_xxx if a read/write error occurred.
*/
static int jtag_vpi_scan(struct scan_command *cmd)
{
serv_addr.sin_addr.s_addr = inet_addr(server_address);
if (serv_addr.sin_addr.s_addr == INADDR_NONE) {
- LOG_ERROR("inet_addr error occured");
+ LOG_ERROR("inet_addr error occurred");
return ERROR_FAIL;
}
}
if (serv_addr.sin_addr.s_addr == htonl(INADDR_LOOPBACK)) {
- /* This increases performance drematically for local
+ /* This increases performance dramatically for local
* connections, which is the most likely arrangement
* for a VPI connection. */
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int));
for (uint8_t j = 0; j < sizeof(devices) && acquire_count == i; j++) {
retval = kitprog_acquire_psoc(devices[j], ACQUIRE_MODE_RESET, 3);
if (retval != ERROR_OK) {
- LOG_DEBUG("Aquisition function failed for device 0x%02x.", devices[j]);
+ LOG_DEBUG("Acquisition function failed for device 0x%02x.", devices[j]);
return retval;
}
* size (64 bytes) as required by the USB specification.
* Therefore libusb would wait for continuation of transmission.
* Workaround: Limit bulk read size to expected number of bytes
- * for problematic tranfer sizes. Otherwise use the maximum buffer
+ * for problematic transfer sizes. Otherwise use the maximum buffer
* size here because the KitProg sometimes doesn't like bulk reads
* of fewer than 62 bytes. (?!?!)
*/
return ERROR_FAIL;
}
- /* Copy TDO responce
+ /* Copy TDO response
*/
uint8_t *buffer = osbdm->buffer + 4;
for (int bit_idx = 0; bit_idx < length; ) {
unsigned char cmd;
if (presto->jtag_tck == 0)
- presto_sendbyte(0xA4); /* LED idicator - JTAG active */
+ presto_sendbyte(0xA4); /* LED indicator - JTAG active */
else if (presto->jtag_speed == 0 && !tdo_req && tms == presto->jtag_tms) {
presto->jtag_tdi_data |= (tdi != 0) << presto->jtag_tdi_count;
presto_tdi_flush();
presto_tck_idle();
- presto_sendbyte(0xA0); /* LED idicator - JTAG idle */
+ presto_sendbyte(0xA0); /* LED indicator - JTAG idle */
return presto_flush();
}
} dtc_queue;
/*
- * The tap state queue is for accumulating TAP state changes wiithout needlessly
+ * The tap state queue is for accumulating TAP state changes without needlessly
* flushing the dtc_queue. When it fills or is run, it adds the accumulated bytes to
* the dtc_queue.
*/
retval = tmp_retval;
#ifndef AUTOMATIC_BUSY_LED
- /* turn LED onff */
+ /* turn LED off */
ep1_generic_commandl(pHDev, 2,
EP1_CMD_SET_PORTD_LEDS,
~0
}
/*
- * Set read/write operation via the device file. Funtion pointers
+ * Set read/write operation via the device file. Function pointers
* are used here so more ways like remote accessing via socket could
* be added later.
*/
uint32_t address
STLINK_SWIM_RESET
- send syncronization seq (16us low, response 64 clocks low)
+ send synchronization seq (16us low, response 64 clocks low)
*/
#define STLINK_SWIM_ENTER 0x00
#define STLINK_SWIM_EXIT 0x01
}
/*
the purpose of this function is unknown...
- capabilites? anyway for swim v6 it returns
+ capabilities? anyway for swim v6 it returns
0001020600000000
*/
__attribute__((unused))
}
/*
- send resyncronize sequence
+ send resynchronize sequence
swim is pulled low for 16us
reply is 64 clks low
*/
*
* A gpio is required for tck, tms, tdi and tdo. One or both of srst and trst
* must be also be specified. The required jtag gpios are specified via the
- * sysfsgpio_jtag_nums command or the relevant sysfsgpio_XXX_num commang.
+ * sysfsgpio_jtag_nums command or the relevant sysfsgpio_XXX_num commands.
* The srst and trst gpios are set via the sysfsgpio_srst_num and
* sysfsgpio_trst_num respectively. GPIO numbering follows the kernel
* convention of starting from 0.
* 1. Maximum possible frequency without any artificial delay
* 2. Variable frequency with artificial linear delay loop
*
- * To set the ULINK to maximum frequency, it is only neccessary to use the
+ * To set the ULINK to maximum frequency, it is only necessary to use the
* corresponding command IDs. To set the ULINK to a lower frequency, the
* delay loop top values have to be calculated first. Then, a
* CMD_CONFIGURE_TCK_FREQ command needs to be sent to the ULINK device.
Throughput considerations
=========================
-Mesurements on a scope reveal that :
- - for bitbang mode, the throughtput is 56.5 kbits/s
- (as each clock transition is mesured at 17.7us)
+Measurements on a scope reveal that :
+ - for bitbang mode, the throughput is 56.5 kbits/s
+ (as each clock transition is measured at 17.7us)
- for byteshift mode, the throughput is 107.7 kbits/s
- (as 63 bits TDI transmission is mesured in 585 us)
+ (as 63 bits TDI transmission is measured in 585 us)
Let's suppose that to upload a 32 bits value, it is necessary to :
- move from IDLE to DR-SHIFT : 3 bitbang (3 TMS transitions)
= 53.1us + 222us + 88.5us
= 363us
-Throughtput in bit/s: 32 * (1 / 363E-6) = 88000 bits/s
-Throughtput in bytes/s: 11kBytes/s
+Throughput in bit/s: 32 * (1 / 363E-6) = 88000 bits/s
+Throughput in bytes/s: 11kBytes/s
Conclusion
==========
while (jtag_libusb_open(vids_renum, pids_renum, NULL,
&low->libusb_dev, NULL) != ERROR_OK && retry--) {
usleep(1000000);
- LOG_INFO("Waiting for renumerate...");
+ LOG_INFO("Waiting for reenumerate...");
}
if (!retry) {
* Output a TDI bit and assert clock to push it into the JTAG device :
* - writing out TCK=0, TMS=<old_state>=0, TDI=<tdi>
* - writing out TCK=1, TMS=<new_state>, TDI=<tdi> which triggers the JTAG
- * device aquiring the data.
+ * device acquiring the data.
*
* If a TDO is to be read back, the required read is requested (bitbang mode),
- * and the USB Blaster will send back a byte with bit0 reprensenting the TDO.
+ * and the USB Blaster will send back a byte with bit0 representing the TDO.
*/
static void ublast_clock_tdi(int tdi, enum scan_type type)
{
* @type: scan type (ie. does a readback of TDO is required)
*
* This function is the same as ublast_clock_tdi(), but it changes also the TMS
- * while outputing the TDI. This should be the last TDI output of a TDI
+ * while output the TDI. This should be the last TDI output of a TDI
* sequence, which will change state from :
* - IRSHIFT -> IREXIT1
* - or DRSHIFT -> DREXIT1
* @nb_bits: number of TMS bits (between 1 and 8)
* @skip: number of TMS bits to skip at the beginning of the series
*
- * Write a serie of TMS transitions, where each transition consists in :
+ * Write a series of TMS transitions, where each transition consists in :
* - writing out TCK=0, TMS=<new_state>, TDI=<???>
* - writing out TCK=1, TMS=<new_state>, TDI=<???> which triggers the transition
* The function ensures that at the end of the sequence, the clock (TCK) is put
* ublast_path_move - write a TMS sequence transition to JTAG
* @cmd: path transition
*
- * Write a serie of TMS transitions, where each transition consists in :
+ * Write a series of TMS transitions, where each transition consists in :
* - writing out TCK=0, TMS=<new_state>, TDI=<???>
* - writing out TCK=1, TMS=<new_state>, TDI=<???> which triggers the transition
* The function ensures that at the end of the sequence, the clock (TCK) is put
* bit0), second bit in (byte0, bit1), ...), which is what we want to return,
* simply read bytes from USB interface and store them.
*
- * Returns ERROR_OK if OK, ERROR_xxx if a read error occured
+ * Returns ERROR_OK if OK, ERROR_xxx if a read error occurred
*/
static int ublast_read_byteshifted_tdos(uint8_t *buf, int nb_bytes)
{
* - ninth bit is sotred in byte1, bit 0
* - etc ...
*
- * Returns ERROR_OK if OK, ERROR_xxx if a read error occured
+ * Returns ERROR_OK if OK, ERROR_xxx if a read error occurred
*/
static int ublast_read_bitbang_tdos(uint8_t *buf, int nb_bits)
{
* @nb_bits: number of bits
* @scan: scan type (ie. if TDO read back is required or not)
*
- * Outputs a serie of TDI bits on TDI.
+ * Outputs a series of TDI bits on TDI.
* As a side effect, the last TDI bit is sent along a TMS=1, and triggers a JTAG
* TAP state shift if input bits were non NULL.
*
*
* Launch a JTAG IR-scan or DR-scan
*
- * Returns ERROR_OK if OK, ERROR_xxx if a read/write error occured.
+ * Returns ERROR_OK if OK, ERROR_xxx if a read/write error occurred.
*/
static int ublast_scan(struct scan_command *cmd)
{
static void usbprog_jtag_write_and_read(struct usbprog_jtag *usbprog_jtag, char *buffer, int size)
{
- char tmp[64]; /* fastes packet size for usb controller */
+ char tmp[64]; /* fastest packet size for usb controller */
int send_bits, bufindex = 0, fillindex = 0, i, loops;
char swap;
- /* 61 byte can be transfered (488 bit) */
+ /* 61 byte can be transferred (488 bit) */
while (size > 0) {
if (size > 488) {
static void usbprog_jtag_read_tdo(struct usbprog_jtag *usbprog_jtag, char *buffer, int size)
{
- char tmp[64]; /* fastes packet size for usb controller */
+ char tmp[64]; /* fastest packet size for usb controller */
int send_bits, fillindex = 0, i, loops;
char swap;
- /* 61 byte can be transfered (488 bit) */
+ /* 61 byte can be transferred (488 bit) */
while (size > 0) {
if (size > 488) {
static void usbprog_jtag_write_tdi(struct usbprog_jtag *usbprog_jtag, char *buffer, int size)
{
- char tmp[64]; /* fastes packet size for usb controller */
+ char tmp[64]; /* fastest packet size for usb controller */
int send_bits, bufindex = 0, i, loops;
- /* 61 byte can be transfered (488 bit) */
+ /* 61 byte can be transferred (488 bit) */
while (size > 0) {
if (size > 488) {
send_bits = 488;
#define USB_TO_POLL_CHECKFAIL 0x03
#define USB_TO_POLL_VERIFYBUFF 0x04
-/* USB_TO_XXX Replys */
+/* USB_TO_XXX Replies */
#define USB_TO_XXX_OK 0x00
#define USB_TO_XXX_FAILED 0x01
#define USB_TO_XXX_TIME_OUT 0x02
/* connect to versaloon */
timeout_tmp = versaloon_usb_to;
- /* not output error message when connectting */
+ /* not output error message when connecting */
/* 100ms delay when connect */
versaloon_usb_to = 100;
for (retry = 0; retry < VERSALOON_RETRY_CNT; retry++) {
#define ERRMSG_INVALID_USAGE "Invalid usage of %s"
#define ERRMSG_INVALID_TARGET "Invalid %s"
#define ERRMSG_INVALID_PARAMETER "Invalid parameter of %s."
-#define ERRMSG_INVALID_INTERFACE_NUM "invalid inteface %d"
+#define ERRMSG_INVALID_INTERFACE_NUM "invalid interface %d"
#define ERRMSG_INVALID_BUFFER "Buffer %s is not valid."
#define ERRCODE_INVALID_BUFFER ERROR_FAIL
#define ERRCODE_INVALID_PARAMETER ERROR_FAIL
xds110.is_cmapi_acquired = false;
/* Run sequence to put target in SWD mode */
success = swd_connect();
- /* Re-iniitialize CMAPI API for DAP access */
+ /* Re-initialize CMAPI API for DAP access */
if (success) {
xds110.is_swd_mode = true;
success = cmapi_connect(&idcode);
uint32_t res;
int err;
- /* Note: This should be ok endianess-wise because by going
+ /* Note: This should be ok endianness-wise because by going
* through sysfs the kernel does the conversion in the config
* space accessor functions
*/
{
int err;
- /* Note: This should be ok endianess-wise because by going
+ /* Note: This should be ok endianness-wise because by going
* through sysfs the kernel does the conversion in the config
* space accessor functions
*/
.name = "hla_device_desc",
.handler = &hl_interface_handle_device_desc_command,
.mode = COMMAND_CONFIG,
- .help = "set the a device description of the adapter",
+ .help = "set the device description of the adapter",
.usage = "description_string",
},
{
int (*speed)(int speed);
/**
- * Returns JTAG maxium speed for KHz. 0 = RTCK. The function returns
+ * Returns JTAG maximum speed for KHz. 0 = RTCK. The function returns
* a failure if it can't support the KHz/RTCK.
*
* WARNING!!!! if RTCK is *slow* then think carefully about
};
/**
- * Defines the function signature requide for JTAG event callback
+ * Defines the function signature required for JTAG event callback
* functions, which are added with jtag_register_event_callback()
* and removed jtag_unregister_event_callback().
* @param event The event to handle.
- * @param prive A pointer to data that was passed to
+ * @param priv A pointer to data that was passed to
* jtag_register_event_callback().
* @returns Must return ERROR_OK on success, or an error code on failure.
*
*/
int jtag_config_rclk(unsigned fallback_speed_khz);
-/** Retreives the clock speed of the JTAG interface in KHz. */
+/** Retrieves the clock speed of the JTAG interface in KHz. */
unsigned jtag_get_speed_khz(void);
enum reset_types {
* assumptions about what the callback does or what its arguments are.
* These callbacks are typically executed *after* the *entire* JTAG
* queue has been executed for e.g. USB interfaces, and they are
- * guaranteeed to be invoked in the order that they were queued.
+ * guaranteed to be invoked in the order that they were queued.
*
* If the execution of the queue fails before the callbacks, then --
* depending on driver implementation -- the callbacks may or may not be
* path when transitioning to/from end
* state.
*
- * A list of unambigious single clock state transitions, not
+ * A list of unambiguous single clock state transitions, not
* all drivers can support this, but it is required for e.g.
* XScale and Xilinx support
*
* trst.
*
* the higher level jtag_add_reset will invoke jtag_add_tlr() if
- * approperiate
+ * appropriate
*/
int interface_jtag_add_reset(int trst, int srst);
int interface_jtag_add_sleep(uint32_t us);
# BEGIN MIGRATION AIDS ... these adapter operations originally had
# JTAG-specific names despite the fact that the operations were not
-# specific to JTAG, or otherewise had troublesome/misleading names.
+# specific to JTAG, or otherwise had troublesome/misleading names.
#
# FIXME phase these aids out after about April 2011
#