Re: [OpenOCD-devel] TCP/IP debug device

2012-01-09 Thread Christopher Harvey
On 09.01.2012 14:34, Andre Renaud wrote:
> Hi,
> I am looking at implementing a smart JTAG debugger - ethernet 
> attached,
> with enough intelligence within it to have some level of JTAG smarts,
> but not the full OpenOCD.

Everybody seems to wants to use ethernet and gdbserver. Why not go with 
serial and an embedded gdbserver? I feel the bandwidth of a serial port 
isn't going to be the bottleneck, considering the speed of JTAG or SWD.

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] TCP/IP debug device

2012-01-09 Thread Andre Renaud
On 10/01/12 11:02, Peter Stuge wrote:
> Andre Renaud wrote:
>> My main issue (I believe) is that I don't have a BSD sockets
>> library (currently using lwIP), so the GDB socket/Telnet socket
>> stuff would be incompatible.
> 
> lwIP can at least accept a few TCP connections.

Yes, the stack is perfectly capable, just the C API is incompatible, so
the source would need to be reworked.

>>> How will the product be licensed?
>>
>> This is really just a concept at this stage, so these kind of ideas
>> haven't been fully considered. I'm just looking at the technical
>> feasibility/effort.
> 
> I was thinking that it would be lovely to have an open firmware
> project for this functionality on one of the LM3S boards.

I was looking at using an STM32 as the base micro, rather than the
Luminary ones, but conceptually it would be very similar.

Regards,
Andre

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[OpenOCD-devel] [PATCH]: 2af3299 build: remove unused variables

2012-01-09 Thread gerrit
This is an automated email from Gerrit.

Spencer Oliver (s...@spen-soft.co.uk) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/361

-- gerrit

commit 2af3299cbaab14da8f8052f4c9dfd258f7ecc0b7
Author: Spencer Oliver 
Date:   Mon Jan 9 22:04:03 2012 +

build: remove unused variables

detected by clang.

Change-Id: Id9effcc5437870f37fecd33803f7753c6eca53d6
Signed-off-by: Spencer Oliver 

diff --git a/src/flash/nor/at91sam3.c b/src/flash/nor/at91sam3.c
index dac901e..85395cd 100644
--- a/src/flash/nor/at91sam3.c
+++ b/src/flash/nor/at91sam3.c
@@ -3008,7 +3008,6 @@ sam3_write(struct flash_bank *bank,
goto done;
}
buffer += count;
-   count  -= count;
}
LOG_DEBUG("Done!");
r = ERROR_OK;
@@ -3029,7 +3028,6 @@ COMMAND_HANDLER(sam3_handle_info_command)
 
unsigned x;
int r;
-   r = 0;
 
// bank0 must exist before we can do anything
if (pChip->details.bank[0].pBank == NULL) {
@@ -3114,13 +3112,11 @@ COMMAND_HANDLER(sam3_handle_gpnvm_command)
}
}
 
-
switch (CMD_ARGC) {
default:
return ERROR_COMMAND_SYNTAX_ERROR;
break;
case 0:
-   who = -1;
goto showall;
break;
case 1:
diff --git a/src/flash/nor/str7x.c b/src/flash/nor/str7x.c
index 91ef77b..57f860d 100644
--- a/src/flash/nor/str7x.c
+++ b/src/flash/nor/str7x.c
@@ -726,12 +726,10 @@ static int str7x_write(struct flash_bank *bank, uint8_t 
*buffer,
/* data word 1 */
target_write_memory(target, str7x_get_flash_adr(bank, 
FLASH_DR0),
4, 1, last_dword);
-   bytes_written += 4;
 
/* data word 2 */
target_write_memory(target, str7x_get_flash_adr(bank, 
FLASH_DR1),
4, 1, last_dword + 4);
-   bytes_written += 4;
 
/* start programming cycle */
cmd = FLASH_DWPG | FLASH_WMS;
diff --git a/src/target/stm32_stlink.c b/src/target/stm32_stlink.c
index c39d4c8..fce9b7f 100644
--- a/src/target/stm32_stlink.c
+++ b/src/target/stm32_stlink.c
@@ -511,7 +511,6 @@ static int stm32_stlink_step(struct target *target, int 
current,
return ERROR_TARGET_NOT_HALTED;
}
 
-   pc = armv7m->arm.pc;
if (!current) {
buf_set_u32(pc->value, 0, 32, address);
pc->dirty = true;

-- 

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] TCP/IP debug device

2012-01-09 Thread Peter Stuge
Andre Renaud wrote:
> My main issue (I believe) is that I don't have a BSD sockets
> library (currently using lwIP), so the GDB socket/Telnet socket
> stuff would be incompatible.

lwIP can at least accept a few TCP connections.


> > How will the product be licensed?
> 
> This is really just a concept at this stage, so these kind of ideas
> haven't been fully considered. I'm just looking at the technical
> feasibility/effort.

I was thinking that it would be lovely to have an open firmware
project for this functionality on one of the LM3S boards.


//Peter

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] TCP/IP debug device

2012-01-09 Thread Andre Renaud
On 10/01/12 10:31, Peter Stuge wrote:
> Andre Renaud wrote:
>> I am looking at implementing a smart JTAG debugger - ethernet attached,
>> with enough intelligence within it to have some level of JTAG smarts,
>> but not the full OpenOCD.
> ..
>> Does anyone have any comments on where I should start looking?
> 
> Even if you don't want full OpenOCD I guess zy1000 can have some
> hints.

That was actually my first idea - to build OpenOCD onto the device
itself. I thought that it would be too difficult, given the relatively
limited processor I have available. However it isn't impossible. I might
revisit this idea to see how difficult it is. My main issue (I believe)
is that I don't have a BSD sockets library (currently using lwIP), so
the GDB socket/Telnet socket stuff would be incompatible.

> How will the product be licensed?

This is really just a concept at this stage, so these kind of ideas
haven't been fully considered. I'm just looking at the technical
feasibility/effort.

Thanks for your input.

Regards,
Andre


--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[OpenOCD-devel] [PATCH]: 34a3c4a xsvf: fix clang warning

2012-01-09 Thread gerrit
This is an automated email from Gerrit.

Spencer Oliver (s...@spen-soft.co.uk) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/360

-- gerrit

commit 34a3c4a11f7dee70a7ae845dd74d0768a5642c2f
Author: Spencer Oliver 
Date:   Mon Jan 9 21:43:27 2012 +

xsvf: fix clang warning

clang reports 'Function call argument is an uninitialized value'.

Change-Id: I50f4a7932b59930a5f1e3ece70b12c59e85ea3c6
Signed-off-by: Spencer Oliver 

diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c
index 9fda8e3..5699d57 100644
--- a/src/xsvf/xsvf.c
+++ b/src/xsvf/xsvf.c
@@ -189,7 +189,7 @@ COMMAND_HANDLER(handle_xsvf_command)
tap_state_t xenddr = TAP_IDLE;
 
uint8_t opcode;
-   uint8_t uc;
+   uint8_t uc = 0;
longfile_offset = 0;
 
int loop_count = 0;

-- 

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[OpenOCD-devel] [PATCH]: 1e16d70 target: fix missing semihosting return path

2012-01-09 Thread gerrit
This is an automated email from Gerrit.

Spencer Oliver (s...@spen-soft.co.uk) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/359

-- gerrit

commit 1e16d70276920c70ea79cf09eaca1dad8ea8ad9a
Author: Spencer Oliver 
Date:   Mon Jan 9 21:35:19 2012 +

target: fix missing semihosting return path

bug nicely caught by clang.

Change-Id: I7abf0fdd7fb3eb1c83e3edfd01e0da485ffe
Signed-off-by: Spencer Oliver 

diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c
index 706733d..7468e38 100644
--- a/src/target/armv4_5.c
+++ b/src/target/armv4_5.c
@@ -966,6 +966,7 @@ COMMAND_HANDLER(handle_arm_semihosting_command)
if (!arm->setup_semihosting)
{
command_print(CMD_CTX, "semihosting not supported for current 
target");
+   return ERROR_FAIL;
}
 
if (CMD_ARGC > 0)

-- 

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] TCP/IP debug device

2012-01-09 Thread Peter Stuge
Andre Renaud wrote:
> I am looking at implementing a smart JTAG debugger - ethernet attached,
> with enough intelligence within it to have some level of JTAG smarts,
> but not the full OpenOCD.
..
> Does anyone have any comments on where I should start looking?

Even if you don't want full OpenOCD I guess zy1000 can have some
hints.

How will the product be licensed?


//Peter

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[OpenOCD-devel] TCP/IP debug device

2012-01-09 Thread Andre Renaud
Hi,
I am looking at implementing a smart JTAG debugger - ethernet attached,
with enough intelligence within it to have some level of JTAG smarts,
but not the full OpenOCD.

As a test measure, I've implemented the protocol in the
drivers/remote_bitbang.c driver, just to demonstrate that it works. This
is successful, but is obviously very slow. I'm trying to work out a
sensible split such that the device is fast and responsive, but the
firmware within the JTAG device is flexible enough to cope with new
micros without upgrades.

Does anyone have any comments on where I should start looking?

Regards,
Andre

-- 
Bluewater Systems - An Aiotec Company

Andre Renaud
an...@bluewatersys.com  5 Amuri Park, 404 Barbadoes St
www.bluewatersys.comPO Box 13 889, Christchurch 8013
www.aiotec.co.nzNew Zealand
Phone: +64 3 3779127Freecall: Australia 1800 148 751
Fax:   +64 3 3779135USA 1800 261 2934

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


Re: [OpenOCD-devel] TI DM8148, Cortex A8 not halting (OpenOCD 0.5.0 and 0.6.0-dev-00297-g115f538)

2012-01-09 Thread Kyle Manna
Hi,

Have you tried the xds100v2 that comes with the TI8148 EVM?  I had 
submitted some patches back in November to make the xds100v2 work with 
openocd but ran in to the same problems as you.  I'd be very interested 
if you are able to make progress with the icepick configuration for 
either JTAG adapter.

I wound up just using CCSv5 and and XDS560v2 to debug boards as it 
seemed that the necessary documentation to configure the TI81xx chips is 
largely unpublished.

- Kyle

On 01/09/2012 12:39 PM, Delio Brignoli wrote:
> Hello,
>
> I am new to OpenOCD and I am trying to debug TI's DM8148 EVM board using 
> OpenOCD and Flyswatter2. After setting up the ICEPICK-D OpenOCD sees the 
> Cortex A8 but it will not halt. A work in progress configuration file is 
> included below.
>
> According to TI, setting up the ICEPICK following these 
> instructions
>   should allow the CPU to halt (unlike the OMAP3530 which requires an extra 
> step to assert DBGEN). However, using the aforementioned instructions (see 
> icepick_d_tapenable in the configuration file) results in:
>
> [...]
> Info : JTAG tap: dm8148.jrc tap/device found: 0x3b8f202f (mfg: 0x017, part: 
> 0xb8f2, ver: 0x3)
> Info : JTAG tap: dm8148.dap enabled
> Warn : Invalid ACK 0x6 in JTAG-DP transaction
> Polling target failed, GDB will be halted. Polling again in 100ms
> Polling target failed, GDB will be halted. Polling again in 300ms
> Polling target failed, GDB will be halted. Polling again in 700ms
> [...]
>
> and the Cortex A8 is not visible. While, if I use the ICEPICK-C setup that 
> comes with OpenOCD or an ICEPICK-D setup converted from a BDI-3000 
> configuration file (see icepick_d_tapenable_bdi in the configuration file), 
> the Cortex A8 DAP is visible but the CPU will not halt:
>
> [...]
> Debug: 320 5507 core.c:1530 jtag_init_reset(): Initializing with hard 
> TRST+SRST reset
> Debug: 321 5507 ft2232.c:1614 flyswatter2_reset(): trst: 1, srst: 0, 
> low_output: 0x28, low_direction: 0x7b
> Debug: 322 5508 core.c:732 jtag_add_reset(): TRST line asserted
> Debug: 323 5508 ft2232.c:1614 flyswatter2_reset(): trst: 0, srst: 0, 
> low_output: 0x38, low_direction: 0x7b
> Debug: 324 5509 core.c:737 jtag_add_reset(): TRST line released
> Debug: 325 5509 core.c:329 jtag_call_event_callbacks(): jtag event: TAP reset
> Debug: 326 5509 tcl.c:655 jtag_tap_handle_event(): JTAG tap: dm8148.jrc 
> event: 0 (post-reset)
>   action: runtest 1000
> Debug: 327 5509 command.c:151 script_debug(): command - ocd_command 
> ocd_command type ocd_runtest 1000
> Debug: 328 5509 command.c:151 script_debug(): command - runtest ocd_runtest 
> 1000
> Debug: 330 5510 core.c:1435 jtag_init_inner(): Init JTAG chain
> Debug: 331 5510 core.c:329 jtag_call_event_callbacks(): jtag event: TAP reset
> Debug: 332 5510 tcl.c:655 jtag_tap_handle_event(): JTAG tap: dm8148.jrc 
> event: 0 (post-reset)
>   action: runtest 1000
> Debug: 333 5510 command.c:151 script_debug(): command - ocd_command 
> ocd_command type ocd_runtest 1000
> Debug: 334 5510 command.c:151 script_debug(): command - runtest ocd_runtest 
> 1000
> Debug: 336 5511 core.c:1055 jtag_examine_chain(): DR scan interrogation for 
> IDCODE/BYPASS
> Debug: 337 5511 core.c:329 jtag_call_event_callbacks(): jtag event: TAP reset
> Debug: 338 5511 tcl.c:655 jtag_tap_handle_event(): JTAG tap: dm8148.jrc 
> event: 0 (post-reset)
>   action: runtest 1000
> Debug: 339 5511 command.c:151 script_debug(): command - ocd_command 
> ocd_command type ocd_runtest 1000
> Debug: 340 5511 command.c:151 script_debug(): command - runtest ocd_runtest 
> 1000
> Info : 342 5513 core.c:955 jtag_examine_chain_display(): JTAG tap: dm8148.jrc 
> tap/device found: 0x3b8f202f (mfg: 0x017, part: 0xb8f2, ver: 0x3)
> Debug: 343 5513 core.c:1219 jtag_validate_ircapture(): IR capture validation 
> scan
> Debug: 344 5515 core.c:1280 jtag_validate_ircapture(): dm8148.jrc: IR capture 
> 0x01
> Debug: 345 5515 tcl.c:655 jtag_tap_handle_event(): JTAG tap: dm8148.jrc 
> event: 1 (setup)
>   action: jtag tapenable dm8148.dap
> Debug: 346 5515 command.c:151 script_debug(): command - ocd_command 
> ocd_command type ocd_jtag tapenable dm8148.dap
> Debug: 347 5515 command.c:151 script_debug(): command - ocd_jtag ocd_jtag 
> tapenable dm8148.dap
> Debug: 348 5515 tcl.c:655 jtag_tap_handle_event(): JTAG tap: dm8148.dap 
> event: 2 (tap-enable)
>   action: icepick_d_tapenable_bdi dm8148.jrc 12
> Debug: 349 5515 command.c:151 script_debug(): command - ocd_command 
> ocd_command type ocd_irscan dm8148.jrc 7 -endstate IRPAUSE
> Debug: 350 5515 command.c:151 script_debug(): command - irscan ocd_irscan 
> dm8148.jrc 7 -endstate IRPAUSE
> Debug: 352 5516 command.c:151 script_debug(): command - drscan drscan 
> dm8148.jrc 8 0x89 -endstate DRPAUSE
> Debug: 353 5519 command.c:151 script_debug(): command - ocd_command 
> ocd_command type ocd_irscan dm8148.jrc 2 -endstate IRPAUSE
> Debug: 35

[OpenOCD-devel] TI DM8148, Cortex A8 not halting (OpenOCD 0.5.0 and 0.6.0-dev-00297-g115f538)

2012-01-09 Thread Delio Brignoli
Hello,

I am new to OpenOCD and I am trying to debug TI's DM8148 EVM board using 
OpenOCD and Flyswatter2. After setting up the ICEPICK-D OpenOCD sees the Cortex 
A8 but it will not halt. A work in progress configuration file is included 
below.

According to TI, setting up the ICEPICK following these instructions 
 
should allow the CPU to halt (unlike the OMAP3530 which requires an extra step 
to assert DBGEN). However, using the aforementioned instructions (see 
icepick_d_tapenable in the configuration file) results in:

[...]
Info : JTAG tap: dm8148.jrc tap/device found: 0x3b8f202f (mfg: 0x017, part: 
0xb8f2, ver: 0x3)
Info : JTAG tap: dm8148.dap enabled
Warn : Invalid ACK 0x6 in JTAG-DP transaction
Polling target failed, GDB will be halted. Polling again in 100ms
Polling target failed, GDB will be halted. Polling again in 300ms
Polling target failed, GDB will be halted. Polling again in 700ms
[...]

and the Cortex A8 is not visible. While, if I use the ICEPICK-C setup that 
comes with OpenOCD or an ICEPICK-D setup converted from a BDI-3000 
configuration file (see icepick_d_tapenable_bdi in the configuration file), the 
Cortex A8 DAP is visible but the CPU will not halt:

[...]
Debug: 320 5507 core.c:1530 jtag_init_reset(): Initializing with hard TRST+SRST 
reset
Debug: 321 5507 ft2232.c:1614 flyswatter2_reset(): trst: 1, srst: 0, 
low_output: 0x28, low_direction: 0x7b
Debug: 322 5508 core.c:732 jtag_add_reset(): TRST line asserted
Debug: 323 5508 ft2232.c:1614 flyswatter2_reset(): trst: 0, srst: 0, 
low_output: 0x38, low_direction: 0x7b
Debug: 324 5509 core.c:737 jtag_add_reset(): TRST line released
Debug: 325 5509 core.c:329 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 326 5509 tcl.c:655 jtag_tap_handle_event(): JTAG tap: dm8148.jrc event: 
0 (post-reset)
action: runtest 1000
Debug: 327 5509 command.c:151 script_debug(): command - ocd_command ocd_command 
type ocd_runtest 1000
Debug: 328 5509 command.c:151 script_debug(): command - runtest ocd_runtest 1000
Debug: 330 5510 core.c:1435 jtag_init_inner(): Init JTAG chain
Debug: 331 5510 core.c:329 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 332 5510 tcl.c:655 jtag_tap_handle_event(): JTAG tap: dm8148.jrc event: 
0 (post-reset)
action: runtest 1000
Debug: 333 5510 command.c:151 script_debug(): command - ocd_command ocd_command 
type ocd_runtest 1000
Debug: 334 5510 command.c:151 script_debug(): command - runtest ocd_runtest 1000
Debug: 336 5511 core.c:1055 jtag_examine_chain(): DR scan interrogation for 
IDCODE/BYPASS
Debug: 337 5511 core.c:329 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 338 5511 tcl.c:655 jtag_tap_handle_event(): JTAG tap: dm8148.jrc event: 
0 (post-reset)
action: runtest 1000
Debug: 339 5511 command.c:151 script_debug(): command - ocd_command ocd_command 
type ocd_runtest 1000
Debug: 340 5511 command.c:151 script_debug(): command - runtest ocd_runtest 1000
Info : 342 5513 core.c:955 jtag_examine_chain_display(): JTAG tap: dm8148.jrc 
tap/device found: 0x3b8f202f (mfg: 0x017, part: 0xb8f2, ver: 0x3)
Debug: 343 5513 core.c:1219 jtag_validate_ircapture(): IR capture validation 
scan
Debug: 344 5515 core.c:1280 jtag_validate_ircapture(): dm8148.jrc: IR capture 
0x01
Debug: 345 5515 tcl.c:655 jtag_tap_handle_event(): JTAG tap: dm8148.jrc event: 
1 (setup)
action: jtag tapenable dm8148.dap
Debug: 346 5515 command.c:151 script_debug(): command - ocd_command ocd_command 
type ocd_jtag tapenable dm8148.dap
Debug: 347 5515 command.c:151 script_debug(): command - ocd_jtag ocd_jtag 
tapenable dm8148.dap
Debug: 348 5515 tcl.c:655 jtag_tap_handle_event(): JTAG tap: dm8148.dap event: 
2 (tap-enable)
action: icepick_d_tapenable_bdi dm8148.jrc 12
Debug: 349 5515 command.c:151 script_debug(): command - ocd_command ocd_command 
type ocd_irscan dm8148.jrc 7 -endstate IRPAUSE
Debug: 350 5515 command.c:151 script_debug(): command - irscan ocd_irscan 
dm8148.jrc 7 -endstate IRPAUSE
Debug: 352 5516 command.c:151 script_debug(): command - drscan drscan 
dm8148.jrc 8 0x89 -endstate DRPAUSE
Debug: 353 5519 command.c:151 script_debug(): command - ocd_command ocd_command 
type ocd_irscan dm8148.jrc 2 -endstate IRPAUSE
Debug: 354 5519 command.c:151 script_debug(): command - irscan ocd_irscan 
dm8148.jrc 2 -endstate IRPAUSE
Debug: 356 5520 command.c:151 script_debug(): command - drscan drscan 
dm8148.jrc 32 8180 -endstate DRPAUSE
Debug: 357 5522 command.c:151 script_debug(): command - drscan drscan 
dm8148.jrc 32 2885689352 -endstate DRPAUSE
Debug: 358 5524 command.c:151 script_debug(): command - drscan drscan 
dm8148.jrc 32 0xe0002008 -endstate DRPAUSE
Debug: 359 5526 command.c:151 script_debug(): command - drscan drscan 
dm8148.jrc 32 2885689608 -endstate DRPAUSE
Debug: 360 5531 command.c:151 script_debug(): command - ocd_command ocd_command 
type ocd_irscan dm8148.jrc 0x3F -endstate RUN/IDLE
Debug: 361

[OpenOCD-devel] [PATCH]: 25fcced cmd: add missing usage var

2012-01-09 Thread gerrit
This is an automated email from Gerrit.

Spencer Oliver (s...@spen-soft.co.uk) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/356

-- gerrit

commit 25fcced7444de118a0198e2840d734b4da23c3b6
Author: Spencer Oliver 
Date:   Mon Jan 9 16:14:18 2012 +

cmd: add missing usage var

Change-Id: I0f05d643b0801b19cc3beb88f0d12d7e4c83ef9c
Signed-off-by: Spencer Oliver 

diff --git a/src/flash/nor/at91sam3.c b/src/flash/nor/at91sam3.c
index dac901e..4578ade 100644
--- a/src/flash/nor/at91sam3.c
+++ b/src/flash/nor/at91sam3.c
@@ -3248,6 +3248,7 @@ static const struct command_registration 
at91sam3_command_handlers[] = {
.name = "at91sam3",
.mode = COMMAND_ANY,
.help = "at91sam3 flash command group",
+   .usage = "",
.chain = at91sam3_exec_command_handlers,
},
COMMAND_REGISTRATION_DONE
diff --git a/src/flash/nor/at91sam7.c b/src/flash/nor/at91sam7.c
index 2b822b7..c2506be 100644
--- a/src/flash/nor/at91sam7.c
+++ b/src/flash/nor/at91sam7.c
@@ -1287,6 +1287,7 @@ static const struct command_registration 
at91sam7_command_handlers[] = {
.name = "at91sam7",
.mode = COMMAND_ANY,
.help = "at91sam7 flash command group",
+   .usage = "",
.chain = at91sam7_exec_command_handlers,
},
COMMAND_REGISTRATION_DONE
diff --git a/src/flash/nor/avrf.c b/src/flash/nor/avrf.c
index 1ade452..462aee2 100644
--- a/src/flash/nor/avrf.c
+++ b/src/flash/nor/avrf.c
@@ -492,6 +492,7 @@ static const struct command_registration 
avrf_command_handlers[] = {
.name = "avrf",
.mode = COMMAND_ANY,
.help = "AVR flash command group",
+   .usage = "",
.chain = avrf_exec_command_handlers,
},
COMMAND_REGISTRATION_DONE
diff --git a/src/flash/nor/em357.c b/src/flash/nor/em357.c
index c045d57..2e40601 100644
--- a/src/flash/nor/em357.c
+++ b/src/flash/nor/em357.c
@@ -946,6 +946,7 @@ static const struct command_registration 
em357_command_handlers[] = {
.name = "em357",
.mode = COMMAND_ANY,
.help = "em357 flash command group",
+   .usage = "",
.chain = em357_exec_command_handlers,
},
COMMAND_REGISTRATION_DONE
diff --git a/src/flash/nor/fm3.c b/src/flash/nor/fm3.c
index 78e71d2..2119e4f 100644
--- a/src/flash/nor/fm3.c
+++ b/src/flash/nor/fm3.c
@@ -886,6 +886,7 @@ static const struct command_registration 
fm3_command_handlers[] = {
.name = "fm3",
.mode = COMMAND_ANY,
.help = "fm3 Flash command group",
+   .usage = "",
.chain = fm3_exec_command_handlers,
},
COMMAND_REGISTRATION_DONE
diff --git a/src/flash/nor/lpc2000.c b/src/flash/nor/lpc2000.c
index b4e17e7..b9b04fe 100644
--- a/src/flash/nor/lpc2000.c
+++ b/src/flash/nor/lpc2000.c
@@ -836,6 +836,7 @@ static const struct command_registration 
lpc2000_exec_command_handlers[] = {
.handler = lpc2000_handle_part_id_command,
.mode = COMMAND_EXEC,
.help = "print part id of lpc2000 flash bank ",
+   .usage = "",
},
COMMAND_REGISTRATION_DONE
 };
@@ -844,6 +845,7 @@ static const struct command_registration 
lpc2000_command_handlers[] = {
.name = "lpc2000",
.mode = COMMAND_ANY,
.help = "lpc2000 flash command group",
+   .usage = "",
.chain = lpc2000_exec_command_handlers,
},
COMMAND_REGISTRATION_DONE
diff --git a/src/flash/nor/lpc2900.c b/src/flash/nor/lpc2900.c
index 4960e9c..5a80b32 100644
--- a/src/flash/nor/lpc2900.c
+++ b/src/flash/nor/lpc2900.c
@@ -1004,6 +1004,7 @@ static const struct command_registration 
lpc2900_command_handlers[] = {
.name = "lpc2900",
.mode = COMMAND_ANY,
.help = "LPC2900 flash command group",
+   .usage = "",
.chain = lpc2900_exec_command_handlers,
},
COMMAND_REGISTRATION_DONE
diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c
index 957bfc2..cc7d99c 100644
--- a/src/flash/nor/pic32mx.c
+++ b/src/flash/nor/pic32mx.c
@@ -855,6 +855,7 @@ static const struct command_registration 
pic32mx_command_handlers[] = {
.name = "pic32mx",
.mode = COMMAND_ANY,
.help = "pic32mx flash command group",
+   .usage = "",
.chain = pic32mx_exec_command_handlers,
},
COMMAND_REGISTRATION_DONE
diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c
index c855995..85b9d98 100644
--- a/src/flash/nor/stellaris.c
+++ b/src/flash/nor/stellaris.c
@@ -1456,6 +1456,7 @@ static const struct command_registration 
stellaris_command_handlers[] = {
   

[OpenOCD-devel] [PATCH]: c10ab5a stlink: add dummy speed handlers

2012-01-09 Thread gerrit
This is an automated email from Gerrit.

Spencer Oliver (s...@spen-soft.co.uk) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/355

-- gerrit

commit c10ab5af0b79bdcc783b30adc7a283409ea5e100
Author: Spencer Oliver 
Date:   Mon Jan 9 14:43:26 2012 +

stlink: add dummy speed handlers

Change-Id: I0445be7867637728145941b06225dc0acc5380e8
Signed-off-by: Spencer Oliver 

diff --git a/src/jtag/stlink/stlink_interface.c 
b/src/jtag/stlink/stlink_interface.c
index a2ac99f..1fb550a 100644
--- a/src/jtag/stlink/stlink_interface.c
+++ b/src/jtag/stlink/stlink_interface.c
@@ -101,6 +101,18 @@ static int stlink_interface_speed(int speed)
return ERROR_OK;
 }
 
+static int stlink_speed_div(int speed, int* khz)
+{
+   *khz = speed;
+   return ERROR_OK;
+}
+
+static int stlink_khz(int khz, int *jtag_speed)
+{
+   *jtag_speed = khz;
+   return ERROR_OK;
+}
+
 static int stlink_interface_execute_queue(void)
 {
LOG_DEBUG("stlink_interface_execute_queue: ignored");
@@ -217,9 +229,10 @@ struct jtag_interface stlink_interface = {
.supported = 0,
.commands = stlink_interface_command_handlers,
.transports = stlink_transports,
-
.init = stlink_interface_init,
.quit = stlink_interface_quit,
.speed = stlink_interface_speed,
+   .speed_div = stlink_speed_div,
+   .khz = stlink_khz,
.execute_queue = stlink_interface_execute_queue,
 };

-- 

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[OpenOCD-devel] [PATCH]: 09f4599 flash: use correct device_id mask

2012-01-09 Thread gerrit
This is an automated email from Gerrit.

Spencer Oliver (s...@spen-soft.co.uk) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/352

-- gerrit

commit 09f45996fce952cf231300285f14ef147f042cda
Author: Spencer Oliver 
Date:   Mon Jan 9 12:42:31 2012 +

flash: use correct device_id mask

The stm32 drivers have been using 0x7ff as the DEV_ID mask, this should
have been 0xfff.

Change-Id: I232469620969d6dd1b9a2a2aa15ec18b947dbb05
Signed-off-by: Spencer Oliver 

diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c
index 5d9da90..ab2d274 100644
--- a/src/flash/nor/stm32f1x.c
+++ b/src/flash/nor/stm32f1x.c
@@ -101,6 +101,9 @@
 #define KEY1   0x45670123
 #define KEY2   0xCDEF89AB
 
+/* DBGMCU_IDCODE mask bits */
+#define DEV_ID_MASK0xFFF
+
 struct stm32x_options
 {
uint16_t RDP;
@@ -977,8 +980,7 @@ static int stm32x_probe(struct flash_bank *bank)
flash_size_in_kb = 0x;
}
 
-   if ((device_id & 0x7ff) == 0x410)
-   {
+   if ((device_id & DEV_ID_MASK) == 0x410) {
/* medium density - we have 1k pages
 * 4 pages for a protection area */
page_size = 1024;
@@ -991,9 +993,7 @@ static int stm32x_probe(struct flash_bank *bank)
LOG_WARNING("STM32 flash size failed, probe inaccurate 
- assuming 128k flash");
flash_size_in_kb = 128;
}
-   }
-   else if ((device_id & 0x7ff) == 0x412)
-   {
+   } else if ((device_id & DEV_ID_MASK) == 0x412) {
/* low density - we have 1k pages
 * 4 pages for a protection area */
page_size = 1024;
@@ -1006,9 +1006,7 @@ static int stm32x_probe(struct flash_bank *bank)
LOG_WARNING("STM32 flash size failed, probe inaccurate 
- assuming 32k flash");
flash_size_in_kb = 32;
}
-   }
-   else if ((device_id & 0x7ff) == 0x414)
-   {
+   } else if ((device_id & DEV_ID_MASK) == 0x414) {
/* high density - we have 2k pages
 * 2 pages for a protection area */
page_size = 2048;
@@ -1021,9 +1019,7 @@ static int stm32x_probe(struct flash_bank *bank)
LOG_WARNING("STM32 flash size failed, probe inaccurate 
- assuming 512k flash");
flash_size_in_kb = 512;
}
-   }
-   else if ((device_id & 0x7ff) == 0x418)
-   {
+   } else if ((device_id & DEV_ID_MASK) == 0x418) {
/* connectivity line density - we have 2k pages
 * 2 pages for a protection area */
page_size = 2048;
@@ -1036,9 +1032,7 @@ static int stm32x_probe(struct flash_bank *bank)
LOG_WARNING("STM32 flash size failed, probe inaccurate 
- assuming 256k flash");
flash_size_in_kb = 256;
}
-   }
-   else if ((device_id & 0x7ff) == 0x420)
-   {
+   } else if ((device_id & DEV_ID_MASK) == 0x420) {
/* value line density - we have 1k pages
 * 4 pages for a protection area */
page_size = 1024;
@@ -1051,9 +1045,7 @@ static int stm32x_probe(struct flash_bank *bank)
LOG_WARNING("STM32 flash size failed, probe inaccurate 
- assuming 128k flash");
flash_size_in_kb = 128;
}
-   }
-   else if ((device_id & 0x7ff) == 0x428)
-   {
+   } else if ((device_id & DEV_ID_MASK) == 0x428) {
/* value line High density - we have 2k pages
 * 4 pages for a protection area */
page_size = 2048;
@@ -1066,10 +1058,7 @@ static int stm32x_probe(struct flash_bank *bank)
LOG_WARNING("STM32 flash size failed, probe inaccurate 
- assuming 128k flash");
flash_size_in_kb = 128;
}
-   }
-
-   else if ((device_id & 0x7ff) == 0x430)
-   {
+   } else if ((device_id & DEV_ID_MASK) == 0x430) {
/* xl line density - we have 2k pages
 * 2 pages for a protection area */
page_size = 2048;
@@ -1165,8 +1154,7 @@ static int get_stm32x_info(struct flash_bank *bank, char 
*buf, int buf_size)
if (retval != ERROR_OK)
return retval;
 
-   if ((device_id & 0x7ff) == 0x410)
-   {
+   if ((device_id & DEV_ID_MASK) == 0x410) {
printed = snprintf(buf, buf_size, "stm32x (Medium Density) - 
Rev: ");
buf += printed;
buf_size -= printed;
@@ -1193,9 +1181,7 @@ static int get_stm32x_info(struct flash_bank *bank, char 
*buf, int buf_size)
snprintf(buf, buf_size, "unknown");
break;
}
-   }
-   el

[OpenOCD-devel] [PATCH]: 55089f8 flash: stm32f2x incorrectly using 512 as max family size

2012-01-09 Thread gerrit
This is an automated email from Gerrit.

Spencer Oliver (s...@spen-soft.co.uk) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/353

-- gerrit

commit 55089f8ea055faca460082e9e3cc60994203767d
Author: Spencer Oliver 
Date:   Mon Jan 9 12:44:48 2012 +

flash: stm32f2x incorrectly using 512 as max family size

Change-Id: I2bac348c6d0baabd3d88335c5aa0a318ef66653a
Signed-off-by: Spencer Oliver 

diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c
index 3a9438e..03b13a6 100644
--- a/src/flash/nor/stm32f2x.c
+++ b/src/flash/nor/stm32f2x.c
@@ -602,15 +602,15 @@ static int stm32x_probe(struct flash_bank *bank)
/* check for early silicon */
if (flash_size_in_kb == 0x) {
/* number of sectors may be incorrrect on early silicon 
*/
-   LOG_WARNING("STM32 flash size failed, probe inaccurate 
- assuming 512k flash");
-   flash_size_in_kb = 512;
+   LOG_WARNING("STM32 flash size failed, probe inaccurate 
- assuming 1024k flash");
+   flash_size_in_kb = 1024;
}
} else if ((device_id & DEV_ID_MASK) == 0x413) {
/* check for early silicon */
if (flash_size_in_kb == 0x) {
/* number of sectors may be incorrrect on early silicon 
*/
-   LOG_WARNING("STM32 flash size failed, probe inaccurate 
- assuming 512k flash");
-   flash_size_in_kb = 512;
+   LOG_WARNING("STM32 flash size failed, probe inaccurate 
- assuming 1024k flash");
+   flash_size_in_kb = 1024;
}
} else {
LOG_WARNING("Cannot identify target as a STM32 family.");
@@ -710,6 +710,10 @@ static int get_stm32x_info(struct flash_bank *bank, char 
*buf, int buf_size)
snprintf(buf, buf_size, "A");
break;
 
+   case 0x1001:
+   snprintf(buf, buf_size, "Z");
+   break;
+
default:
snprintf(buf, buf_size, "unknown");
break;

-- 

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[OpenOCD-devel] [PATCH]: f172cad flash: detect stm32f4x device id errata

2012-01-09 Thread gerrit
This is an automated email from Gerrit.

Spencer Oliver (s...@spen-soft.co.uk) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/354

-- gerrit

commit f172cad5cc6a96a08d42e2c452ef381d416b223c
Author: Spencer Oliver 
Date:   Mon Jan 9 13:00:22 2012 +

flash: detect stm32f4x device id errata

This allows us to detect a device arrata where the device id returned is
incorrect.

This issue only effects stm32f4x Rev A silicon.

Change-Id: Ic9f4985f9abf562f97322dcf484199f0a4eb01bb
Signed-off-by: Spencer Oliver 

diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c
index 03b13a6..8e9491f 100644
--- a/src/flash/nor/stm32f2x.c
+++ b/src/flash/nor/stm32f2x.c
@@ -573,6 +573,37 @@ static void setup_sector(struct flash_bank *bank, int 
start, int num, int size)
}
 }
 
+static int stm32x_get_device_id(struct flash_bank *bank, uint32_t *device_id)
+{
+   /* this checks for a stm32f4x errata issue where a
+* stm32f2x DBGMCU_IDCODE is incorrectly returned.
+* If the issue is detected target is forced to stm32f4x Rev A.
+* Only effects Rev A silicon */
+
+   struct target *target = bank->target;
+   uint32_t cpuid;
+
+   /* read stm32 device id register */
+   int retval = target_read_u32(target, 0xE0042000, device_id);
+   if (retval != ERROR_OK)
+   return retval;
+
+   if ((*device_id & DEV_ID_MASK) == 0x411) {
+   /* read CPUID reg to check core type */
+   retval = target_read_u32(target, 0xE000ED00, &cpuid);
+   if (retval != ERROR_OK)
+   return retval;
+
+   /* check for cortex_m4 */
+   if (((cpuid >> 4) & 0xFFF) == 0xC24) {
+   *device_id &= ~((0x << 16) | DEV_ID_MASK);
+   *device_id |= (0x1000 << 16) | 0x413;
+   LOG_INFO("stm32f4x errata detected - fixing incorrect 
MCU_IDCODE");
+   }
+   }
+   return retval;
+}
+
 static int stm32x_probe(struct flash_bank *bank)
 {
struct target *target = bank->target;
@@ -585,7 +616,7 @@ static int stm32x_probe(struct flash_bank *bank)
stm32x_info->probed = 0;
 
/* read stm32 device id register */
-   int retval = target_read_u32(target, 0xE0042000, &device_id);
+   int retval = stm32x_get_device_id(bank, &device_id);
if (retval != ERROR_OK)
return retval;
LOG_INFO("device id = 0x%08" PRIx32 "", device_id);
@@ -665,12 +696,11 @@ static int stm32x_auto_probe(struct flash_bank *bank)
 
 static int get_stm32x_info(struct flash_bank *bank, char *buf, int buf_size)
 {
-   struct target *target = bank->target;
uint32_t device_id;
int printed;
 
/* read stm32 device id register */
-   int retval = target_read_u32(target, 0xE0042000, &device_id);
+   int retval = stm32x_get_device_id(bank, &device_id);
if (retval != ERROR_OK)
return retval;
 

-- 

--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel