Compare commits

...

19 Commits

Author SHA1 Message Date
Freddie Chopin d9c4700b4d The openocd-0.6.1 release.
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-10-07 10:17:48 +02:00
Olivier Schonken e69b94295e Modified Sector Erase for AT91SAM4S
In FLASHD_ErasePages AT91C_EFC_FCMD_EPA is used to erase sectors.
According to the datasheet FARG[15:2] defines the page from which
the erase will start.This page must be modulo 4, 8, 16 or 32
according to the number of pages to erase. FARG[1:0] defines the
number of pages to be erased. Previously (firstpage << 2) was used
to conform to this, seems it should not be shifted... Changed it
to (firstPage) | erasePages.

Change-Id: I791cc7fc4faf056623ad5a6c7e860315306098a1
Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
Reviewed-on: http://openocd.zylin.com/897
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-10-07 07:23:12 +00:00
Spencer Oliver 6d1ea5a7a9 ftdi: fix adapter_init rclk fallback
adapter_init expects jtag_get_speed (via ftdi_khz) to return a valid
fallback speed if the adapter does not support rclk. The call was failing
and so was the rest of the adapter init.

The makes the new ftdi driver emulate the old ftdi driver.

Change-Id: Ic7fac7d201241eb181e98f1ba7111f159731f6e0
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/877
Tested-by: jenkins
2012-10-04 15:58:46 +00:00
Spencer Oliver 8f944fc226 cfg: add STM32F3-DISCOVERY board support
Change-Id: I4a02e0504fc04ffc1238d9bb77ec05c1f781e7e8
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/876
Tested-by: jenkins
2012-10-04 15:58:41 +00:00
Spencer Oliver 6544018321 flash: add stm32f3 rev 2 flash support
Change-Id: Ibab5112f5f70a609136d01ebc50530a334640d03
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/875
Tested-by: jenkins
2012-10-04 15:58:36 +00:00
Spencer Oliver 80a9e44ac7 cfg: fix incorrect stm32f3 TAPID
Change-Id: Id66d4e03a77c47a49086ee753bed01b3944064e1
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/874
Tested-by: jenkins
2012-10-04 15:58:29 +00:00
Spencer Oliver f5793f9a4a cfg: cortino tested and working
Change-Id: I13534742c76ebbb05b47bf98768c997068da747a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/888
Tested-by: jenkins
2012-10-04 15:57:51 +00:00
Spencer Oliver 6145b016c2 cfg: fix incorrect cortino reset config
The cortino uses a direct srst connection rather than via any buffer.
As a result this fixes issues with the newer ftdi driver.

Change-Id: I28f6781bccae24de79aa6a03161f298a14fe2581
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/887
Tested-by: jenkins
2012-10-04 15:57:47 +00:00
Spencer Oliver 2d0750d708 lpc1768-stick: avoid driving srst high at startup
this avoid driving nSRST high after startup, by making sure the nOE is
initialized inactive/high.

This also matches the config used for the STM32-PerformanceStick.

Change-Id: I9376de575b7dc834310d57dbd58575d51f60183e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/889
Tested-by: jenkins
2012-10-04 15:57:28 +00:00
Spencer Oliver 00581ae591 cfg: update ti/stellaris url's
Change-Id: I96f17c5ea2be506a6b88434616ca52c3e392868a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/890
Tested-by: jenkins
2012-10-04 15:57:15 +00:00
Spencer Oliver f8a537aa92 cfg: lm3s811ek config tested and working
Change-Id: I5402b5521d6e1ef0a569f5cad02c003681f5444b
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/885
Tested-by: jenkins
2012-10-04 15:57:01 +00:00
Spencer Oliver feb926a770 cfg: ftdi icdi enable srst open drain config
Change-Id: I21a115121f167dc88cd9bf2d1ca1ac9f3e1110d7
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/886
Tested-by: jenkins
2012-10-04 15:56:46 +00:00
Spencer Oliver 0c0c1b81e2 cfg: str9-comstick tested and working
Change-Id: Ia6c45477381e78cb9508b4731438161e18be1f38
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/882
Tested-by: jenkins
2012-10-04 15:56:31 +00:00
Spencer Oliver a384596034 cfg: fix incorrect str9-comstick reset config
The str9-comstick uses a direct srst connection rather than via any buffer.
As a result this fixes issues with the newer ftdi driver.

Change-Id: I0968e8459997a6a2b7bf0c46e89662cd57b4f496
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/881
Tested-by: jenkins
2012-10-04 15:56:26 +00:00
Spencer Oliver 027f8c9fb3 cfg: stm32-performance stick config tested and working
Change-Id: I9852d11e369e501af240a2b8e9f74306aee4e4a0
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/884
Tested-by: jenkins
2012-10-04 15:55:53 +00:00
Spencer Oliver 612cad7f7c cfg: fix incorrect stm32-performance stick config
This hardware uses a output enable buffer that was not correctly defined.
Fixes issues when using the new ftdi driver.

Change-Id: Iba6235a71a6d3c7d16ab729f858b336a4574dfea
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/883
Tested-by: jenkins
2012-10-04 15:55:48 +00:00
Spencer Oliver 07a73c01d1 ftdi: correct ftdi_initialize error text
Change-Id: If230c0b5b3a18fd273106b743404079d0cbc9ddc
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/880
Tested-by: jenkins
2012-10-04 15:55:24 +00:00
Spencer Oliver 6cb0c3ff14 ftdi: incorrectly using output register for direction
fix a simple copy/paste bug.

Change-Id: I5caaa4d16d30f26a453bd6a00c95261fd6e716c5
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/873
Tested-by: jenkins
2012-10-02 08:44:20 +00:00
Freddie Chopin f254667a13 Revert "target: remove unused working area 'user' field"
This reverts commit 63a23e6fc8, which
causes problems with various flash drivers (i.e. LPC1xxx/LPC2xxx)
due to working area handling.

Change-Id: I291ff2ac4f1eef7ecd553d0eb8895b790beb38c3
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/872
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-02 08:44:14 +00:00
20 changed files with 73 additions and 42 deletions

View File

@ -1,5 +1,5 @@
AC_PREREQ(2.60)
AC_INIT([openocd], [0.6.0],
AC_INIT([openocd], [0.6.1],
[OpenOCD Mailing List <openocd-devel@lists.sourceforge.net>])
AC_CONFIG_SRCDIR([src/openocd.c])

View File

@ -722,10 +722,17 @@ static int FLASHD_ErasePages(struct sam4_bank_private *pPrivate,
break;
}
/* AT91C_EFC_FCMD_EPA
* According to the datasheet FARG[15:2] defines the page from which
* the erase will start.This page must be modulo 4, 8, 16 or 32
* according to the number of pages to erase. FARG[1:0] defines the
* number of pages to be erased. Previously (firstpage << 2) was used
* to conform to this, seems it should not be shifted...
*/
return EFC_PerformCommand(pPrivate,
/* send Erase Page */
AT91C_EFC_FCMD_EPA,
(firstPage << 2) | erasePages,
(firstPage) | erasePages,
status);
}

View File

@ -1142,6 +1142,10 @@ static int get_stm32x_info(struct flash_bank *bank, char *buf, int buf_size)
snprintf(buf, buf_size, "1.0");
break;
case 0x2000:
snprintf(buf, buf_size, "2.0");
break;
default:
snprintf(buf, buf_size, "unknown");
break;
@ -1188,6 +1192,10 @@ static int get_stm32x_info(struct flash_bank *bank, char *buf, int buf_size)
snprintf(buf, buf_size, "1.0");
break;
case 0x2000:
snprintf(buf, buf_size, "2.0");
break;
default:
snprintf(buf, buf_size, "unknown");
break;

View File

@ -175,7 +175,7 @@ static int ftdi_set_signal(const struct signal *s, char value)
output = data ? output | s->data_mask : output & ~s->data_mask;
if (s->oe_mask == s->data_mask)
direction = oe ? output | s->oe_mask : output & ~s->oe_mask;
direction = oe ? direction | s->oe_mask : direction & ~s->oe_mask;
else
output = oe ? output | s->oe_mask : output & ~s->oe_mask;
@ -247,6 +247,11 @@ static int ftdi_speed_div(int speed, int *khz)
static int ftdi_khz(int khz, int *jtag_speed)
{
if (khz == 0 && !mpsse_is_high_speed(mpsse_ctx)) {
LOG_DEBUG("RCLK not supported");
return ERROR_FAIL;
}
*jtag_speed = khz * 1000;
return ERROR_OK;
}
@ -638,7 +643,7 @@ static int ftdi_initialize(void)
if (retval == ERROR_OK)
retval = mpsse_set_data_bits_high_byte(mpsse_ctx, output >> 8, direction >> 8);
if (retval != ERROR_OK) {
LOG_ERROR("couldn't initialize FTDI with 'JTAGkey' layout");
LOG_ERROR("couldn't initialize FTDI with configured layout");
return ERROR_JTAG_INIT_FAILED;
}

View File

@ -1405,6 +1405,7 @@ static void target_split_working_area(struct working_area *area, uint32_t size)
new_wa->size = area->size - size;
new_wa->address = area->address + size;
new_wa->backup = NULL;
new_wa->user = NULL;
new_wa->free = true;
area->next = new_wa;
@ -1493,6 +1494,7 @@ int target_alloc_working_area_try(struct target *target, uint32_t size, struct w
new_wa->size = target->working_area_size & ~3UL; /* 4-byte align */
new_wa->address = target->working_area;
new_wa->backup = NULL;
new_wa->user = NULL;
new_wa->free = true;
}
@ -1536,6 +1538,9 @@ int target_alloc_working_area_try(struct target *target, uint32_t size, struct w
c->free = false;
*area = c;
/* user pointer */
c->user = area;
print_wa_layout(target);
return ERROR_OK;
@ -1586,6 +1591,13 @@ static int target_free_working_area_restore(struct target *target, struct workin
LOG_DEBUG("freed %"PRIu32" bytes of working area at address 0x%08"PRIx32,
area->size, area->address);
/* mark user pointer invalid */
/* TODO: Is this really safe? It points to some previous caller's memory.
* How could we know that the area pointer is still in that place and not
* some other vital data? What's the purpose of this, anyway? */
*area->user = NULL;
area->user = NULL;
target_merge_working_areas(target);
print_wa_layout(target);
@ -1613,6 +1625,8 @@ static void target_free_all_working_areas_restore(struct target *target, int res
if (restore)
target_restore_working_area(target, c);
c->free = true;
*c->user = NULL; /* Same as above */
c->user = NULL;
}
c = c->next;
}

View File

@ -95,6 +95,7 @@ struct working_area {
uint32_t size;
bool free;
uint8_t *backup;
struct working_area **user;
struct working_area *next;
};

View File

@ -1,7 +1,8 @@
#
# TI/Luminary Stellaris LM3S1968 Evaluation Kits
#
# http://www.luminarymicro.com/products/lm3s1968_evaluation_kits.html
# http://www.ti.com/tool/ek-lm3s1968
#
# NOTE: to use J-Link instead of the on-board interface,
# you may also need to reduce adapter_khz to be about 1200.

View File

@ -1,5 +1,8 @@
# Stellaris lm3s3748 Evaluation Kit
# http://www.luminarymicro.com/products/lm3s3748_usb_h_d_evaluation_kits.html
#
# TI/Luminary Stellaris lm3s3748 Evaluation Kits
#
# http://www.ti.com/tool/ek-lm3s3748
#
# NOTE: using the on-board FT2232 JTAG/SWD/SWO interface is optional!
# so is using it in JTAG mode, as done here.

View File

@ -1,7 +1,8 @@
#
# TI/Luminary Stellaris LM3S6965 Evaluation Kits
#
# http://www.luminarymicro.com/products/lm3s6965_ethernet_evaluation_kit.html
# http://www.ti.com/tool/ek-lm3s6965
#
# NOTE: using the on-board FT2232 JTAG/SWD/SWO interface is optional!
# so is using it in JTAG mode, as done here.

View File

@ -1,7 +1,8 @@
#
# TI/Luminary Stellaris LM3S811 Evaluation Kits (rev B and earlier)
#
# http://www.luminarymicro.com/products/stellaris_811_evaluation_kits.html
# http://www.ti.com/tool/ek-lm3s811
#
# NOTE: newer 811-EK boards (rev C and above) shouldn't use this.
# use board/ek-lm3s811.cfg

View File

@ -1,7 +1,8 @@
#
# TI/Luminary Stellaris LM3S811 Evaluation Kits
#
# http://www.luminarymicro.com/products/stellaris_811_evaluation_kits.html
# http://www.ti.com/tool/ek-lm3s811
#
# NOTE: using the on-board FT2232 JTAG/SWD/SWO interface is optional!
# so is using it in JTAG mode, as done here.

View File

@ -1,8 +1,8 @@
#
# Luminary Micro Stellaris LM3S9B9x Evaluation Kits
# TI/Luminary Stellaris LM3S9B9x Evaluation Kits
#
# http://www.luminarymicro.com/products/ek-lm3s9b90.html
# http://www.luminarymicro.com/products/ek-lm3s9b92.html
# http://www.ti.com/tool/ek-lm3s9b90
# http://www.ti.com/tool/ek-lm3s9b92
#
# NOTE: using the bundled FT2232 JTAG/SWD/SWO interface is optional!

View File

@ -0,0 +1,9 @@
# This is an STM32F3 discovery board with a single STM32F303VCT6 chip.
# http://www.st.com/internet/evalboard/product/254044.jsp
source [find interface/stlink-v2.cfg]
source [find target/stm32f3x_stlink.cfg]
# use hardware reset, connect under reset
reset_config srst_only srst_nogate

View File

@ -4,15 +4,10 @@
# http://www.hitex.com/index.php?id=cortino
#
echo "WARNING!"
echo "This file was not tested with real interface, it is based on code in ft2232.c."
echo "Please report your experience with this file to openocd-devel mailing list,"
echo "so it could be marked as working or fixed."
interface ftdi
ftdi_device_desc "Cortino"
ftdi_vid_pid 0x0640 0x0032
ftdi_layout_init 0x0308 0x031b
ftdi_layout_init 0x0108 0x010b
ftdi_layout_signal nTRST -data 0x0100
ftdi_layout_signal nSRST -data 0x0200
ftdi_layout_signal nSRST -data 0x0200 -oe 0x0200

View File

@ -9,7 +9,7 @@ interface ftdi
ftdi_device_desc "LPC1768-Stick"
ftdi_vid_pid 0x0640 0x0026
ftdi_layout_init 0x0188 0x038b
ftdi_layout_init 0x0388 0x038b
ftdi_layout_signal nTRST -data 0x0100
ftdi_layout_signal nSRST -data 0x0080 -noe 0x200

View File

@ -4,15 +4,10 @@
# http://www.hitex.com/index.php?id=383
#
echo "WARNING!"
echo "This file was not tested with real interface, it is based on code in ft2232.c."
echo "Please report your experience with this file to openocd-devel mailing list,"
echo "so it could be marked as working or fixed."
interface ftdi
ftdi_device_desc "STR9-comStick"
ftdi_vid_pid 0x0640 0x002c
ftdi_layout_init 0x0308 0x030b
ftdi_layout_init 0x0108 0x010b
ftdi_layout_signal nTRST -data 0x0100
ftdi_layout_signal nSRST -data 0x0200
ftdi_layout_signal nSRST -data 0x0200 -oe 0x0200

View File

@ -11,11 +11,6 @@
# need to use the "luminary_icdi" layout to work correctly.
#
echo "WARNING!"
echo "This file was not tested with real interface, it is based on code in ft2232.c."
echo "Please report your experience with this file to openocd-devel mailing list,"
echo "so it could be marked as working or fixed."
interface ftdi
ftdi_device_desc "LM3S811 Evaluation Board"
ftdi_vid_pid 0x0403 0xbcd9

View File

@ -29,4 +29,4 @@ ftdi_device_desc "Stellaris Evaluation Board"
ftdi_vid_pid 0x0403 0xbcd9
ftdi_layout_init 0x00a8 0x00eb
ftdi_layout_signal nSRST -data 0x0020
ftdi_layout_signal nSRST -noe 0x0020

View File

@ -4,15 +4,10 @@
# http://www.hitex.com/index.php?id=340
#
echo "WARNING!"
echo "This file was not tested with real interface, it is based on code in ft2232.c."
echo "Please report your experience with this file to openocd-devel mailing list,"
echo "so it could be marked as working or fixed."
interface ftdi
ftdi_device_desc "STM32-PerformanceStick"
ftdi_vid_pid 0x0640 0x002d
ftdi_layout_init 0x0188 0x038b
ftdi_layout_init 0x0388 0x038b
ftdi_layout_signal nTRST -data 0x0100
ftdi_layout_signal nSRST -data 0x0080
ftdi_layout_signal nSRST -data 0x0080 -noe 0x200

View File

@ -7,7 +7,7 @@ if { [info exists CHIPNAME] == 0 } {
}
if { [info exists CPUTAPID] == 0 } {
set CPUTAPID 0x1ba01477
set CPUTAPID 0x2ba01477
}
if { [info exists WORKAREASIZE] == 0 } {