* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
#include "image.h"
#include "rtos/rtos.h"
+/* default halt wait timeout (ms) */
+#define DEFAULT_HALT_TIMEOUT 5000
+
static int target_read_buffer_default(struct target *target, uint32_t address,
uint32_t size, uint8_t *buffer);
static int target_write_buffer_default(struct target *target, uint32_t address,
extern struct target_type xscale_target;
extern struct target_type cortexm3_target;
extern struct target_type cortexa8_target;
+extern struct target_type cortexr4_target;
extern struct target_type arm11_target;
extern struct target_type mips_m4k_target;
extern struct target_type avr_target;
extern struct target_type testee_target;
extern struct target_type avr32_ap7k_target;
extern struct target_type hla_target;
+extern struct target_type nds32_v2_target;
+extern struct target_type nds32_v3_target;
+extern struct target_type nds32_v3m_target;
static struct target_type *target_types[] = {
&arm7tdmi_target,
&xscale_target,
&cortexm3_target,
&cortexa8_target,
+ &cortexr4_target,
&arm11_target,
&mips_m4k_target,
&avr_target,
&testee_target,
&avr32_ap7k_target,
&hla_target,
+ &nds32_v2_target,
+ &nds32_v3_target,
+ &nds32_v3m_target,
NULL,
};
target->halt_issued = false;
else {
long long t = timeval_ms() - target->halt_issued_time;
- if (t > 1000) {
+ if (t > DEFAULT_HALT_TIMEOUT) {
target->halt_issued = false;
LOG_INFO("Halt timed out, wake up GDB.");
target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);
return target->type->write_phys_memory(target, address, size, count, buffer);
}
-int target_bulk_write_memory(struct target *target,
+static int target_bulk_write_memory_default(struct target *target,
uint32_t address, uint32_t count, const uint8_t *buffer)
{
- return target->type->bulk_write_memory(target, address, count, buffer);
+ return target_write_memory(target, address, 4, count, buffer);
}
int target_add_breakpoint(struct target *target,
if (target->type->write_buffer == NULL)
target->type->write_buffer = target_write_buffer_default;
+ if (target->type->bulk_write_memory == NULL)
+ target->type->bulk_write_memory = target_bulk_write_memory_default;
+
return ERROR_OK;
}
if (CMD_ARGC > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
- unsigned ms = 5000;
+ unsigned ms = DEFAULT_HALT_TIMEOUT;
if (1 == CMD_ARGC) {
int retval = parse_uint(CMD_ARGV[0], &ms);
if (ERROR_OK != retval)
return ERROR_COMMAND_SYNTAX_ERROR;
- /* convert seconds (given) to milliseconds (needed) */
- ms *= 1000;
}
struct target *target = get_current_target(CMD_CTX);
}
/* now - create the new target name command */
- const const struct command_registration target_subcommands[] = {
+ const struct command_registration target_subcommands[] = {
{
.chain = target_instance_command_handlers,
},
},
COMMAND_REGISTRATION_DONE
};
- const const struct command_registration target_commands[] = {
+ const struct command_registration target_commands[] = {
{
.name = cp,
.mode = COMMAND_ANY,
.handler = handle_wait_halt_command,
.mode = COMMAND_EXEC,
.help = "wait up to the specified number of milliseconds "
- "(default 5) for a previously requested halt",
+ "(default 5000) for a previously requested halt",
.usage = "[milliseconds]",
},
{
.handler = handle_halt_command,
.mode = COMMAND_EXEC,
.help = "request target to halt, then wait up to the specified"
- "number of milliseconds (default 5) for it to complete",
+ "number of milliseconds (default 5000) for it to complete",
.usage = "[milliseconds]",
},
{