Added "load" command for programming without erase/symbol import.
This commit is contained in:
parent
4a9b89a1ee
commit
abc7b61737
8
cmddb.c
8
cmddb.c
|
@ -88,6 +88,14 @@ const struct cmddb_record commands[] = {
|
||||||
"prog <filename>\n"
|
"prog <filename>\n"
|
||||||
" Erase the device and flash the data contained in a binary file.\n"
|
" Erase the device and flash the data contained in a binary file.\n"
|
||||||
" This command also loads symbols from the file, if available.\n"
|
" This command also loads symbols from the file, if available.\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "load",
|
||||||
|
.func = cmd_load,
|
||||||
|
.help =
|
||||||
|
"load <filename>\n"
|
||||||
|
" Flash the data contained in a binary file. Does not load symbols\n"
|
||||||
|
" or erase the device.\n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = "md",
|
.name = "md",
|
||||||
|
|
16
devcmd.c
16
devcmd.c
|
@ -457,7 +457,7 @@ static int cmd_prog_feed(void *user_data, address_t addr,
|
||||||
return prog_feed((struct prog_data *)user_data, addr, data, len);
|
return prog_feed((struct prog_data *)user_data, addr, data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmd_prog(char **arg)
|
static int do_cmd_prog(char **arg, int prog_flags)
|
||||||
{
|
{
|
||||||
FILE *in;
|
FILE *in;
|
||||||
struct prog_data prog;
|
struct prog_data prog;
|
||||||
|
@ -476,14 +476,14 @@ int cmd_prog(char **arg)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
prog_init(&prog, PROG_WANT_ERASE);
|
prog_init(&prog, prog_flags);
|
||||||
|
|
||||||
if (binfile_extract(in, cmd_prog_feed, &prog) < 0) {
|
if (binfile_extract(in, cmd_prog_feed, &prog) < 0) {
|
||||||
fclose(in);
|
fclose(in);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (binfile_info(in) & BINFILE_HAS_SYMS) {
|
if (prog_flags && (binfile_info(in) & BINFILE_HAS_SYMS)) {
|
||||||
stab_clear(stab_default);
|
stab_clear(stab_default);
|
||||||
binfile_syms(in, stab_default);
|
binfile_syms(in, stab_default);
|
||||||
}
|
}
|
||||||
|
@ -502,6 +502,16 @@ int cmd_prog(char **arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cmd_prog(char **arg)
|
||||||
|
{
|
||||||
|
return do_cmd_prog(arg, PROG_WANT_ERASE);
|
||||||
|
}
|
||||||
|
|
||||||
|
int cmd_load(char **arg)
|
||||||
|
{
|
||||||
|
return do_cmd_prog(arg, 0);
|
||||||
|
}
|
||||||
|
|
||||||
int cmd_setbreak(char **arg)
|
int cmd_setbreak(char **arg)
|
||||||
{
|
{
|
||||||
char *addr_text = get_arg(arg);
|
char *addr_text = get_arg(arg);
|
||||||
|
|
1
devcmd.h
1
devcmd.h
|
@ -30,6 +30,7 @@ int cmd_set(char **arg);
|
||||||
int cmd_dis(char **arg);
|
int cmd_dis(char **arg);
|
||||||
int cmd_hexout(char **arg);
|
int cmd_hexout(char **arg);
|
||||||
int cmd_prog(char **arg);
|
int cmd_prog(char **arg);
|
||||||
|
int cmd_load(char **arg);
|
||||||
int cmd_setbreak(char **arg);
|
int cmd_setbreak(char **arg);
|
||||||
int cmd_delbreak(char **arg);
|
int cmd_delbreak(char **arg);
|
||||||
int cmd_break(char **arg);
|
int cmd_break(char **arg);
|
||||||
|
|
16
mspdebug.man
16
mspdebug.man
|
@ -246,6 +246,12 @@ Register-indirect mode with auto-increment.
|
||||||
.IP "\fB#\fR"
|
.IP "\fB#\fR"
|
||||||
Immediate mode.
|
Immediate mode.
|
||||||
.RE
|
.RE
|
||||||
|
.IP "\fBload\fR \fIfilename\fR"
|
||||||
|
Program the device under test using the binary file supplied. This
|
||||||
|
command is like \fBprog\fR, but it does not load symbols or erase
|
||||||
|
the device before programming.
|
||||||
|
|
||||||
|
The CPU is reset and halted before and after programming.
|
||||||
.IP "\fBmd\fR \fIaddress\fR [\fIlength\fR]"
|
.IP "\fBmd\fR \fIaddress\fR [\fIlength\fR]"
|
||||||
Read the specified section of device memory and display it as a
|
Read the specified section of device memory and display it as a
|
||||||
canonical\-style hexdump. Both arguments may be address expressions. If
|
canonical\-style hexdump. Both arguments may be address expressions. If
|
||||||
|
@ -275,12 +281,12 @@ With just an option name as its argument, it displays the current value
|
||||||
of that option.
|
of that option.
|
||||||
.IP "\fBprog\fR \fIfilename\fR"
|
.IP "\fBprog\fR \fIfilename\fR"
|
||||||
Erase and reprogram the device under test using the binary file
|
Erase and reprogram the device under test using the binary file
|
||||||
supplied. The file format will be auto-detected and may be either
|
supplied. The file format will be auto-detected and may be any of
|
||||||
Intel HEX or ELF32.
|
the supported file formats.
|
||||||
|
|
||||||
In the case of an ELF32 file, symbols will be automatically loaded
|
In the case of a file containing symbols, symbols will be automatically
|
||||||
from the file into the symbol table (discarding any existing symbols),
|
loaded from the file into the symbol table (discarding any existing
|
||||||
if they are present.
|
symbols), if they are present.
|
||||||
|
|
||||||
The CPU is reset and halted before and after programming.
|
The CPU is reset and halted before and after programming.
|
||||||
.IP "\fBread\fR \fIfilename\fR"
|
.IP "\fBread\fR \fIfilename\fR"
|
||||||
|
|
Loading…
Reference in New Issue