From 5d7a3a5fbc0af4621c67a6fd51a9c9d5ae688fa5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 25 Feb 2010 16:40:13 -0800 Subject: [PATCH] Fix and document the ao-rawload --run flag This allows ram-based programs to be loaded and executed easily. Signed-off-by: Keith Packard --- ao-tools/ao-rawload/ao-rawload.1 | 9 +++++++-- ao-tools/ao-rawload/ao-rawload.c | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) 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"); -- 2.30.2