diff --git a/src/target/target.c b/src/target/target.c index df84032..fb17aca 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -29,13 +29,15 @@ target *target_list = NULL; #define STDOUT_READ_BUF_SIZE 64 -static int target_flash_write_buffered(struct target_flash *f, - target_addr dest, const void *src, size_t len); +static int target_flash_write_buffered(struct target_flash *f, target_addr dest, const void *src, size_t len); static int target_flash_done_buffered(struct target_flash *f); + static bool target_cmd_mass_erase(target *t, int argc, const char **argv); +static bool target_cmd_range_erase(target *t, int argc, const char **argv); const struct command_s target_cmd_list[] = { {"erase_mass", (cmd_handler)target_cmd_mass_erase, "Erase whole device Flash"}, + {"erase_range", (cmd_handler)target_cmd_range_erase, "Erase a range of memory on a device"}, {NULL, NULL, NULL} }; @@ -539,6 +541,28 @@ static bool target_cmd_mass_erase(target *const t, const int argc, const char ** return result; } +static bool target_cmd_range_erase(target *const t, const int argc, const char **const argv) +{ + if (argc < 3) { + gdb_out("usage: monitor erase_range