Fix and document the ao-rawload --run flag
authorKeith Packard <keithp@keithp.com>
Fri, 26 Feb 2010 00:40:13 +0000 (16:40 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 26 Feb 2010 00:40:13 +0000 (16:40 -0800)
This allows ram-based programs to be loaded and executed easily.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/ao-rawload/ao-rawload.1
ao-tools/ao-rawload/ao-rawload.c

index 6b6a6e2c7097bd9faac5e8e36ae0056a993eabfa..30d0467d6255e6f287c0183da8a6ce56e89e5cea 100644 (file)
@@ -29,7 +29,7 @@ ao-rawload \- flash a program to a AltOS device
 .SH DESCRIPTION
 .I ao-rawload
 loads the specified .ihx file, without modification, into the target
-device flash memory.
+device flash or ram (depending on the base address of the .ihx file).
 .SH OPTIONS
 .TP
 \-T tty-device | --tty tty-device
@@ -51,10 +51,15 @@ TeleMetrum
 Leaving out the product name will cause the tool to select a suitable
 product, leaving out the serial number will cause the tool to match
 one of the available devices.
+.TP
+\-r | --run
+After the file has been loaded, set the PC to the base address of the
+image and resume execution there.
+the .ihx file.
 .SH USAGE
 .I ao-rawload
 reads the specified .ihx file into memory. It then connects to the
 specified target device and writes the program to the target device
-flash memory.
+memory and, optionally, starts the program executing.
 .SH AUTHOR
 Keith Packard
index 0098b6589c8e9294e9bbda642d13bc20b03809af..a4746b195411ac8d73bb237774f12cea3020b808 100644 (file)
@@ -49,7 +49,7 @@ main (int argc, char **argv)
        int             c;
        int             run = 0;
 
-       while ((c = getopt_long(argc, argv, "T:D:", options, NULL)) != -1) {
+       while ((c = getopt_long(argc, argv, "rT:D:", options, NULL)) != -1) {
                switch (c) {
                case 'T':
                        tty = optarg;
@@ -67,7 +67,7 @@ main (int argc, char **argv)
        }
        filename = argv[optind];
        if (filename == NULL) {
-               fprintf(stderr, "usage: %s <filename.ihx>\n", argv[0]);
+               usage(argv[0]);
                exit(1);
        }
        file = fopen(filename, "r");