summaryrefslogtreecommitdiff
path: root/ao-tools/ao-rawload
diff options
context:
space:
mode:
Diffstat (limited to 'ao-tools/ao-rawload')
-rw-r--r--ao-tools/ao-rawload/ao-rawload.126
-rw-r--r--ao-tools/ao-rawload/ao-rawload.c11
2 files changed, 34 insertions, 3 deletions
diff --git a/ao-tools/ao-rawload/ao-rawload.1 b/ao-tools/ao-rawload/ao-rawload.1
index e79645f1..6b6a6e2c 100644
--- a/ao-tools/ao-rawload/ao-rawload.1
+++ b/ao-tools/ao-rawload/ao-rawload.1
@@ -21,12 +21,36 @@
ao-rawload \- flash a program to a AltOS device
.SH SYNOPSIS
.B "ao-rawload"
-[\-tty \fItty-device\fP]
+[\-T \fItty-device\fP]
+[\--tty \fItty-device\fP]
+[\-D \fIaltos-device\fP]
+[\--device \fIaltos-device\fP]
\fIfile.ihx\fP
.SH DESCRIPTION
.I ao-rawload
loads the specified .ihx file, without modification, into the target
device flash memory.
+.SH OPTIONS
+.TP
+\-T tty-device | --tty tty-device
+This selects which tty device the debugger uses to communicate with
+the target device. The special name 'BITBANG' directs ao-dbg to use
+the cp2103 connection, otherwise this should be a usb serial port
+connected to a suitable cc1111 debug node.
+.TP
+\-D AltOS-device | --device AltOS-device
+Search for a connected device. This requires an argument of one of the
+following forms:
+.IP
+TeleMetrum:2
+.br
+TeleMetrum
+.br
+2
+.IP
+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.
.SH USAGE
.I ao-rawload
reads the specified .ihx file into memory. It then connects to the
diff --git a/ao-tools/ao-rawload/ao-rawload.c b/ao-tools/ao-rawload/ao-rawload.c
index 1f1537b9..255f63ec 100644
--- a/ao-tools/ao-rawload/ao-rawload.c
+++ b/ao-tools/ao-rawload/ao-rawload.c
@@ -22,12 +22,13 @@
static const struct option options[] = {
{ .name = "tty", .has_arg = 1, .val = 'T' },
+ { .name = "device", .has_arg = 1, .val = 'D' },
{ 0, 0, 0, 0},
};
static void usage(char *program)
{
- fprintf(stderr, "usage: %s [--tty <tty-name>] file.ihx\n", program);
+ fprintf(stderr, "usage: %s [--tty <tty-name>] [--device <device-name>] file.ihx\n", program);
exit(1);
}
@@ -42,13 +43,17 @@ main (int argc, char **argv)
char *filename;
FILE *file;
char *tty = NULL;
+ char *device = NULL;
int c;
- while ((c = getopt_long(argc, argv, "T:", options, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "T:D:", options, NULL)) != -1) {
switch (c) {
case 'T':
tty = optarg;
break;
+ case 'D':
+ device = optarg;
+ break;
default:
usage(argv[0]);
break;
@@ -75,6 +80,8 @@ main (int argc, char **argv)
}
ccdbg_hex_file_free(hex);
+ if (!tty)
+ tty = cc_usbdevs_find_by_arg(device, "TIDongle");
dbg = ccdbg_open(tty);
if (!dbg)
exit (1);