You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
| 2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
| 2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
| 2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
| 2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
| 2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
| 2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
| 2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
| 2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
| 2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
| 2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
| 2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
| 2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
| 2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
| 2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
| 2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
| 2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(54) |
Sep
(47) |
Oct
(15) |
Nov
(58) |
Dec
|
|
From: <zw...@ma...> - 2009-06-12 03:41:04
|
Author: zwelch
Date: 2009-06-12 03:41:00 +0200 (Fri, 12 Jun 2009)
New Revision: 2217
Modified:
trunk/src/jtag/vsllink.c
Log:
Improve vsllink command argument handling:
- Bug fix: Always clear high bit of USB bulk out endpoint.
- Use parse_ulong helpers to ensure numeric strings are parsed properly.
Modified: trunk/src/jtag/vsllink.c
===================================================================
--- trunk/src/jtag/vsllink.c 2009-06-12 01:40:54 UTC (rev 2216)
+++ trunk/src/jtag/vsllink.c 2009-06-12 01:41:00 UTC (rev 2217)
@@ -1407,9 +1407,7 @@
return ERROR_OK;
}
- vsllink_usb_vid = strtol(args[0], NULL, 0);
-
- return ERROR_OK;
+ return parse_u16(args[0], &vsllink_usb_vid);
}
static int vsllink_handle_usb_pid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
@@ -1419,10 +1417,7 @@
LOG_ERROR("parameter error, should be one parameter for PID");
return ERROR_OK;
}
-
- vsllink_usb_pid = strtol(args[0], NULL, 0);
-
- return ERROR_OK;
+ return parse_u16(args[0], &vsllink_usb_pid);
}
static int vsllink_handle_usb_bulkin_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
@@ -1433,9 +1428,11 @@
return ERROR_OK;
}
- vsllink_usb_bulkin = strtol(args[0], NULL, 0) | 0x80;
+ int retval = parse_u8(args[0], &vsllink_usb_bulkin);
+ if (ERROR_OK == retval)
+ vsllink_usb_bulkin |= 0x80;
- return ERROR_OK;
+ return retval;
}
static int vsllink_handle_usb_bulkout_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
@@ -1446,9 +1443,11 @@
return ERROR_OK;
}
- vsllink_usb_bulkout = strtol(args[0], NULL, 0);
+ int retval = parse_u8(args[0], &vsllink_usb_bulkout);
+ if (ERROR_OK == retval)
+ vsllink_usb_bulkout &= ~0x80;
- return ERROR_OK;
+ return retval;
}
static int vsllink_handle_usb_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
@@ -1459,9 +1458,7 @@
return ERROR_OK;
}
- vsllink_usb_interface = strtol(args[0], NULL, 0);
-
- return ERROR_OK;
+ return parse_u8(args[0], &vsllink_usb_interface);
}
/***************************************************************************/
|
|
From: <zw...@ma...> - 2009-06-12 03:40:57
|
Author: zwelch Date: 2009-06-12 03:40:54 +0200 (Fri, 12 Jun 2009) New Revision: 2216 Modified: trunk/src/jtag/tcl.c Log: Improve handle_runtest_command: - Use parse_uint helper to ensure argument is parsed properly. Modified: trunk/src/jtag/tcl.c =================================================================== --- trunk/src/jtag/tcl.c 2009-06-12 01:40:48 UTC (rev 2215) +++ trunk/src/jtag/tcl.c 2009-06-12 01:40:54 UTC (rev 2216) @@ -1088,7 +1088,12 @@ if (argc != 1) return ERROR_COMMAND_SYNTAX_ERROR; - jtag_add_runtest(strtol(args[0], NULL, 0), jtag_get_end_state()); + unsigned num_clocks; + int retval = parse_uint(args[0], &num_clocks); + if (ERROR_OK != retval) + return retval; + + jtag_add_runtest(num_clocks, jtag_get_end_state()); jtag_execute_queue(); return ERROR_OK; |
|
From: <zw...@ma...> - 2009-06-12 03:40:52
|
Author: zwelch
Date: 2009-06-12 03:40:48 +0200 (Fri, 12 Jun 2009)
New Revision: 2215
Modified:
trunk/src/jtag/ft2232.c
Log:
Improve VID/PID command argument handling in FTDI driver:
- Bug fix: Return a syntax error when less than two arguments are given.
- Bug fix: Use parse_u16 helper to ensure vales are parsed properly.
- Simplify loop termination logic by ensuring argc is always even.
- Move loop induction variable declaration to where it is used.
Modified: trunk/src/jtag/ft2232.c
===================================================================
--- trunk/src/jtag/ft2232.c 2009-06-12 01:40:42 UTC (rev 2214)
+++ trunk/src/jtag/ft2232.c 2009-06-12 01:40:48 UTC (rev 2215)
@@ -2827,8 +2827,6 @@
static int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
{
- int i;
-
if (argc > MAX_USB_IDS * 2)
{
LOG_WARNING("ignoring extra IDs in ft2232_vid_pid "
@@ -2839,13 +2837,21 @@
{
LOG_WARNING("incomplete ft2232_vid_pid configuration directive");
if (argc < 2)
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
+ // remove the incomplete trailing id
+ argc -= 1;
}
- for (i = 0; i + 1 < argc; i += 2)
+ int i;
+ int retval = ERROR_OK;
+ for (i = 0; i < argc; i += 2)
{
- ft2232_vid[i >> 1] = strtol(args[i], NULL, 0);
- ft2232_pid[i >> 1] = strtol(args[i + 1], NULL, 0);
+ retval = parse_u16(args[i], &ft2232_vid[i >> 1]);
+ if (ERROR_OK != retval)
+ break;
+ retval = parse_u16(args[i + 1], &ft2232_pid[i >> 1]);
+ if (ERROR_OK != retval)
+ break;
}
/*
@@ -2854,7 +2860,7 @@
*/
ft2232_vid[i >> 1] = ft2232_pid[i >> 1] = 0;
- return ERROR_OK;
+ return retval;
}
|
|
From: <zw...@ma...> - 2009-06-12 03:40:46
|
Author: zwelch
Date: 2009-06-12 03:40:42 +0200 (Fri, 12 Jun 2009)
New Revision: 2214
Modified:
trunk/src/jtag/tcl.c
Log:
Improve handle_irscan_command:
- Use parse_u32 helper to ensure scan values are parsed properly.
- Clear the fields buffer to ensure partial cleanup occur correctly.
Modified: trunk/src/jtag/tcl.c
===================================================================
--- trunk/src/jtag/tcl.c 2009-06-12 01:40:35 UTC (rev 2213)
+++ trunk/src/jtag/tcl.c 2009-06-12 01:40:42 UTC (rev 2214)
@@ -1158,9 +1158,11 @@
}
int num_fields = argc / 2;
+ size_t fields_len = sizeof(scan_field_t) * num_fields;
+ fields = malloc(fields_len);
+ memset(fields, 0, fields_len);
- fields = malloc(sizeof(scan_field_t) * num_fields);
-
+ int retval;
for (i = 0; i < num_fields; i++)
{
tap = jtag_tap_by_string( args[i*2] );
@@ -1173,17 +1175,26 @@
fields[i].tap = tap;
fields[i].num_bits = field_size;
fields[i].out_value = malloc(CEIL(field_size, 8));
- buf_set_u32(fields[i].out_value, 0, field_size, strtoul(args[i*2+1], NULL, 0));
+
+ u32 value;
+ retval = parse_u32(args[i * 2 + 1], &value);
+ if (ERROR_OK != retval)
+ goto error_return;
+ buf_set_u32(fields[i].out_value, 0, field_size, value);
fields[i].in_value = NULL;
}
/* did we have an endstate? */
jtag_add_ir_scan(num_fields, fields, endstate);
- int retval=jtag_execute_queue();
+ retval = jtag_execute_queue();
+error_return:
for (i = 0; i < num_fields; i++)
- free(fields[i].out_value);
+ {
+ if (NULL != fields[i].out_value)
+ free(fields[i].out_value);
+ }
free (fields);
|
|
From: <zw...@ma...> - 2009-06-12 03:40:39
|
Author: zwelch
Date: 2009-06-12 03:40:35 +0200 (Fri, 12 Jun 2009)
New Revision: 2213
Modified:
trunk/src/jtag/tcl.c
Log:
Improve JTAG reset, speed, and khz handlers to use parse_uint helper.
Modified: trunk/src/jtag/tcl.c
===================================================================
--- trunk/src/jtag/tcl.c 2009-06-12 01:40:29 UTC (rev 2212)
+++ trunk/src/jtag/tcl.c 2009-06-12 01:40:35 UTC (rev 2213)
@@ -971,7 +971,13 @@
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if (argc == 1)
- jtag_set_nsrst_delay(strtoul(args[0], NULL, 0));
+ {
+ unsigned delay;
+ int retval = parse_uint(args[0], &delay);
+ if (ERROR_OK != retval)
+ return retval;
+ jtag_set_nsrst_delay(delay);
+ }
command_print(cmd_ctx, "jtag_nsrst_delay: %u", jtag_get_nsrst_delay());
return ERROR_OK;
}
@@ -982,7 +988,13 @@
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if (argc == 1)
- jtag_set_ntrst_delay(strtoul(args[0], NULL, 0));
+ {
+ unsigned delay;
+ int retval = parse_uint(args[0], &delay);
+ if (ERROR_OK != retval)
+ return retval;
+ jtag_set_ntrst_delay(delay);
+ }
command_print(cmd_ctx, "jtag_ntrst_delay: %u", jtag_get_ntrst_delay());
return ERROR_OK;
}
@@ -997,8 +1009,10 @@
{
LOG_DEBUG("handle jtag speed");
- int cur_speed = 0;
- cur_speed = strtoul(args[0], NULL, 0);
+ unsigned cur_speed = 0;
+ int retval = parse_uint(args[0], &cur_speed);
+ if (ERROR_OK != retval)
+ return retval;
retval = jtag_set_speed(cur_speed);
}
@@ -1015,9 +1029,13 @@
int retval = ERROR_OK;
if (argc == 1)
{
- retval = jtag_config_khz(strtoul(args[0], NULL, 0));
+ unsigned khz = 0;
+ int retval = parse_uint(args[0], &khz);
if (ERROR_OK != retval)
return retval;
+ retval = jtag_config_khz(khz);
+ if (ERROR_OK != retval)
+ return retval;
}
int cur_speed;
|
|
From: <zw...@ma...> - 2009-06-12 03:40:33
|
Author: zwelch Date: 2009-06-12 03:40:29 +0200 (Fri, 12 Jun 2009) New Revision: 2212 Modified: trunk/src/jtag/core.c Log: Use parse_uint helper to replace strtoul call in jtag_tap_by_string. Modified: trunk/src/jtag/core.c =================================================================== --- trunk/src/jtag/core.c 2009-06-12 01:40:23 UTC (rev 2211) +++ trunk/src/jtag/core.c 2009-06-12 01:40:29 UTC (rev 2212) @@ -172,9 +172,8 @@ } /* no tap found by name, so try to parse the name as a number */ - char *cp; - unsigned n = strtoul(s, &cp, 0); - if ((s == cp) || (*cp != 0)) + unsigned n; + if (parse_uint(s, &n) != ERROR_OK) return NULL; return jtag_tap_by_position(n); |
|
From: <zw...@ma...> - 2009-06-12 03:40:27
|
Author: zwelch
Date: 2009-06-12 03:40:23 +0200 (Fri, 12 Jun 2009)
New Revision: 2211
Modified:
trunk/src/jtag/gw16012.c
Log:
Simplify and improve gw16012_handle_parport_command:
- Show the port number to the user when asking for it or setting it.
- Print an error if the parport_port has already been set.
- Use parse_u16 helper to ensure the parport_port string parses correctly.
Modified: trunk/src/jtag/gw16012.c
===================================================================
--- trunk/src/jtag/gw16012.c 2009-06-12 01:40:17 UTC (rev 2210)
+++ trunk/src/jtag/gw16012.c 2009-06-12 01:40:23 UTC (rev 2211)
@@ -571,12 +571,23 @@
static int gw16012_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- if (argc == 0)
- return ERROR_OK;
+ if (argc == 1)
+ {
+ /* only if the port wasn't overwritten by cmdline */
+ if (gw16012_port == 0)
+ {
+ int retval = parse_u16(args[0], &gw16012_port);
+ if (ERROR_OK != retval)
+ return retval;
+ }
+ else
+ {
+ LOG_ERROR("The parport port was already configured!");
+ return ERROR_FAIL;
+ }
+ }
- /* only if the port wasn't overwritten by cmdline */
- if (gw16012_port == 0)
- gw16012_port = strtoul(args[0], NULL, 0);
+ command_print(cmd_ctx, "parport port = %u", gw16012_port);
return ERROR_OK;
}
|
|
From: <zw...@ma...> - 2009-06-12 03:40:21
|
Author: zwelch
Date: 2009-06-12 03:40:17 +0200 (Fri, 12 Jun 2009)
New Revision: 2210
Modified:
trunk/src/jtag/amt_jtagaccel.c
Log:
Simplify and improve amt_jtagaccel_handle_parport_port_command:
- Show the port number to the user when asking for it or setting it.
- Print an error if the amt_jtagaccel_port has already been set.
- Use parse_u16 helper to ensure amt_jtagaccel_port string parses correctly.
Modified: trunk/src/jtag/amt_jtagaccel.c
===================================================================
--- trunk/src/jtag/amt_jtagaccel.c 2009-06-12 01:40:03 UTC (rev 2209)
+++ trunk/src/jtag/amt_jtagaccel.c 2009-06-12 01:40:17 UTC (rev 2210)
@@ -526,14 +526,26 @@
return ERROR_OK;
}
-static int amt_jtagaccel_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int amt_jtagaccel_handle_parport_port_command(
+ struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- if (argc == 0)
- return ERROR_OK;
+ if (argc == 1)
+ {
+ /* only if the port wasn't overwritten by cmdline */
+ if (amt_jtagaccel_port == 0)
+ {
+ int retval = parse_u16(args[0], &amt_jtagaccel_port);
+ if (ERROR_OK != retval)
+ return retval;
+ }
+ else
+ {
+ LOG_ERROR("The parport port was already configured!");
+ return ERROR_FAIL;
+ }
+ }
- /* only if the port wasn't overwritten by cmdline */
- if (amt_jtagaccel_port == 0)
- amt_jtagaccel_port = strtoul(args[0], NULL, 0);
+ command_print(cmd_ctx, "parport port = %u", amt_jtagaccel_port);
return ERROR_OK;
}
|
|
From: <zw...@ma...> - 2009-06-12 03:40:15
|
Author: zwelch
Date: 2009-06-12 03:40:03 +0200 (Fri, 12 Jun 2009)
New Revision: 2209
Modified:
trunk/src/jtag/parport.c
Log:
Simplify and improve parport_handle_parport_port_command:
- Show the port number to the user when asking for it or setting it.
- Print an error if the parport_port has already been set.
- Use parse_u16 helper to ensure the parport_port string parses correctly.
Modified: trunk/src/jtag/parport.c
===================================================================
--- trunk/src/jtag/parport.c 2009-06-12 01:39:57 UTC (rev 2208)
+++ trunk/src/jtag/parport.c 2009-06-12 01:40:03 UTC (rev 2209)
@@ -429,12 +429,23 @@
static int parport_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- if (argc == 0)
- return ERROR_OK;
+ if (argc == 1)
+ {
+ /* only if the port wasn't overwritten by cmdline */
+ if (parport_port == 0)
+ {
+ int retval = parse_u16(args[0], &parport_port);
+ if (ERROR_OK != retval)
+ return retval;
+ }
+ else
+ {
+ LOG_ERROR("The parport port was already configured!");
+ return ERROR_FAIL;
+ }
+ }
- /* only if the port wasn't overwritten by cmdline */
- if (parport_port == 0)
- parport_port = strtoul(args[0], NULL, 0);
+ command_print(cmd_ctx, "parport port = %u", parport_port);
return ERROR_OK;
}
|
|
From: <zw...@ma...> - 2009-06-12 03:40:01
|
Author: zwelch
Date: 2009-06-12 03:39:57 +0200 (Fri, 12 Jun 2009)
New Revision: 2208
Modified:
trunk/src/helper/log.c
Log:
Simplify and improve handle_debug_level_comamnd:
- Bug fix: Return a syntax error if more than one argument is given.
- Bug fix: Use new parse_uint helper ensure debug_level parses correctly.
- Change: Display the debug_level after it has been set.
- Simplify bounds checking of debug_level.
Modified: trunk/src/helper/log.c
===================================================================
--- trunk/src/helper/log.c 2009-06-12 01:39:51 UTC (rev 2207)
+++ trunk/src/helper/log.c 2009-06-12 01:39:57 UTC (rev 2208)
@@ -194,18 +194,19 @@
*/
int handle_debug_level_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
- if (argc == 0)
- command_print(cmd_ctx, "debug_level: %i", debug_level);
+ if (argc == 1)
+ {
+ unsigned new_level;
+ int retval = parse_uint(args[0], &new_level);
+ if (ERROR_OK != retval)
+ return retval;
+ debug_level = MIN(new_level, LOG_LVL_DEBUG);
+ }
+ else if (argc > 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
- if (argc > 0)
- debug_level = strtoul(args[0], NULL, 0);
+ command_print(cmd_ctx, "debug_level: %i", debug_level);
- if (debug_level < 0)
- debug_level = 0;
-
- if (debug_level > 3)
- debug_level = 3;
-
if (debug_level >= LOG_LVL_DEBUG && server_use_pipes == 1)
{
/* if we are enabling debug info then we need to write to a log file
|
|
From: <zw...@ma...> - 2009-06-12 03:39:55
|
Author: zwelch
Date: 2009-06-12 03:39:51 +0200 (Fri, 12 Jun 2009)
New Revision: 2207
Modified:
trunk/src/helper/command.c
Log:
Simplify handle_sleep_command:
- Use new parse_ulong to ensure duration parses as a valid number.
- Rework logic to improve readability and seliminate uperfluous braces.
- Change whitespace to improve style.
Modified: trunk/src/helper/command.c
===================================================================
--- trunk/src/helper/command.c 2009-06-12 01:39:44 UTC (rev 2206)
+++ trunk/src/helper/command.c 2009-06-12 01:39:51 UTC (rev 2207)
@@ -757,38 +757,36 @@
/* sleep command sleeps for <n> miliseconds
* this is useful in target startup scripts
*/
-int handle_sleep_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+int handle_sleep_command(struct command_context_s *cmd_ctx,
+ char *cmd, char **args, int argc)
{
- unsigned long duration = 0;
- int busy = 0;
-
- if (argc==1)
+ bool busy = false;
+ if (argc == 2)
{
-
- } else if (argc==2)
- {
- if (strcmp(args[1], "busy")!=0)
+ if (strcmp(args[1], "busy") == 0)
+ busy = true;
+ else
return ERROR_COMMAND_SYNTAX_ERROR;
- busy = 1;
- } else
- {
- return ERROR_COMMAND_SYNTAX_ERROR;
}
+ else if (argc < 1 || argc > 2)
+ return ERROR_COMMAND_SYNTAX_ERROR;
- duration = strtoul(args[0], NULL, 0);
+ unsigned long duration = 0;
+ int retval = parse_ulong(args[0], &duration);
+ if (ERROR_OK != retval)
+ return retval;
- if (busy)
+ if (!busy)
{
- busy_sleep(duration);
- } else
- {
- long long then=timeval_ms();
- while ((timeval_ms()-then)<(long long)duration)
+ long long then = timeval_ms();
+ while (timeval_ms() - then < (long long)duration)
{
target_call_timer_callbacks_now();
usleep(1000);
}
}
+ else
+ busy_sleep(duration);
return ERROR_OK;
}
|
|
From: <zw...@ma...> - 2009-06-12 03:39:49
|
Author: zwelch
Date: 2009-06-12 03:39:44 +0200 (Fri, 12 Jun 2009)
New Revision: 2206
Modified:
trunk/src/helper/command.c
trunk/src/helper/command.h
Log:
Add new parse_uinttype wrappers for strtoul in src/helper/command.[ch].
- Used to improve command argument parsing of unsigned integers values.
Modified: trunk/src/helper/command.c
===================================================================
--- trunk/src/helper/command.c 2009-06-11 21:55:43 UTC (rev 2205)
+++ trunk/src/helper/command.c 2009-06-12 01:39:44 UTC (rev 2206)
@@ -848,3 +848,18 @@
}
return 0;
}
+
+int parse_ullong(const char *str, unsigned long long *ul)
+{
+ char *end;
+ *ul = strtoull(str, &end, 0);
+ bool okay = *str && !*end && ULLONG_MAX != *ul;
+ return okay ? ERROR_OK : ERROR_COMMAND_SYNTAX_ERROR;
+}
+int parse_ulong(const char *str, unsigned long *ul)
+{
+ char *end;
+ *ul = strtoul(str, &end, 0);
+ bool okay = *str && !*end && ULONG_MAX != *ul;
+ return okay ? ERROR_OK : ERROR_COMMAND_SYNTAX_ERROR;
+}
Modified: trunk/src/helper/command.h
===================================================================
--- trunk/src/helper/command.h 2009-06-11 21:55:43 UTC (rev 2205)
+++ trunk/src/helper/command.h 2009-06-12 01:39:44 UTC (rev 2206)
@@ -107,4 +107,20 @@
long jim_global_long(const char *variable);
+int parse_ulong(const char *str, unsigned long *ul);
+int parse_ullong(const char *str, unsigned long long *ul);
+
+#define DEFINE_PARSE_ULONG(name, type, max) \
+ static inline int parse_##name(const char *str, type *ul) \
+ { \
+ unsigned long n; \
+ int retval = parse_ulong(str, &n); \
+ *ul = n; \
+ return n > (max) ? ERROR_COMMAND_SYNTAX_ERROR : retval; \
+ }
+DEFINE_PARSE_ULONG(uint, unsigned, UINT_MAX)
+DEFINE_PARSE_ULONG(u32, uint32_t, UINT32_MAX)
+DEFINE_PARSE_ULONG(u16, uint16_t, UINT16_MAX)
+DEFINE_PARSE_ULONG(u8, uint8_t, UINT8_MAX)
+
#endif /* COMMAND_H */
|
|
From: <zw...@ma...> - 2009-06-11 23:55:48
|
Author: zwelch
Date: 2009-06-11 23:55:43 +0200 (Thu, 11 Jun 2009)
New Revision: 2205
Modified:
trunk/src/helper/command.c
trunk/src/helper/command.h
Log:
David Brownell <da...@pa...>:
Minor bugfix: command_print_sameline() is what the
headers declare; make the code match.
Minor improvement: make the printf format params always be const.
Modified: trunk/src/helper/command.c
===================================================================
--- trunk/src/helper/command.c 2009-06-11 21:48:36 UTC (rev 2204)
+++ trunk/src/helper/command.c 2009-06-11 21:55:43 UTC (rev 2205)
@@ -337,7 +337,7 @@
}
}
-void command_print_n(command_context_t *context, char *format, ...)
+void command_print_sameline(command_context_t *context, const char *format, ...)
{
char *string;
@@ -361,7 +361,7 @@
va_end(ap);
}
-void command_print(command_context_t *context, char *format, ...)
+void command_print(command_context_t *context, const char *format, ...)
{
char *string;
@@ -497,7 +497,7 @@
return retval;
}
-int command_run_linef(command_context_t *context, char *format, ...)
+int command_run_linef(command_context_t *context, const char *format, ...)
{
int retval=ERROR_FAIL;
char *string;
Modified: trunk/src/helper/command.h
===================================================================
--- trunk/src/helper/command.h 2009-06-11 21:48:36 UTC (rev 2204)
+++ trunk/src/helper/command.h 2009-06-11 21:55:43 UTC (rev 2205)
@@ -84,12 +84,12 @@
extern command_context_t* command_init(void);
extern int command_done(command_context_t *context);
-extern void command_print(command_context_t *context, char *format, ...)
+extern void command_print(command_context_t *context, const char *format, ...)
__attribute__ ((format (printf, 2, 3)));
-extern void command_print_sameline(command_context_t *context, char *format, ...)
+extern void command_print_sameline(command_context_t *context, const char *format, ...)
__attribute__ ((format (printf, 2, 3)));
extern int command_run_line(command_context_t *context, char *line);
-extern int command_run_linef(command_context_t *context, char *format, ...)
+extern int command_run_linef(command_context_t *context, const char *format, ...)
__attribute__ ((format (printf, 2, 3)));
extern void command_output_text(command_context_t *context, const char *data);
|
|
From: <zw...@ma...> - 2009-06-11 23:48:42
|
Author: zwelch
Date: 2009-06-11 23:48:36 +0200 (Thu, 11 Jun 2009)
New Revision: 2204
Modified:
trunk/doc/openocd.texi
Log:
David Brownell <da...@pa...>:
Rework the "Simple Configuration Files" chapter so it's more
of a quick-start "how to set up your project" tutorial:
- Say how to hook up the JTAG adapter. This will help new
users, and in any case is worth spelling out somewhere.
- Streamline the previous rather haphazard presentation,
filling in some missing holes along the way:
* Suggest "project directory" structure
* Introduce new term, "user config" file (openocd.cfg)
* Talk about more options for openocd.cfg contents
* ... and about creating new config files
* Add new topic, project-specific utilities (+examples)
- Remove too-short, yet duplicative, chapter 19
Nudge packagers a bit more strongly to send patches (including
config files) upstream.
Modified: trunk/doc/openocd.texi
===================================================================
--- trunk/doc/openocd.texi 2009-06-11 21:23:24 UTC (rev 2203)
+++ trunk/doc/openocd.texi 2009-06-11 21:48:36 UTC (rev 2204)
@@ -63,7 +63,7 @@
* Building OpenOCD:: Building OpenOCD From SVN
* JTAG Hardware Dongles:: JTAG Hardware Dongles
* Running:: Running OpenOCD
-* Simple Configuration Files:: Simple Configuration Files
+* OpenOCD Project Setup:: OpenOCD Project Setup
* Config File Guidelines:: Config File Guidelines
* About JIM-Tcl:: About JIM-Tcl
* Daemon Configuration:: Daemon Configuration
@@ -76,7 +76,6 @@
* General Commands:: General Commands
* Architecture and Core Commands:: Architecture and Core Commands
* JTAG Commands:: JTAG Commands
-* Sample Scripts:: Sample Target Scripts
* TFTP:: TFTP
* GDB and OpenOCD:: Using GDB and OpenOCD
* Tcl Scripting API:: Tcl Scripting API
@@ -239,6 +238,7 @@
suggestions:
@enumerate
+@item @b{Send patches, including config files, upstream.}
@item @b{Always build with printer ports enabled.}
@item @b{Try to use LIBFTDI + LIBUSB where possible. You cover more bases.}
@end enumerate
@@ -718,29 +718,115 @@
the JTAG controller to be unresponsive until the target is set up
correctly via e.g. GDB monitor commands in a GDB init script.
-@node Simple Configuration Files
-@chapter Simple Configuration Files
-@cindex configuration
+@node OpenOCD Project Setup
+@chapter OpenOCD Project Setup
-@section Outline
-There are 4 basic ways of ``configurating'' OpenOCD to run, they are:
+To use OpenOCD with your development projects, you need to do more than
+just connecting the JTAG adapter hardware (dongle) to your development board
+and then starting the OpenOCD server.
+You also need to configure that server so that it knows
+about that adapter and board, and helps your work.
+@section Hooking up the JTAG Adapter
+
+Today's most common case is a dongle with a JTAG cable on one side
+(such as a ribbon cable with a 10-pin or 20-pin IDC connector)
+and a USB cable on the other.
+Instead of USB, some cables use Ethernet;
+older ones may use a PC parallel port, or even a serial port.
+
@enumerate
-@item A small openocd.cfg file which ``sources'' other configuration files
-@item A monolithic openocd.cfg file
-@item Many -f filename options on the command line
-@item Your Mixed Solution
+@item @emph{Start with power to your target board turned off},
+and nothing connected to your JTAG adapter.
+If you're particularly paranoid, unplug power to the board.
+It's important to have the ground signal properly set up,
+unless you are using a JTAG adapter which provides
+galvanic isolation between the target board and the
+debugging host.
+
+@item @emph{Be sure it's the right kind of JTAG connector.}
+If your dongle has a 20-pin ARM connector, you need some kind
+of adapter (or octopus, see below) to hook it up to
+boards using 14-pin or 10-pin connectors ... or to 20-pin
+connectors which don't use ARM's pinout.
+
+In the same vein, make sure the voltage levels are compatible.
+Not all JTAG adapters have the level shifters needed to work
+with 1.2 Volt boards.
+
+@item @emph{Be certain the cable is properly oriented} or you might
+damage your board. In most cases there are only two possible
+ways to connect the cable.
+Connect the JTAG cable from your adapter to the board.
+Be sure it's firmly connected.
+
+In the best case, the connector is keyed to physically
+prevent you from inserting it wrong.
+This is most often done using a slot on the board's male connector
+housing, which must match a key on the JTAG cable's female connector.
+If there's no housing, then you must look carefully and
+make sure pin 1 on the cable hooks up to pin 1 on the board.
+Ribbon cables are frequently all grey except for a wire on one
+edge, which is red. The red wire is pin 1.
+
+Sometimes dongles provide cables where one end is an ``octopus'' of
+color coded single-wire connectors, instead of a connector block.
+These are great when converting from one JTAG pinout to another,
+but are tedious to set up.
+Use these with connector pinout diagrams to help you match up the
+adapter signals to the right board pins.
+
+@item @emph{Connect the adapter's other end} once the JTAG cable is connected.
+A USB, parallel, or serial port connector will go to the host which
+you are using to run OpenOCD.
+For Ethernet, consult the documentation and your network administrator.
+
+For USB based JTAG adapters you have an easy sanity check at this point:
+does the host operating system see the JTAG adapter?
+
+@item @emph{Connect the adapter's power supply, if needed.}
+This step is primarily for non-USB adapters,
+but sometimes USB adapters need extra power.
+
+@item @emph{Power up the target board.}
+Unless you just let the magic smoke escape,
+you're now ready to set up the OpenOCD server
+so you can use JTAG to work with that board.
+
@end enumerate
-@section Small configuration file method
+Talk with the OpenOCD server using
+telnet (@code{telnet localhost 4444} on many systems) or GDB.
+@xref{GDB and OpenOCD}.
-This is the preferred method. It is simple and works well for many
-people. The developers of OpenOCD would encourage you to use this
-method. If you create a new configuration please email new
-configurations to the development list.
+@section Project Directory
-Here is an example of an openocd.cfg file for an ATMEL at91sam7x256
+There are many ways you can configure OpenOCD and start it up.
+A simple way to organize them all involves keeping a
+single directory for your work with a given board.
+When you start OpenOCD from that directory,
+it searches there first for configuration files
+and for code you upload to the target board.
+It is also be the natural place to write files,
+such as log files and data you download from the board.
+
+@section Configuration Basics
+
+There are two basic ways of configuring OpenOCD, and
+a variety of ways you can mix them.
+Think of the difference as just being how you start the server:
+
+@itemize
+@item Many @option{-f file} or @option{-c command} options on the command line
+@item No options, but a @dfn{user config file}
+in the current directory named @file{openocd.cfg}
+@end itemize
+
+Here is an example @file{openocd.cfg} file for a setup
+using a Signalyzer FT2232-based JTAG adapter to talk to
+a board with an Atmel AT91SAM7X256 microcontroller:
+
@example
source [find interface/signalyzer.cfg]
@@ -751,68 +837,174 @@
source [find target/sam7x256.cfg]
@end example
-There are many example configuration scripts you can work with. You
-should look in the directory: @t{$(INSTALLDIR)/lib/openocd}. You
-should find:
+Here is the command line equivalent of that configuration:
+@example
+openocd -f interface/signalyzer.cfg \
+ -c "gdb_memory_map enable" \
+ -c "gdb_flash_program enable" \
+ -f target/sam7x256.cfg
+@end example
+
+You could wrap such long command lines in shell scripts,
+each supporting a different development task.
+One might re-flash the board with specific firmware version.
+Another might set up a particular debugging or run-time environment.
+
+Here we will focus on the simpler solution: one user config
+file, including basic configuration plus any TCL procedures
+to simplify your work.
+
+@section User Config Files
+@cindex config file
+@cindex user config file
+
+A user configuration file ties together all the parts of a project
+in one place.
+One of the following will match your situation best:
+
+@itemize
+@item Ideally almost everything comes from configuration files
+provided by someone else.
+For example, OpenOCD distributes a @file{scripts} directory
+(probably in @file{/usr/share/openocd/scripts} on Linux);
+board and tool vendors can provide these too.
+The AT91SAM7X256 example above works this way.
+
+Three main types of non-user configuration file each have their
+own subdirectory in the @file{scripts} directory:
+
@enumerate
-@item @b{board} - eval board level configurations
-@item @b{interface} - specific dongle configurations
-@item @b{target} - the target chips
-@item @b{tcl} - helper scripts
-@item @b{xscale} - things specific to the xscale.
+@item @b{interface} -- one for each kind of JTAG adapter/dongle
+@item @b{board} -- one for each different board
+@item @b{target} -- the chips which integrate CPUs and other JTAG TAPs
@end enumerate
-Look first in the ``boards'' area, then the ``targets'' area. Often a board
-configuration is a good example to work from.
+Best case: include just two files, and they handle everything else.
+The first is an interface config file.
+The second is board-specific, and it sets up the JTAG TAPs and
+their GDB targets (by deferring to some @file{target.cfg} file),
+declares all flash memory, and leaves you nothing to do except
+meet your deadline:
-@section Many -f filename options
-Some believe this is a wonderful solution, others find it painful.
+@example
+source [find interface/olimex-jtag-tiny.cfg]
+source [find board/csb337.cfg]
+@end example
-You can use a series of ``-f filename'' options on the command line,
-OpenOCD will read each filename in sequence, for example:
+Boards with a single microcontroller often won't need more
+than the target config file, as in the AT91SAM7X256 example.
+That's because there is no external memory (flash, DDR RAM), and
+the board differences are encapsulated by application code.
+@item You can often reuse some standard config files but
+need to write a few new ones, probably a @file{board.cfg} file.
+You will be using commands described later in this User's Guide,
+and working with the guidelines in the next chapter.
+
+For example, there may be configuration files for your JTAG adapter
+and target chip, but you need a new board-specific config file
+giving access to your particular flash chips.
+Or you might need to write another target chip configuration file
+for a new chip built around the Cortex M3 core.
+
+@quotation Note
+When you write new configuration files, please submit
+them for inclusion in the next OpenOCD release.
+For example, a @file{board/newboard.cfg} file will help the
+next users of that board, and a @file{target/newcpu.cfg}
+will help support users of any board using that chip.
+@end quotation
+
+@item
+You may may need to write some C code.
+It may be as simple as a supporting a new new ft2232 or parport
+based dongle; a bit more involved, like a NAND or NOR flash
+controller driver; or a big piece of work like supporting
+a new chip architecture.
+@end itemize
+
+Reuse the existing config files when you can.
+Look first in the @file{scripts/boards} area, then @file{scripts/targets}.
+You may find a board configuration that's a good example to follow.
+
+When you write config files, separate the reusable parts
+(things every user of that interface, chip, or board needs)
+from ones specific to your environment and debugging approach.
+
+For example, a @code{gdb-attach} event handler that invokes
+the @command{reset init} command will interfere with debugging
+early boot code, which performs some of the same actions
+that the @code{reset-init} event handler does.
+Likewise, the @command{arm9tdmi vector_catch} command (or
+its @command{xscale vector_catch} sibling) can be a timesaver
+during some debug sessions, but don't make everyone use that either.
+Keep those kinds of debugging aids in your user config file.
+
+@section Project-Specific Utilities
+
+A few project-specific utility
+routines may well speed up your work.
+Write them, and keep them in your project's user config file.
+
+For example, if you are making a boot loader work on a
+board, it's nice to be able to debug the ``after it's
+loaded to RAM'' parts separately from the finicky early
+code which sets up the DDR RAM controller and clocks.
+A script like this one, or a more GDB-aware sibling,
+may help:
+
@example
-openocd -f file1.cfg -f file2.cfg -f file2.cfg
-@end example
+proc ramboot @{ @} @{
+ # Reset, running the target's "reset-init" scripts
+ # to initialize clocks and the DDR RAM controller.
+ # Leave the CPU halted.
+ reset init
-You can also intermix various commands with the ``-c'' command line
-option.
+ # Load CONFIG_SKIP_LOWLEVEL_INIT version into DDR RAM.
+ load_image u-boot.bin 0x20000000
-@section Monolithic file
-The ``Monolithic File'' dispenses with all ``source'' statements and
-puts everything in one self contained (monolithic) file. This is not
-encouraged.
+ # Start running.
+ resume 0x20000000
+@}
+@end example
-Please try to ``source'' various files or use the multiple -f
-technique.
+Then once that code is working you will need to make it
+boot from NOR flash; a different utility would help.
+Alternatively, some developers write to flash using GDB.
+(You might use a similar script if you're working with a flash
+based microcontroller application instead of a boot loader.)
-@section Advice for you
-Often, one uses a ``mixed approach''. Where possible, please try to
-``source'' common things, and if needed cut/paste parts of the
-standard distribution configuration files as needed.
+@example
+proc newboot @{ @} @{
+ # Reset, leaving the CPU halted. The "reset-init" event
+ # proc gives faster access to the CPU and to NOR flash;
+ # "reset halt" would be slower.
+ reset init
-@b{REMEMBER:} The ``important parts'' of your configuration file are:
+ # Write standard version of U-Boot into the first two
+ # sectors of NOR flash ... the standard version should
+ # do the same lowlevel init as "reset-init".
+ flash protect 0 0 1 off
+ flash erase_sector 0 0 1
+ flash write_bank 0 u-boot.bin 0x0
+ flash protect 0 0 1 on
-@enumerate
-@item @b{Interface} - Defines the dongle
-@item @b{Taps} - Defines the JTAG Taps
-@item @b{GDB Targets} - What GDB talks to
-@item @b{Flash Programing} - Very Helpful
-@end enumerate
+ # Reboot from scratch using that new boot loader.
+ reset run
+@}
+@end example
-Some key things you should look at and understand are:
+You may need more complicated utility procedures when booting
+from NAND.
+That often involves an extra bootloader stage,
+running from on-chip SRAM to perform DDR RAM setup so it can load
+the main bootloader code (which won't fit into that SRAM).
-@enumerate
-@item The reset configuration of your debug environment as a whole
-@item Is there a ``work area'' that OpenOCD can use?
-@* For ARM - work areas mean up to 10x faster downloads.
-@item For MMU/MPU based ARM chips (i.e.: ARM9 and later) will that work area still be available?
-@item For complex targets (multiple chips) the JTAG SPEED becomes an issue.
-@end enumerate
+Other helper scripts might be used to write production system images,
+involving considerably more than just a three stage bootloader.
-
@node Config File Guidelines
@chapter Config File Guidelines
@@ -852,6 +1044,7 @@
various commands specific to their situation.
@section Interface Config Files
+@cindex config file
The user should be able to source one of these files via a command like this:
@@ -868,6 +1061,7 @@
Interface files should be found in @t{$(INSTALLDIR)/lib/openocd/interface}
@section Board Config Files
+@cindex config file
@b{Note: BOARD directory NEW as of 28/nov/2008}
@@ -896,6 +1090,7 @@
@end enumerate
@section Target Config Files
+@cindex config file
The user should be able to source one of these files via a command like this:
@@ -1113,13 +1308,6 @@
If the chip has a DCC, enable it. If the chip is an ARM9 with some
special high speed download features - enable it.
-If the chip supports the @command{arm9tdmi vector_catch},
-@command{xscale vector_catch}, or similar features,
-consider enabling it in your user-specific configuration file.
-Experience has shown the ``vector_catch'' can be
-helpful for catching programming errors
-like Undefined Instructions, Data Abort, and Prefetch Abort.
-
If present, the MMU, the MPU and the CACHE should be disabled.
Some ARM cores are equipped with trace support, which permits
@@ -4885,33 +5073,6 @@
are numerous TFTP servers out there (free and commercial) and you will have to do
a bit of googling to find something that fits your requirements.
-@node Sample Scripts
-@chapter Sample Scripts
-@cindex scripts
-
-This page shows how to use the Target Library.
-
-The configuration script can be divided into the following sections:
-@itemize @bullet
-@item Daemon configuration
-@item Interface
-@item JTAG scan chain
-@item Target configuration
-@item Flash configuration
-@end itemize
-
-Detailed information about each section can be found at OpenOCD configuration.
-
-@section AT91R40008 example
-@cindex AT91R40008 example
-To start OpenOCD with a target script for the AT91R40008 CPU and reset
-the CPU upon startup of the OpenOCD daemon.
-@example
-openocd -f interface/parport.cfg -f target/at91r40008.cfg \
- -c "init" -c "reset"
-@end example
-
-
@node GDB and OpenOCD
@chapter GDB and OpenOCD
@cindex GDB
|
|
From: <zw...@ma...> - 2009-06-11 23:23:29
|
Author: zwelch
Date: 2009-06-11 23:23:24 +0200 (Thu, 11 Jun 2009)
New Revision: 2203
Modified:
trunk/doc/openocd.texi
Log:
David Brownell <da...@pa...>:
Update "arm9tdmi vector_catch" command description to highlight both
use cases (display configuration, or first change that config) and
to explain a bit more about what this is: an alternative to using
hardware breakpoint resources.
Note that I tried this on an arm920t, but it didn't work. Set bits,
then examined them and they weren't set. And it didn't seem to act
as if vector triggering was noticed, either.
Also some minor unrelated tweaks: @ignore some unused or don't-use
event names; fix a few typos; tweak chip-specific reset descriptions.
Modified: trunk/doc/openocd.texi
===================================================================
--- trunk/doc/openocd.texi 2009-06-11 19:32:10 UTC (rev 2202)
+++ trunk/doc/openocd.texi 2009-06-11 21:23:24 UTC (rev 2203)
@@ -1091,7 +1091,7 @@
-work-area-size 0x4000 -work-area-backup 0
@end example
-@subsection Reset Configuration
+@subsection Chip Reset Setup
As a rule, you should put the @command{reset_config} command
into the board file. Most things you think you know about a
@@ -1101,16 +1101,24 @@
managed. In the unusual case that these are @emph{chip specific}
and can never be changed by board wiring, they could go here.
+Some chips need special attention during reset handling if
+they're going to be used with JTAG.
+An example might be needing to send some commands right
+after the target's TAP has been reset, providing a
+@code{reset-deassert-post} event handler that writes a chip
+register to report that JTAG debugging is being done.
+
@subsection ARM Core Specific Hacks
If the chip has a DCC, enable it. If the chip is an ARM9 with some
special high speed download features - enable it.
-If the chip has an ARM ``vector catch'' feature - by default enable
-it for Undefined Instructions, Data Abort, and Prefetch Abort, if the
-user is really writing a handler for those situations - they can
-easily disable it. Experiance has shown the ``vector catch'' is
-helpful - for common programing errors.
+If the chip supports the @command{arm9tdmi vector_catch},
+@command{xscale vector_catch}, or similar features,
+consider enabling it in your user-specific configuration file.
+Experience has shown the ``vector_catch'' can be
+helpful for catching programming errors
+like Undefined Instructions, Data Abort, and Prefetch Abort.
If present, the MMU, the MPU and the CACHE should be disabled.
@@ -2636,16 +2644,18 @@
@* The target has resumed (i.e.: gdb said run)
@item @b{early-halted}
@* Occurs early in the halt process
+@ignore
@item @b{examine-end}
@* Currently not used (goal: when JTAG examine completes)
@item @b{examine-start}
@* Currently not used (goal: when JTAG examine starts)
+@end ignore
@item @b{gdb-attach}
@* When GDB connects
@item @b{gdb-detach}
@* When GDB disconnects
@item @b{gdb-end}
-@* When the taret has halted and GDB is not doing anything (see early halt)
+@* When the target has halted and GDB is not doing anything (see early halt)
@item @b{gdb-flash-erase-start}
@* Before the GDB flash process tries to erase the flash
@item @b{gdb-flash-erase-end}
@@ -2655,13 +2665,15 @@
@item @b{gdb-flash-write-end}
@* After GDB writes to the flash
@item @b{gdb-start}
-@* Before the taret steps, gdb is trying to start/resume the target
+@* Before the target steps, gdb is trying to start/resume the target
@item @b{halted}
@* The target has halted
+@ignore
@item @b{old-gdb_program_config}
@* DO NOT USE THIS: Used internally
@item @b{old-pre_resume}
@* DO NOT USE THIS: Used internally
+@end ignore
@item @b{reset-assert-pre}
@* Issued as part of @command{reset} processing
after SRST and/or TRST were activated and deactivated,
@@ -2681,10 +2693,12 @@
when reset has been released on the tap.
@item @b{reset-end}
@* Issued as the final step in @command{reset} processing.
+@ignore
@item @b{reset-halt-post}
-@* Currently not usd
+@* Currently not used
@item @b{reset-halt-pre}
@* Currently not used
+@end ignore
@item @b{reset-init}
@* Used by @b{reset init} command for board-specific initialization.
This event fires after @emph{reset-deassert-post}.
@@ -2695,10 +2709,12 @@
@item @b{reset-start}
@* Issued as part of @command{reset} processing
before either SRST or TRST are activated.
+@ignore
@item @b{reset-wait-pos}
@* Currently not used
@item @b{reset-wait-pre}
@* Currently not used
+@end ignore
@item @b{resume-start}
@* Before any target is resumed
@item @b{resume-end}
@@ -3992,6 +4008,9 @@
at @var{address} for @var{length} bytes.
This is a software breakpoint, unless @option{hw} is specified
in which case it will be a hardware breakpoint.
+
+(@xref{arm9tdmi vector_catch}, or @pxref{xscale vector_catch},
+for similar mechanisms that do not consume hardware breakpoints.)
@end deffn
@deffn Command {rbp} address
@@ -4348,8 +4367,22 @@
or processors resembling ARM9TDMI, and can use these commands.
Such cores include the ARM920T, ARM926EJ-S, and ARM966.
-@deffn Command {arm9tdmi vector_catch} (@option{all}|@option{none}|list)
-Catch arm9 interrupt vectors, can be @option{all}, @option{none},
+@c 9-june-2009: tried this on arm920t, it didn't work.
+@c no-params always lists nothing caught, and that's how it acts.
+
+@anchor{arm9tdmi vector_catch}
+@deffn Command {arm9tdmi vector_catch} [@option{all}|@option{none}|list]
+Vector Catch hardware provides a sort of dedicated breakpoint
+for hardware events such as reset, interrupt, and abort.
+You can use this to conserve normal breakpoint resources,
+so long as you're not concerned with code that branches directly
+to those hardware vectors.
+
+This always finishes by listing the current configuration.
+If parameters are provided, it first reconfigures the
+vector catch hardware to intercept
+@option{all} of the hardware vectors,
+@option{none} of them,
or a list with one or more of the following:
@option{reset} @option{undef} @option{swi} @option{pabt} @option{dabt} @option{reserved}
@option{irq} @option{fiq}.
@@ -4526,8 +4559,10 @@
@option{mem}, or @option{builder}.
@end deffn
-@deffn Command {xscale vector_catch} mask
-Provide a bitmask showing the vectors to catch.
+@anchor{xscale vector_catch}
+@deffn Command {xscale vector_catch} [mask]
+Display a bitmask showing the hardware vectors to catch.
+If the optional parameter is provided, first set the bitmask to that value.
@end deffn
@section ARMv6 Architecture
|
|
From: ntfreak at B. <nt...@ma...> - 2009-06-11 21:32:12
|
Author: ntfreak
Date: 2009-06-11 21:32:10 +0200 (Thu, 11 Jun 2009)
New Revision: 2202
Modified:
trunk/src/target/mips32.c
Log:
- fix bug introduced during r1962
- Original patch submitted by David Claffey [dnc...@gm...].
Modified: trunk/src/target/mips32.c
===================================================================
--- trunk/src/target/mips32.c 2009-06-11 13:07:20 UTC (rev 2201)
+++ trunk/src/target/mips32.c 2009-06-11 19:32:10 UTC (rev 2202)
@@ -346,7 +346,7 @@
{
mips32_common_t *mips32 = target->arch_info;
- if (target_was_examined(target))
+ if (!target_was_examined(target))
{
target_set_examined(target);
|
|
From: oharboe at B. <oh...@ma...> - 2009-06-11 15:08:33
|
Author: oharboe
Date: 2009-06-11 15:07:20 +0200 (Thu, 11 Jun 2009)
New Revision: 2201
Modified:
zy1000/trunk/build/openocd.ecm
zy1000/trunk/snapshots/athttpd.zip
zy1000/trunk/snapshots/discover.zip
zy1000/trunk/snapshots/jimtcl.zip
zy1000/trunk/snapshots/repository.zip
Log:
update eCos to CVS HEAD
Modified: zy1000/trunk/build/openocd.ecm
===================================================================
--- zy1000/trunk/build/openocd.ecm 2009-06-11 13:04:30 UTC (rev 2200)
+++ zy1000/trunk/build/openocd.ecm 2009-06-11 13:07:20 UTC (rev 2201)
@@ -62,9 +62,13 @@
};
cdl_option CYGBLD_GLOBAL_CFLAGS {
- user_value "-mlong-calls -mcpu=arm7tdmi -Wall -Wpointer-arith -Winline -Wundef -g -O3 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti "
+ user_value "-mlong-calls -mcpu=arm7tdmi -Wall -Wpointer-arith -Winline -Wundef -g -O3 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -mno-thumb-interwork "
};
+cdl_option CYGBLD_GLOBAL_LDFLAGS {
+ inferred_value "-mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -g -nostdlib -mlong-calls -mno-thumb-interwork "
+};
+
cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
user_value 16384
};
@@ -435,6 +439,27 @@
inferred_value 1
};
+cdl_component CYGOPT_FS_JFFS2_COMPRESS {
+ user_value 0
+};
+
+cdl_option CYGOPT_FS_JFFS2_COMPRESS_ZLIB {
+ user_value 0
+ inferred_value 0
+};
+
+cdl_option CYGOPT_FS_JFFS2_COMPRESS_RTIME {
+ user_value 0
+};
+
+cdl_option CYGOPT_FS_JFFS2_COMPRESS_CMODE {
+ user_value NONE
+};
+
+cdl_option CYGBLD_FS_ROMFS_MK_ROMFS {
+ user_value 0
+};
+
cdl_component CYGPKG_NET_TFTPD_CLIENT_BIG_PACKET {
user_value 1
};
@@ -475,27 +500,14 @@
user_value 64
};
-cdl_component CYGOPT_FS_JFFS2_COMPRESS {
- user_value 0
+cdl_component CYGPKG_IO_FLASH_BLOCK_DEVICE {
+ inferred_value 1
};
-cdl_option CYGOPT_FS_JFFS2_COMPRESS_ZLIB {
- user_value 0
- inferred_value 0
+cdl_component CYGPKG_IO_FLASH_BLOCK_DEVICE_LEGACY {
+ user_value 1
};
-cdl_option CYGOPT_FS_JFFS2_COMPRESS_RTIME {
- user_value 0
-};
-
-cdl_option CYGOPT_FS_JFFS2_COMPRESS_CMODE {
- user_value NONE
-};
-
-cdl_component CYGPKG_IO_FLASH_BLOCK_DEVICE {
- inferred_value 1
-};
-
cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 {
user_value 0x00040000
};
@@ -552,10 +564,6 @@
user_value 1
};
-cdl_option CYGBLD_FS_ROMFS_MK_ROMFS {
- user_value 0
-};
-
cdl_option CYGDAT_NET_DISCOVER_MESSAGE {
user_value "\"ZY1000 Zylin JTAG debugger\""
};
Modified: zy1000/trunk/snapshots/athttpd.zip
===================================================================
(Binary files differ)
Modified: zy1000/trunk/snapshots/discover.zip
===================================================================
(Binary files differ)
Modified: zy1000/trunk/snapshots/jimtcl.zip
===================================================================
(Binary files differ)
Modified: zy1000/trunk/snapshots/repository.zip
===================================================================
(Binary files differ)
|
|
From: oharboe at B. <oh...@ma...> - 2009-06-11 15:04:30
|
Author: oharboe Date: 2009-06-11 15:04:30 +0200 (Thu, 11 Jun 2009) New Revision: 2200 Modified: zy1000/trunk/build/buildocd.sh Log: embedded host: use --enable-maintainer-mode in configure Modified: zy1000/trunk/build/buildocd.sh =================================================================== --- zy1000/trunk/build/buildocd.sh 2009-06-11 13:04:00 UTC (rev 2199) +++ zy1000/trunk/build/buildocd.sh 2009-06-11 13:04:30 UTC (rev 2200) @@ -19,7 +19,7 @@ rm -rf /tmp/ecosboard/build mkdir /tmp/ecosboard/build cd /tmp/ecosboard/build -$OPENOCD/../../openocd/configure --disable-bitbang --disable-werror --enable-ioutil --host=arm-elf --includedir=/tmp/ecosboard/ecos/install/include/ --enable-ecosboard --prefix=/tmp/ecosboard/ocdinstall +$OPENOCD/../../openocd/configure --enable-maintainer-mode --disable-bitbang --disable-werror --enable-ioutil --host=arm-elf --includedir=/tmp/ecosboard/ecos/install/include/ --enable-ecosboard --prefix=/tmp/ecosboard/ocdinstall echo >makephi.sh sh $OPENOCD/makephi.sh echo >>makephi.sh sh $OPENOCD/makefw.sh make |
|
From: oharboe at B. <oh...@ma...> - 2009-06-11 15:04:01
|
Author: oharboe Date: 2009-06-11 15:04:00 +0200 (Thu, 11 Jun 2009) New Revision: 2199 Modified: zy1000/trunk/build/makephi.sh Log: keep up with moving script files Modified: zy1000/trunk/build/makephi.sh =================================================================== --- zy1000/trunk/build/makephi.sh 2009-06-11 13:03:32 UTC (rev 2198) +++ zy1000/trunk/build/makephi.sh 2009-06-11 13:04:00 UTC (rev 2199) @@ -9,6 +9,7 @@ # copy over installed stuff cp -r /tmp/ecosboard/ocdinstall/lib/openocd/* tclconvert/ +cp -r /tmp/ecosboard/ocdinstall/share/openocd/scripts/* tclconvert/ # Create rom filing system if [ `uname` = Linux ] ;then $OPENOCD/mk_romfs tclconvert rom.bin |
|
From: oharboe at B. <oh...@ma...> - 2009-06-11 15:03:32
|
Author: oharboe Date: 2009-06-11 15:03:32 +0200 (Thu, 11 Jun 2009) New Revision: 2198 Modified: trunk/src/ecosboard.c zy1000/trunk/build/tcl/openocd.cfg Log: embedded host: launch telnet server even if configuration fails Modified: trunk/src/ecosboard.c =================================================================== --- trunk/src/ecosboard.c 2009-06-11 13:00:08 UTC (rev 2197) +++ trunk/src/ecosboard.c 2009-06-11 13:03:32 UTC (rev 2198) @@ -1046,6 +1046,9 @@ command_run_linef(cmd_ctx, "script /rom/openocd.cfg"); + /* we MUST always run the init command as it will launch telnet sessions */ + command_run_line(cmd_ctx, "init"); + // FIX!!! Yuk! // diag_printf() is really invoked from many more places than we trust it // not to cause instabilities(e.g. invoking fputc() from an interrupt is *BAD*). Modified: zy1000/trunk/build/tcl/openocd.cfg =================================================================== --- zy1000/trunk/build/tcl/openocd.cfg 2009-06-11 13:00:08 UTC (rev 2197) +++ zy1000/trunk/build/tcl/openocd.cfg 2009-06-11 13:03:32 UTC (rev 2198) @@ -124,7 +124,9 @@ # Here we do *not* catch the error since we want the file & line number to appear # in the log script /config/settings/openocd.cfg -init + # Startup was OK set startup_status 1 +# init is run from C code so we can propagate any exception in this +# script easily. \ No newline at end of file |
|
From: oharboe at B. <oh...@ma...> - 2009-06-11 15:00:16
|
Author: oharboe
Date: 2009-06-11 15:00:08 +0200 (Thu, 11 Jun 2009)
New Revision: 2197
Modified:
trunk/src/helper/ioutil.c
trunk/src/target/target.c
Log:
fix ordering of arguments to fwrite()
Modified: trunk/src/helper/ioutil.c
===================================================================
--- trunk/src/helper/ioutil.c 2009-06-11 11:43:07 UTC (rev 2196)
+++ trunk/src/helper/ioutil.c 2009-06-11 13:00:08 UTC (rev 2197)
@@ -225,7 +225,7 @@
for (i = 1; i < argc; i++)
{
- if (fwrite(args[i], strlen(args[i]), 1, config_file)!=strlen(args[i]))
+ if (fwrite(args[i], 1, strlen(args[i]), config_file)!=strlen(args[i]))
break;
if (i != argc - 1)
{
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 11:43:07 UTC (rev 2196)
+++ trunk/src/target/target.c 2009-06-11 13:00:08 UTC (rev 2197)
@@ -2623,7 +2623,7 @@
static void writeData(FILE *f, const void *data, size_t len)
{
- size_t written = fwrite(data, len, 1, f);
+ size_t written = fwrite(data, 1, len, f);
if (written != len)
LOG_ERROR("failed to write %zu bytes: %s", len, strerror(errno));
}
|
|
From: <zw...@ma...> - 2009-06-11 13:43:10
|
Author: zwelch
Date: 2009-06-11 13:43:07 +0200 (Thu, 11 Jun 2009)
New Revision: 2196
Modified:
trunk/src/target/target.c
Log:
Factor handle_bp_command into pieces:
- Bug fix: return a syntax error if the wrong number of arguments are given.
- Add handle_bp_command_list() and handle_bp_command_set().
- Use temporary addr variable to eliminate redundant strtoul() calls.
- Place variable declarations at their point of first use.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 11:43:00 UTC (rev 2195)
+++ trunk/src/target/target.c 2009-06-11 11:43:07 UTC (rev 2196)
@@ -2449,57 +2449,69 @@
return handle_verify_image_command_internal(cmd_ctx, cmd, args, argc, 0);
}
-static int handle_bp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int handle_bp_command_list(struct command_context_s *cmd_ctx)
{
- int retval;
target_t *target = get_current_target(cmd_ctx);
-
- if (argc == 0)
+ breakpoint_t *breakpoint = target->breakpoints;
+ while (breakpoint)
{
- breakpoint_t *breakpoint = target->breakpoints;
-
- while (breakpoint)
+ if (breakpoint->type == BKPT_SOFT)
{
- if (breakpoint->type == BKPT_SOFT)
- {
- char* buf = buf_to_str(breakpoint->orig_instr, breakpoint->length, 16);
- command_print(cmd_ctx, "0x%8.8x, 0x%x, %i, 0x%s", breakpoint->address, breakpoint->length, breakpoint->set, buf);
- free(buf);
- }
- else
- {
- command_print(cmd_ctx, "0x%8.8x, 0x%x, %i", breakpoint->address, breakpoint->length, breakpoint->set);
- }
- breakpoint = breakpoint->next;
+ char* buf = buf_to_str(breakpoint->orig_instr,
+ breakpoint->length, 16);
+ command_print(cmd_ctx, "0x%8.8x, 0x%x, %i, 0x%s",
+ breakpoint->address, breakpoint->length,
+ breakpoint->set, buf);
+ free(buf);
}
- }
- else if (argc >= 2)
- {
- int hw = BKPT_SOFT;
- u32 length = 0;
-
- length = strtoul(args[1], NULL, 0);
-
- if (argc >= 3)
- if (strcmp(args[2], "hw") == 0)
- hw = BKPT_HARD;
-
- if ((retval = breakpoint_add(target, strtoul(args[0], NULL, 0), length, hw)) != ERROR_OK)
- {
- LOG_ERROR("Failure setting breakpoints");
- }
else
{
- command_print(cmd_ctx, "breakpoint added at address 0x%8.8lx",
- strtoul(args[0], NULL, 0));
+ command_print(cmd_ctx, "0x%8.8x, 0x%x, %i",
+ breakpoint->address, breakpoint->length, breakpoint->set);
}
+
+ breakpoint = breakpoint->next;
}
+ return ERROR_OK;
+}
+
+static int handle_bp_command_set(struct command_context_s *cmd_ctx,
+ u32 addr, u32 length, int hw)
+{
+ target_t *target = get_current_target(cmd_ctx);
+ int retval = breakpoint_add(target, addr, length, hw);
+ if (ERROR_OK == retval)
+ command_print(cmd_ctx, "breakpoint set at 0x%8.8x", addr);
else
+ LOG_ERROR("Failure setting breakpoint");
+ return retval;
+}
+
+static int handle_bp_command(struct command_context_s *cmd_ctx,
+ char *cmd, char **args, int argc)
+{
+ if (argc == 0)
+ return handle_bp_command_list(cmd_ctx);
+
+ if (argc < 2 || argc > 3)
{
command_print(cmd_ctx, "usage: bp <address> <length> ['hw']");
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
- return ERROR_OK;
+ u32 addr = strtoul(args[0], NULL, 0);
+ u32 length = strtoul(args[1], NULL, 0);
+
+ int hw = BKPT_SOFT;
+ if (argc == 3)
+ {
+ if (strcmp(args[2], "hw") == 0)
+ hw = BKPT_HARD;
+ else
+ return ERROR_COMMAND_SYNTAX_ERROR;
+ }
+
+ return handle_bp_command_set(cmd_ctx, addr, length, hw);
}
static int handle_rbp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
|
From: <zw...@ma...> - 2009-06-11 13:43:03
|
Author: zwelch
Date: 2009-06-11 13:43:00 +0200 (Thu, 11 Jun 2009)
New Revision: 2195
Modified:
trunk/src/target/target.c
Log:
Factor target_timer_callbacks_check_time into pieces:
- Add target_timer_callback_periodic_restart and target_call_timer_callback.
- Clean up and simplify logic that determines whether to call each callback.
- Move variable declarations to location of first use.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 11:42:54 UTC (rev 2194)
+++ trunk/src/target/target.c 2009-06-11 11:43:00 UTC (rev 2195)
@@ -821,46 +821,56 @@
return ERROR_OK;
}
+static int target_timer_callback_periodic_restart(
+ target_timer_callback_t *cb, struct timeval *now)
+{
+ int time_ms = cb->time_ms;
+ cb->when.tv_usec = now->tv_usec + (time_ms % 1000) * 1000;
+ time_ms -= (time_ms % 1000);
+ cb->when.tv_sec = now->tv_sec + time_ms / 1000;
+ if (cb->when.tv_usec > 1000000)
+ {
+ cb->when.tv_usec = cb->when.tv_usec - 1000000;
+ cb->when.tv_sec += 1;
+ }
+ return ERROR_OK;
+}
+
+static int target_call_timer_callback(target_timer_callback_t *cb,
+ struct timeval *now)
+{
+ cb->callback(cb->priv);
+
+ if (cb->periodic)
+ return target_timer_callback_periodic_restart(cb, now);
+
+ return target_unregister_timer_callback(cb->callback, cb->priv);
+}
+
static int target_call_timer_callbacks_check_time(int checktime)
{
- target_timer_callback_t *callback = target_timer_callbacks;
- target_timer_callback_t *next_callback;
- struct timeval now;
-
keep_alive();
+ struct timeval now;
gettimeofday(&now, NULL);
+ target_timer_callback_t *callback = target_timer_callbacks;
while (callback)
{
- next_callback = callback->next;
+ // cleaning up may unregister and free this callback
+ target_timer_callback_t *next_callback = callback->next;
- if ((!checktime&&callback->periodic)||
- (((now.tv_sec >= callback->when.tv_sec) && (now.tv_usec >= callback->when.tv_usec))
- || (now.tv_sec > callback->when.tv_sec)))
+ bool call_it = callback->callback &&
+ ((!checktime && callback->periodic) ||
+ now.tv_sec > callback->when.tv_sec ||
+ (now.tv_sec == callback->when.tv_sec &&
+ now.tv_usec >= callback->when.tv_usec));
+
+ if (call_it)
{
- if(callback->callback != NULL)
- {
- callback->callback(callback->priv);
- if (callback->periodic)
- {
- int time_ms = callback->time_ms;
- callback->when.tv_usec = now.tv_usec + (time_ms % 1000) * 1000;
- time_ms -= (time_ms % 1000);
- callback->when.tv_sec = now.tv_sec + time_ms / 1000;
- if (callback->when.tv_usec > 1000000)
- {
- callback->when.tv_usec = callback->when.tv_usec - 1000000;
- callback->when.tv_sec += 1;
- }
- }
- else
- {
- int retval;
- if((retval = target_unregister_timer_callback(callback->callback, callback->priv)) != ERROR_OK)
- return retval;
- }
- }
+ int retval = target_call_timer_callback(callback, &now);
+ if (retval != ERROR_OK)
+ return retval;
}
callback = next_callback;
|
|
From: <zw...@ma...> - 2009-06-11 13:42:57
|
Author: zwelch
Date: 2009-06-11 13:42:54 +0200 (Thu, 11 Jun 2009)
New Revision: 2194
Modified:
trunk/src/target/target.c
Log:
Simplify and clean handle_virt2phys_command:
- Add a doxygen block to simplify logic.
- Move declarations to point of first use.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 11:42:47 UTC (rev 2193)
+++ trunk/src/target/target.c 2009-06-11 11:42:54 UTC (rev 2194)
@@ -2575,30 +2575,27 @@
return ERROR_OK;
}
-static int handle_virt2phys_command(command_context_t *cmd_ctx, char *cmd, char **args, int argc)
-{
- int retval;
- target_t *target = get_current_target(cmd_ctx);
- u32 va;
- u32 pa;
+/**
+ * Translate a virtual address to a physical address.
+ *
+ * The low-level target implementation must have logged a detailed error
+ * which is forwarded to telnet/GDB session.
+ */
+static int handle_virt2phys_command(command_context_t *cmd_ctx,
+ char *cmd, char **args, int argc)
+{
if (argc != 1)
- {
return ERROR_COMMAND_SYNTAX_ERROR;
- }
- va = strtoul(args[0], NULL, 0);
- retval = target->type->virt2phys(target, va, &pa);
+ target_t *target = get_current_target(cmd_ctx);
+ u32 va = strtoul(args[0], NULL, 0);
+ u32 pa;
+
+ int retval = target->type->virt2phys(target, va, &pa);
if (retval == ERROR_OK)
- {
command_print(cmd_ctx, "Physical address 0x%08x", pa);
- }
- else
- {
- /* lower levels will have logged a detailed error which is
- * forwarded to telnet/GDB session.
- */
- }
+
return retval;
}
|
|
From: <zw...@ma...> - 2009-06-11 13:42:51
|
Author: zwelch
Date: 2009-06-11 13:42:47 +0200 (Thu, 11 Jun 2009)
New Revision: 2193
Modified:
trunk/src/target/target.c
Log:
Simplify and fix target handle_rwp_command routine:
- Return syntax error unless exactly one argument is passed.
- Move variable declaration to point of first use.
Modified: trunk/src/target/target.c
===================================================================
--- trunk/src/target/target.c 2009-06-11 11:42:40 UTC (rev 2192)
+++ trunk/src/target/target.c 2009-06-11 11:42:47 UTC (rev 2193)
@@ -2566,11 +2566,12 @@
static int handle_rwp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
+ if (argc != 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
target_t *target = get_current_target(cmd_ctx);
+ watchpoint_remove(target, strtoul(args[0], NULL, 0));
- if (argc > 0)
- watchpoint_remove(target, strtoul(args[0], NULL, 0));
-
return ERROR_OK;
}
|