- added support for Hitex STM32 Performance Stick
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 23 Nov 2007 15:16:22 +0000 (15:16 +0000)
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 23 Nov 2007 15:16:22 +0000 (15:16 +0000)
- added str9 and stm32 scripts to docs

git-svn-id: svn://svn.berlios.de/openocd/trunk@213 b42882b7-edfa-0310-969c-e2dbd0fdcd60

doc/openocd.texi
src/jtag/ft2232.c

index 0f5bd9167673b5ab074416e47fd437a0dbdd77f0..95f17c0059259a084f8847900df7ef691ba9ee2c 100644 (file)
@@ -356,6 +356,8 @@ Luminary Micro EVB_LM3S811 as a JTAG interface (not onboard processor), no TRST
 SRST signals on external connector
 @item comstick
 Hitex STR9 comstick 
 SRST signals on external connector
 @item comstick
 Hitex STR9 comstick 
+@item stm32stick
+Hitex STM32 Performance Stick
 @end itemize
 
 @item @b{ft2232_vid_pid} <@var{vid}> <@var{pid}>
 @end itemize
 
 @item @b{ft2232_vid_pid} <@var{vid}> <@var{pid}>
@@ -1181,6 +1183,46 @@ working_area 0 0x50000000 16384 nobackup
 flash bank str9x 0x00000000 0x00080000 0 0 0
 @end smallexample
 
 flash bank str9x 0x00000000 0x00080000 0 0 0
 @end smallexample
 
+@section STR912 comstick
+@cindex STR912 comstick Script
+The following script was used with a Hitex STR9 Comstick:
+@smallexample
+#daemon configuration
+telnet_port 4444
+gdb_port 3333
+#interface
+interface ft2232
+ft2232_device_desc "STR9-comStick A"
+ft2232_layout comstick
+jtag_speed 1
+
+jtag_nsrst_delay 100
+jtag_ntrst_delay 100
+
+#use combined on interfaces or targets that can't set TRST/SRST separately
+reset_config trst_and_srst
+#jtag scan chain
+#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
+jtag_device 8 0x1 0x1 0xfe
+jtag_device 4 0x1 0xf 0xe
+jtag_device 5 0x1 0x1 0x1e
+#target configuration
+daemon_startup reset
+#target <type> <startup mode>
+#target arm966e <endianness> <reset mode> <chainpos> <variant>
+target arm966e little reset_halt 1 arm966e
+run_and_halt_time 0 30
+working_area 0 0x50000000 16384 nobackup
+#flash bank <driver> <base> <size> <chip_width> <bus_width>
+flash bank str9x 0x00000000 0x00080000 0 0 0
+@end smallexample
+
 @section STM32x Script
 @cindex STM32x Script
 The following script was used with an Amontec JTAGkey and a STM32x cpu:
 @section STM32x Script
 @cindex STM32x Script
 The following script was used with an Amontec JTAGkey and a STM32x cpu:
@@ -1194,7 +1236,49 @@ interface ft2232
 ft2232_device_desc "Amontec JTAGkey A"
 ft2232_layout jtagkey
 jtag_speed 10
 ft2232_device_desc "Amontec JTAGkey A"
 ft2232_layout jtagkey
 jtag_speed 10
+
+jtag_nsrst_delay 100
+jtag_ntrst_delay 100
+
+#use combined on interfaces or targets that can't set TRST/SRST separately
+reset_config trst_and_srst
+#jtag scan chain
+#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
+jtag_device 4 0x1 0xf 0xe
+jtag_device 5 0x1 0x1 0x1e
+#target configuration
+daemon_startup reset
+#target <type> <startup mode>
+#target cortex_m3 <endianness> <reset mode> <chainpos> <variant>
+target cortex_m3 little run_and_halt 0
+run_and_halt_time 0 30
+working_area 0 0x20000000 16384 nobackup
+#flash bank <driver> <base> <size> <chip_width> <bus_width>
+flash bank stm32x 0x08000000 0x00010000 0 0 0
+@end smallexample
+
+@section STM32x Performance Stick
+@cindex STM32x Performance Stick Script
+The following script was used with the Hitex STM32 Performance Stick
+@smallexample
+#daemon configuration
+telnet_port 4444
+gdb_port 3333
  
  
+#interface
+interface ft2232
+ft2232_device_desc "STM32-PerformanceStick A"
+ft2232_layout stm32stick
+jtag_speed 10
+
+jtag_nsrst_delay 100
+jtag_ntrst_delay 100
+
 #use combined on interfaces or targets that can't set TRST/SRST separately
 reset_config trst_and_srst
  
 #use combined on interfaces or targets that can't set TRST/SRST separately
 reset_config trst_and_srst
  
@@ -1202,6 +1286,7 @@ reset_config trst_and_srst
 #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
 jtag_device 4 0x1 0xf 0xe
 jtag_device 5 0x1 0x1 0x1e
 #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
 jtag_device 4 0x1 0xf 0xe
 jtag_device 5 0x1 0x1 0x1e
+jtag_device 4 0x1 0xf 0xe
  
 #target configuration
 daemon_startup reset
  
 #target configuration
 daemon_startup reset
index 137ea64b16ad80a2f1edff56543f719cfbab1091..201765cc917bf47f9bfc1879a67d41f3cfaaeeed 100644 (file)
@@ -100,6 +100,7 @@ int olimex_jtag_init(void);
 int flyswatter_init(void);
 int turtle_init(void);
 int comstick_init(void);
 int flyswatter_init(void);
 int turtle_init(void);
 int comstick_init(void);
+int stm32stick_init(void);
 
 /* reset procedures for supported layouts */
 void usbjtag_reset(int trst, int srst);
 
 /* reset procedures for supported layouts */
 void usbjtag_reset(int trst, int srst);
@@ -108,6 +109,7 @@ void olimex_jtag_reset(int trst, int srst);
 void flyswatter_reset(int trst, int srst);
 void turtle_reset(int trst, int srst);
 void comstick_reset(int trst, int srst);
 void flyswatter_reset(int trst, int srst);
 void turtle_reset(int trst, int srst);
 void comstick_reset(int trst, int srst);
+void stm32stick_reset(int trst, int srst);
 
 /* blink procedures for layouts that support a blinking led */
 void olimex_jtag_blink(void);
 
 /* blink procedures for layouts that support a blinking led */
 void olimex_jtag_blink(void);
@@ -125,6 +127,7 @@ ft2232_layout_t ft2232_layouts[] =
        {"flyswatter", flyswatter_init, flyswatter_reset, NULL},
        {"turtelizer2", turtle_init, turtle_reset, turtle_jtag_blink},
        {"comstick", comstick_init, comstick_reset, NULL},
        {"flyswatter", flyswatter_init, flyswatter_reset, NULL},
        {"turtelizer2", turtle_init, turtle_reset, turtle_jtag_blink},
        {"comstick", comstick_init, comstick_reset, NULL},
+       {"stm32stick", stm32stick_init, stm32stick_reset, NULL},
        {NULL, NULL, NULL},
 };
 
        {NULL, NULL, NULL},
 };
 
@@ -1073,6 +1076,39 @@ void comstick_reset(int trst, int srst)
        DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction);
 }
 
        DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction);
 }
 
+void stm32stick_reset(int trst, int srst)
+{
+       if (trst == 1)
+       {
+               cur_state = TAP_TLR;
+               high_output &= ~nTRST;
+       }
+       else if (trst == 0)
+       {
+               high_output |= nTRST;
+       }
+
+    if (srst == 1)
+    {
+        low_output &= ~nSRST;
+    }
+    else if (srst == 0)
+    {
+        low_output |= nSRST;
+    }
+       
+       /* command "set data bits low byte" */
+       BUFFER_ADD = 0x80;
+       BUFFER_ADD = low_output;
+       BUFFER_ADD = low_direction;
+       
+       /* command "set data bits high byte" */
+       BUFFER_ADD = 0x82;
+       BUFFER_ADD = high_output;
+       BUFFER_ADD = high_direction;
+       DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction);
+}
+
 int ft2232_execute_queue()
 {
        jtag_command_t *cmd = jtag_command_queue; /* currently processed command */
 int ft2232_execute_queue()
 {
        jtag_command_t *cmd = jtag_command_queue; /* currently processed command */
@@ -1916,6 +1952,49 @@ int comstick_init(void)
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
 
+int stm32stick_init(void)
+{
+       u8 buf[3];
+       u32 bytes_written;
+       
+       low_output = 0x88;
+       low_direction = 0x8b;
+       
+       /* initialize low byte for jtag */
+       buf[0] = 0x80; /* command "set data bits low byte" */
+       buf[1] = low_output; /* value (TMS=1,TCK=0, TDI=0, nOE=0) */
+       buf[2] = low_direction; /* dir (output=1), TCK/TDI/TMS=out, TDO=in, nOE=out */
+       DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]);
+       
+       if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3))
+       {
+               ERROR("couldn't initialize FT2232 with 'stm32stick' layout"); 
+               return ERROR_JTAG_INIT_FAILED;
+       }
+               
+       nTRST = 0x01;
+       nTRSTnOE = 0x00; /* no output enable for nTRST */
+       nSRST = 0x80;
+       nSRSTnOE = 0x00; /* no output enable for nSRST */
+       
+       high_output = 0x01;
+       high_direction = 0x03;
+       
+       /* initialize high port */
+       buf[0] = 0x82; /* command "set data bits high byte" */
+       buf[1] = high_output;
+       buf[2] = high_direction;
+       DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]);
+       
+       if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3))
+       {
+               ERROR("couldn't initialize FT2232 with 'stm32stick' layout"); 
+               return ERROR_JTAG_INIT_FAILED;
+       }
+       
+       return ERROR_OK;
+}
+
 void olimex_jtag_blink(void)
 {
        /* Olimex ARM-USB-OCD has a LED connected to ACBUS3
 void olimex_jtag_blink(void)
 {
        /* Olimex ARM-USB-OCD has a LED connected to ACBUS3

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)