diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-03-01 20:56:18 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-03-01 20:56:18 +0000 |
commit | 2e8f1911d68bdc3035f392f93fdc9e14a3136e72 (patch) | |
tree | 8043a3f30e46da9ae71918cc5151ce1fd5a13dd0 /src/flash | |
parent | 857e9cb076a480108ea312ca00eaaac1d6fffb4d (diff) | |
download | riscv-openocd-2e8f1911d68bdc3035f392f93fdc9e14a3136e72.zip riscv-openocd-2e8f1911d68bdc3035f392f93fdc9e14a3136e72.tar.gz riscv-openocd-2e8f1911d68bdc3035f392f93fdc9e14a3136e72.tar.bz2 |
Nicolas Pitre nico at cam.org don't ignore bad options passed to the "nand write" command
git-svn-id: svn://svn.berlios.de/openocd/trunk@1386 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/nand.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/flash/nand.c b/src/flash/nand.c index c42291b..8708ef3 100644 --- a/src/flash/nand.c +++ b/src/flash/nand.c @@ -287,7 +287,7 @@ int nand_init(struct command_context_s *cmd_ctx) register_command(cmd_ctx, nand_cmd, "dump", handle_nand_dump_command, COMMAND_EXEC, "dump from NAND flash device <num> <filename> <offset> <size> [options]"); register_command(cmd_ctx, nand_cmd, "write", handle_nand_write_command, COMMAND_EXEC, - "write to NAND flash device <num> <filename> <offset> [options]"); + "write to NAND flash device <num> <filename> <offset> [oob_raw|oob_only]"); register_command(cmd_ctx, nand_cmd, "raw_access", handle_nand_raw_access_command, COMMAND_EXEC, "raw access to NAND flash device <num> ['enable'|'disable']"); } @@ -1254,7 +1254,6 @@ int handle_nand_write_command(struct command_context_s *cmd_ctx, char *cmd, char u8 *oob = NULL; u32 oob_size = 0; - duration_start_measure(&duration); offset = strtoul(args[2], NULL, 0); if (argc > 3) @@ -1269,10 +1268,13 @@ int handle_nand_write_command(struct command_context_s *cmd_ctx, char *cmd, char else { command_print(cmd_ctx, "unknown option: %s", args[i]); + return ERROR_COMMAND_SYNTAX_ERROR; } } } + duration_start_measure(&duration); + if (fileio_open(&fileio, args[1], FILEIO_READ, FILEIO_BINARY) != ERROR_OK) { return ERROR_OK; |