From 9f7d860e9c5afead1c8d44450ac05e59a47fe889 Mon Sep 17 00:00:00 2001 From: maralvira Date: Sun, 7 Nov 2010 14:11:18 +0000 Subject: [PATCH] add scripts to help load a bunch of econotags --- cpu/mc1322x/tools/test-grid/erase-all.pl | 17 ++++++++ cpu/mc1322x/tools/test-grid/load-all.pl | 18 +++++++++ cpu/mc1322x/tools/test-grid/open-terms.pl | 49 +++++++++++++++++++++++ cpu/mc1322x/tools/test-grid/reset-all.pl | 17 ++++++++ 4 files changed, 101 insertions(+) create mode 100755 cpu/mc1322x/tools/test-grid/erase-all.pl create mode 100755 cpu/mc1322x/tools/test-grid/load-all.pl create mode 100755 cpu/mc1322x/tools/test-grid/open-terms.pl create mode 100755 cpu/mc1322x/tools/test-grid/reset-all.pl diff --git a/cpu/mc1322x/tools/test-grid/erase-all.pl b/cpu/mc1322x/tools/test-grid/erase-all.pl new file mode 100755 index 000000000..634c94b1a --- /dev/null +++ b/cpu/mc1322x/tools/test-grid/erase-all.pl @@ -0,0 +1,17 @@ +#!/usr/bin/perl +use strict; + +my $terms = shift; + +if (! $terms) { + print "Usage: num-devices\n"; + die; +} + +for (my $t=0; $t<$terms; $t++) { + my $dev_num = 2 * $t + 1; + my $ftdi_num = $terms - $t - 1; + my $cmd = "bbmc -l redbee-econotag -i $ftdi_num erase &"; + print "$cmd\n"; + system($cmd); +} diff --git a/cpu/mc1322x/tools/test-grid/load-all.pl b/cpu/mc1322x/tools/test-grid/load-all.pl new file mode 100755 index 000000000..d01ed1c08 --- /dev/null +++ b/cpu/mc1322x/tools/test-grid/load-all.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl +use strict; + +my $bin = shift; +my $terms = shift; + +if (! $terms) { + print "Usage: $0 file.bin num-devices\n"; + die; +} + +for (my $t=0; $t<$terms; $t++) { + my $dev_num = 2 * $t + 1; + my $ftdi_num = $terms - $t - 1; + my $cmd = "mc1322x-load.pl -e -f $bin -t /dev/ttyUSB$dev_num -c 'bbmc -l redbee-econotag -i $ftdi_num reset' &"; + print "$cmd\n"; + system($cmd); +} diff --git a/cpu/mc1322x/tools/test-grid/open-terms.pl b/cpu/mc1322x/tools/test-grid/open-terms.pl new file mode 100755 index 000000000..28718f22d --- /dev/null +++ b/cpu/mc1322x/tools/test-grid/open-terms.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl + +use strict; +use integer; + +my $start = shift; +my $end = shift; + +if (! $end) { + print "Usage: $0 first-term-num last-term-num\n"; + die; +} + +my $COLS = 4; + +my $index = 0; + +for (my $n=$start; $n <= $end; $n += 2) { + #print "$n\n"; + + open(OUT, ">/tmp/USB$n.ini"); + my $dev = "/dev/ttyUSB$n"; +print OUT <