]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - sdo-emu/openocd.git/commitdiff
Add support for XDS110 including setting supply voltage
authorEdward Fewell <efewell@ti.com>
Tue, 19 Jun 2018 19:10:13 +0000 (14:10 -0500)
committerEdward Fewell <efewell@ti.com>
Tue, 19 Jun 2018 19:10:13 +0000 (14:10 -0500)
openocd.pdf
openocd/doc/openocd.info
openocd/doc/openocd.info-1
openocd/doc/openocd.info-2
openocd/doc/openocd.texi
openocd/doc/stamp-vti
openocd/doc/version.texi
openocd/src/jtag/drivers/xds110.c

index c375ec69288f78d91e368d54a206a508375a580d..aff86ba2ba71fbd6c63b5f0554110cf3d1f1a309 100644 (file)
Binary files a/openocd.pdf and b/openocd.pdf differ
index c80bbdf77c727feb058f7acc28e5a564095e330e..bdae6634a2af038f8767696df5abcaa35adff895 100644 (file)
@@ -1,7 +1,7 @@
 This is openocd.info, produced by makeinfo version 6.1 from
 openocd.texi.
 
-This User's Guide documents release 0.10.0, dated 13 June 2018, of the
+This User's Guide documents release 0.10.0, dated 19 June 2018, of the
 Open On-Chip Debugger (OpenOCD).
 
    * Copyright (C) 2008 The OpenOCD Project
@@ -24,7 +24,7 @@ END-INFO-DIR-ENTRY
 \1f
 Indirect:
 openocd.info-1: 993
-openocd.info-2: 321136
+openocd.info-2: 321536
 \1f
 Tag Table:
 (Indirect)
@@ -32,83 +32,83 @@ Node: Top\7f993
 Node: About\7f3499
 Node: Developers\7f7816
 Node: Debug Adapter Hardware\7f11154
-Node: About Jim-Tcl\7f22936
-Node: Running\7f25081
-Node: OpenOCD Project Setup\7f30249
-Ref: OpenOCD Project Setup-Footnote-1\7f50202
-Ref: OpenOCD Project Setup-Footnote-2\7f50542
-Ref: OpenOCD Project Setup-Footnote-3\7f50810
-Node: Config File Guidelines\7f51138
-Ref: theinitboardprocedure\7f62012
-Ref: definecputargetsworkinginsmp\7f68801
-Ref: theinittargetsprocedure\7f73235
-Ref: theinittargeteventsprocedure\7f75053
-Ref: translatingconfigurationfiles\7f76906
-Ref: Config File Guidelines-Footnote-1\7f78133
-Node: Server Configuration\7f78208
-Ref: configurationstage\7f78530
-Ref: enteringtherunstage\7f79382
-Ref: tcpipports\7f81831
-Ref: gdbconfiguration\7f84400
-Ref: gdbbreakpointoverride\7f84715
-Ref: gdbflashprogram\7f85090
-Ref: eventpolling\7f86318
-Node: Debug Adapter Configuration\7f88754
-Ref: hla_interface\7f113020
-Ref: jtagspeed\7f118686
-Node: Reset Configuration\7f121644
-Ref: srstandtrstissues\7f124572
-Node: TAP Declaration\7f136617
-Ref: enablinganddisablingtaps\7f147795
-Ref: autoprobing\7f150442
-Ref: TAP Declaration-Footnote-1\7f153133
-Node: CPU Configuration\7f153333
-Ref: targettypes\7f156227
-Ref: targetconfiguration\7f158760
-Ref: rtostype\7f164136
-Ref: targetcurstate\7f168081
-Ref: targetevents\7f169322
-Node: Flash Commands\7f174313
-Ref: norconfiguration\7f175845
-Ref: flashprogrammingcommands\7f178504
-Ref: flashprotect\7f184750
-Ref: program\7f185576
-Ref: flashdriverlist\7f185834
-Ref: at91samd\7f194780
-Ref: at91sam3\7f197315
-Ref: nandconfiguration\7f240289
-Ref: nanddriverlist\7f250676
-Ref: Flash Commands-Footnote-1\7f257076
-Ref: Flash Commands-Footnote-2\7f257242
-Node: Flash Programming\7f257407
-Node: PLD/FPGA Commands\7f258903
-Node: General Commands\7f261067
-Ref: debuglevel\7f263121
-Ref: targetstatehandling\7f264228
-Ref: resetcommand\7f267984
-Ref: memoryaccess\7f270254
-Ref: imageaccess\7f271881
-Node: Architecture and Core Commands\7f276650
-Ref: armhardwaretracing\7f277120
-Ref: traceportdrivers\7f285038
-Ref: arm9vectorcatch\7f293316
-Ref: xscalevectorcatch\7f301719
-Ref: softwaredebugmessagesandtracing\7f316676
-Node: JTAG Commands\7f321136
-Node: Boundary Scan Commands\7f329586
-Node: Utility Commands\7f332048
-Node: TFTP\7f333882
-Node: GDB and OpenOCD\7f334751
-Ref: programmingusinggdb\7f339646
-Ref: usingopenocdsmpwithgdb\7f341091
-Ref: gdbrtossupport\7f342559
-Node: Tcl Scripting API\7f344254
-Node: FAQ\7f349056
-Ref: faqrtck\7f349166
-Ref: faqtaporder\7f361048
-Node: Tcl Crash Course\7f362811
-Node: License\7f374809
-Node: OpenOCD Concept Index\7f397220
-Node: Command and Driver Index\7f418030
+Node: About Jim-Tcl\7f23336
+Node: Running\7f25481
+Node: OpenOCD Project Setup\7f30649
+Ref: OpenOCD Project Setup-Footnote-1\7f50602
+Ref: OpenOCD Project Setup-Footnote-2\7f50942
+Ref: OpenOCD Project Setup-Footnote-3\7f51210
+Node: Config File Guidelines\7f51538
+Ref: theinitboardprocedure\7f62412
+Ref: definecputargetsworkinginsmp\7f69201
+Ref: theinittargetsprocedure\7f73635
+Ref: theinittargeteventsprocedure\7f75453
+Ref: translatingconfigurationfiles\7f77306
+Ref: Config File Guidelines-Footnote-1\7f78533
+Node: Server Configuration\7f78608
+Ref: configurationstage\7f78930
+Ref: enteringtherunstage\7f79782
+Ref: tcpipports\7f82231
+Ref: gdbconfiguration\7f84800
+Ref: gdbbreakpointoverride\7f85115
+Ref: gdbflashprogram\7f85490
+Ref: eventpolling\7f86718
+Node: Debug Adapter Configuration\7f89154
+Ref: hla_interface\7f113420
+Ref: jtagspeed\7f119086
+Node: Reset Configuration\7f122044
+Ref: srstandtrstissues\7f124972
+Node: TAP Declaration\7f137017
+Ref: enablinganddisablingtaps\7f148195
+Ref: autoprobing\7f150842
+Ref: TAP Declaration-Footnote-1\7f153533
+Node: CPU Configuration\7f153733
+Ref: targettypes\7f156627
+Ref: targetconfiguration\7f159160
+Ref: rtostype\7f164536
+Ref: targetcurstate\7f168481
+Ref: targetevents\7f169722
+Node: Flash Commands\7f174713
+Ref: norconfiguration\7f176245
+Ref: flashprogrammingcommands\7f178904
+Ref: flashprotect\7f185150
+Ref: program\7f185976
+Ref: flashdriverlist\7f186234
+Ref: at91samd\7f195180
+Ref: at91sam3\7f197715
+Ref: nandconfiguration\7f240689
+Ref: nanddriverlist\7f251076
+Ref: Flash Commands-Footnote-1\7f257476
+Ref: Flash Commands-Footnote-2\7f257642
+Node: Flash Programming\7f257807
+Node: PLD/FPGA Commands\7f259303
+Node: General Commands\7f261467
+Ref: debuglevel\7f263521
+Ref: targetstatehandling\7f264628
+Ref: resetcommand\7f268384
+Ref: memoryaccess\7f270654
+Ref: imageaccess\7f272281
+Node: Architecture and Core Commands\7f277050
+Ref: armhardwaretracing\7f277520
+Ref: traceportdrivers\7f285438
+Ref: arm9vectorcatch\7f293716
+Ref: xscalevectorcatch\7f302119
+Ref: softwaredebugmessagesandtracing\7f317076
+Node: JTAG Commands\7f321536
+Node: Boundary Scan Commands\7f329986
+Node: Utility Commands\7f332448
+Node: TFTP\7f334282
+Node: GDB and OpenOCD\7f335151
+Ref: programmingusinggdb\7f340046
+Ref: usingopenocdsmpwithgdb\7f341491
+Ref: gdbrtossupport\7f342959
+Node: Tcl Scripting API\7f344654
+Node: FAQ\7f349456
+Ref: faqrtck\7f349566
+Ref: faqtaporder\7f361448
+Node: Tcl Crash Course\7f363211
+Node: License\7f375209
+Node: OpenOCD Concept Index\7f397620
+Node: Command and Driver Index\7f418430
 \1f
 End Tag Table
index 6a568ceef50b535831e0b18c17c1571cc8fc043b..d83fff46b6910dfac741d21c9fbc6379781066ad 100644 (file)
@@ -1,7 +1,7 @@
 This is openocd.info, produced by makeinfo version 6.1 from
 openocd.texi.
 
-This User's Guide documents release 0.10.0, dated 13 June 2018, of the
+This User's Guide documents release 0.10.0, dated 19 June 2018, of the
 Open On-Chip Debugger (OpenOCD).
 
    * Copyright (C) 2008 The OpenOCD Project
@@ -27,7 +27,7 @@ File: openocd.info,  Node: Top,  Next: About,  Up: (dir)
 OpenOCD User's Guide
 ********************
 
-This User's Guide documents release 0.10.0, dated 13 June 2018, of the
+This User's Guide documents release 0.10.0, dated 19 June 2018, of the
 Open On-Chip Debugger (OpenOCD).
 
    * Copyright (C) 2008 The OpenOCD Project
@@ -528,6 +528,12 @@ connecting debuggers to ARM Cortex based targets
    * TI XDS110 Debug Probe
      The XDS110 is included as the embedded debug probe on many Texas
      Instruments LaunchPad evaluation boards.
+     The XDS110 is also available as a stand-alone USB debug probe.  The
+     XDS110 stand-alone probe has the additional ability to supply
+     voltage to the target board via its AUX FUNCTIONS port.  Use the
+     'xds110_supply_voltage <millivolts>' command to set the voltage.  0
+     turns off the supply.  Otherwise, the supply can be set to any
+     value in the range 1800 to 3600 millivolts.
      Link: <http://processors.wiki.ti.com/index.php/XDS110>
      Link:
      <http://processors.wiki.ti.com/index.php/XDS_Emulation_Software_Package#XDS110_Support_Utilities>
index 1f32ad8276f15c3a1e379082f92c3768c247e5b4..be51d9c131e5c503e16b6f7bdc06bc9b553e0d7b 100644 (file)
@@ -1,7 +1,7 @@
 This is openocd.info, produced by makeinfo version 6.1 from
 openocd.texi.
 
-This User's Guide documents release 0.10.0, dated 13 June 2018, of the
+This User's Guide documents release 0.10.0, dated 19 June 2018, of the
 Open On-Chip Debugger (OpenOCD).
 
    * Copyright (C) 2008 The OpenOCD Project
index 0d7bc374e496541e8129314d3392f8edcfb71477..4bbdb8e66ec5efe144bc7c0049f371abe48430bc 100644 (file)
@@ -535,6 +535,12 @@ debuggers to ARM Cortex based targets @url{http://www.keil.com/support/man/docs/
 @item @b{TI XDS110 Debug Probe}
 @* The XDS110 is included as the embedded debug probe on many Texas Instruments
 LaunchPad evaluation boards.
+@* The XDS110 is also available as a stand-alone USB debug probe. The XDS110
+stand-alone probe has the additional ability to supply voltage to the target
+board via its AUX FUNCTIONS port. Use the
+@command{xds110_supply_voltage <millivolts>} command to set the voltage. 0 turns
+off the supply. Otherwise, the supply can be set to any value in the range 1800
+to 3600 millivolts.
 @* Link: @url{http://processors.wiki.ti.com/index.php/XDS110}
 @* Link: @url{http://processors.wiki.ti.com/index.php/XDS_Emulation_Software_Package#XDS110_Support_Utilities}
 @end itemize
index 86b9ccbec917e023f850f6f9f6e5ff7b210675b2..108175f17dcb2c58e7471b0be459669eb38b83c1 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 13 June 2018
+@set UPDATED 19 June 2018
 @set UPDATED-MONTH June 2018
 @set EDITION 0.10.0
 @set VERSION 0.10.0
index 86b9ccbec917e023f850f6f9f6e5ff7b210675b2..108175f17dcb2c58e7471b0be459669eb38b83c1 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 13 June 2018
+@set UPDATED 19 June 2018
 @set UPDATED-MONTH June 2018
 @set EDITION 0.10.0
 @set VERSION 0.10.0
index 029c27e70667ebf00ec25fba5f8494b3c40a1034..4a20f943bb0fdb685710a831d3f79ca9413ba70c 100644 (file)
 /* XDS110 USB serial number length */
 #define XDS110_SERIAL_LEN 8
 
+/* XDS110 stand-alone probe voltage supply limits */
+#define XDS110_MIN_VOLTAGE 1800
+#define XDS110_MAX_VOLTAGE 3600
+
+/* XDS110 stand-alone probe hardware ID */
+#define XDS110_STAND_ALONE_ID 0x21
+
 /* Firmware version that introduced OpenOCD support via block accesses */
 #define OCD_FIRMWARE_VERSION 0x02030011
 #define OCD_FIRMWARE_UPGRADE \
 #define SWD_DISCONNECT   0x18 /* Switch from SWD to JTAG connection */
 #define CJTAG_CONNECT    0x2b /* Switch from JTAG to cJTAG connection */
 #define CJTAG_DISCONNECT 0x2c /* Switch from cJTAG to JTAG connection */
+#define XDS_SET_SUPPLY   0x32 /* Set up stand-alone probe upply voltage */
 #define OCD_DAP_REQUEST  0x3a /* Handle block of DAP requests */
 #define OCD_SCAN_REQUEST 0x3b /* Handle block of JTAG scan requests */
 #define OCD_PATHMOVE     0x3c /* Handle PATHMOVE to navigate JTAG states */
@@ -219,6 +227,8 @@ struct xds110_info {
        uint32_t delay_count;
        /* XDS110 serial number */
        char serial[XDS110_SERIAL_LEN + 1];
+       /* XDS110 voltage supply setting */
+       uint32_t voltage;
        /* XDS110 firmware and hardware version */
        uint32_t firmware;
        uint16_t hardware;
@@ -242,6 +252,7 @@ static struct xds110_info xds110 = {
        .speed = XDS110_MAX_TCK_SPEED,
        .delay_count = 0,
        .serial = {0},
+       .voltage = 0,
        .firmware = 0,
        .hardware = 0,
        .txn_request_size = 0,
@@ -601,10 +612,15 @@ static bool xds_execute(uint32_t out_length, uint32_t in_length,
                        if (bytes_read != in_length) {
                                /* Unexpected amount of data returned */
                                success = false;
+                               LOG_DEBUG("XDS110: command 0x%02x return %d bytes, expected %d",
+                                       xds110.write_payload[0], bytes_read, in_length);
                        } else {
                                /* Extract error code from return packet */
                                error = (int)xds110_get_u32(&xds110.read_payload[0]);
                                done = true;
+                               if (SC_ERR_NONE != error)
+                                       LOG_DEBUG("XDS110: command 0x%02x returned error %d",
+                                               xds110.write_payload[0], error);
                        }
                }
        }
@@ -952,6 +968,24 @@ static bool cjtag_disconnect(void)
        return success;
 }
 
+static bool xds_set_supply(uint32_t voltage)
+{
+       uint8_t *volts_pntr = &xds110.write_payload[XDS_OUT_LEN + 0]; /* 32-bits */
+       uint8_t *source_pntr = &xds110.write_payload[XDS_OUT_LEN + 4]; /* 8-bits */
+
+       bool success;
+
+       xds110.write_payload[0] = XDS_SET_SUPPLY;
+
+       xds110_set_u32(volts_pntr, voltage);
+       *source_pntr = (uint8_t)(0 != voltage ? 1 : 0);
+
+       success = xds_execute(XDS_OUT_LEN + 5, XDS_IN_LEN, DEFAULT_ATTEMPTS,
+                               DEFAULT_TIMEOUT);
+
+       return success;
+}
+
 static bool ocd_dap_request(uint8_t *dap_requests, uint32_t request_size,
        uint32_t *dap_results, uint32_t result_count)
 {
@@ -1318,7 +1352,7 @@ static void xds110_show_info(void)
                (((firmware >>  4) & 0xf) * 10) + ((firmware >>  0) & 0xf));
        LOG_INFO("XDS110: hardware version = 0x%04x", xds110.hardware);
        if (0 != xds110.serial[0])
-               LOG_INFO("XDS110: serial number = %s)", xds110.serial);
+               LOG_INFO("XDS110: serial number = %s", xds110.serial);
        if (xds110.is_swd_mode) {
                LOG_INFO("XDS110: connected to target via SWD");
                LOG_INFO("XDS110: SWCLK set to %d kHz", xds110.speed);
@@ -1390,6 +1424,17 @@ static int xds110_init(void)
                }
        }
 
+       if (success) {
+               /* Set supply voltage for stand-alone probes */
+               if (XDS110_STAND_ALONE_ID == xds110.hardware)
+                       success = xds_set_supply(xds110.voltage);
+               else if (0 != xds110.voltage) {
+                       /* Voltage supply not a feature of embedded probes */
+                       LOG_WARNING(
+                               "XDS110: ignoring supply voltage, not supported on this probe");
+               }
+       }
+
        if (success) {
                success = xds_set_trst(0);
                if (success)
@@ -1921,6 +1966,31 @@ COMMAND_HANDLER(xds110_handle_serial_command)
        return ERROR_OK;
 }
 
+COMMAND_HANDLER(xds110_handle_supply_voltage_command)
+{
+       uint32_t voltage = 0;
+
+       if (CMD_ARGC == 1) {
+               COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], voltage);
+               if (voltage == 0 || (voltage >= XDS110_MIN_VOLTAGE && voltage 
+                       <= XDS110_MAX_VOLTAGE)) {
+                       /* Requested voltage is in range */
+                       xds110.voltage = voltage;
+               } else {
+                       LOG_ERROR("XDS110: voltage must be 0 or between %d and %d "
+                               "millivolts", XDS110_MIN_VOLTAGE, XDS110_MAX_VOLTAGE);
+                       return ERROR_FAIL;
+               }
+               xds110.voltage = voltage;
+       } else {
+               LOG_ERROR("XDS110: expected one argument to xds110_supply_voltage "
+                       "<millivolts>");
+               return ERROR_FAIL;
+       }
+
+       return ERROR_OK;
+}
+
 static const struct command_registration xds110_subcommand_handlers[] = {
        {
                .name = "info",
@@ -1947,6 +2017,13 @@ static const struct command_registration xds110_command_handlers[] = {
                .help = "set the XDS110 probe serial number",
                .usage = "serial_string",
        },
+       {
+               .name = "xds110_supply_voltage",
+               .handler = &xds110_handle_supply_voltage_command,
+               .mode = COMMAND_CONFIG,
+               .help = "set the XDS110 probe supply voltage",
+               .usage = "supply_voltage (millivolts)",
+       },
        COMMAND_REGISTRATION_DONE
 };