From: Keith Packard Date: Fri, 26 Feb 2010 00:40:13 +0000 (-0800) Subject: Fix and document the ao-rawload --run flag X-Git-Tag: debian/0.6+106+ga1478f6~7 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=5d7a3a5fbc0af4621c67a6fd51a9c9d5ae688fa5 Fix and document the ao-rawload --run flag This allows ram-based programs to be loaded and executed easily. Signed-off-by: Keith Packard --- diff --git a/ao-tools/ao-rawload/ao-rawload.1 b/ao-tools/ao-rawload/ao-rawload.1 index 6b6a6e2c..30d0467d 100644 --- a/ao-tools/ao-rawload/ao-rawload.1 +++ b/ao-tools/ao-rawload/ao-rawload.1 @@ -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 diff --git a/ao-tools/ao-rawload/ao-rawload.c b/ao-tools/ao-rawload/ao-rawload.c index 0098b658..a4746b19 100644 --- a/ao-tools/ao-rawload/ao-rawload.c +++ b/ao-tools/ao-rawload/ao-rawload.c @@ -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 \n", argv[0]); + usage(argv[0]); exit(1); } file = fopen(filename, "r");