From 251a749515197a200b977470d9c5c8099c47c9f6 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 19 May 2011 16:45:22 -0300 Subject: [PATCH] prod/: cleaned up atben clock frequency test - prod/Common (begin), prod/atben: added clock reference file argument - prod/atben (xtal_ben): use atrf-xtal options -b and -p to determine whether the clock frequency is correct --- prod/Common | 9 ++++++++- prod/atben | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/prod/Common b/prod/Common index 2afa9b9..6782456 100644 --- a/prod/Common +++ b/prod/Common @@ -114,7 +114,7 @@ expect_re() begin() { if [ -z "$1" ]; then - echo "usage: begin profile" 1>&2 + echo "usage: begin profile [clock-ref]" 1>&2 exit 1 fi PROFILE=$1 @@ -122,6 +122,13 @@ begin() echo "$PROFILE not found" 1>&2 exit 1 fi + if [ "$2" ]; then + CLKREF=$2 + if ! $LOCAL_EXEC "[ -r $CLKREF ]"; then + echo "$CLKREF not found" 1>&2 + exit 1 + fi + fi } diff --git a/prod/atben b/prod/atben index b2d9f5e..ae440d1 100755 --- a/prod/atben +++ b/prod/atben @@ -13,12 +13,12 @@ gpio_ben() xtal_ben() { step "Crystal frequency" - cmd "$LOCAL_EXEC atrf-xtal -d $LOCAL_DUT 100" - expect_re '4350[012]\.' # @@@ very crude ... + cmd "$LOCAL_EXEC atrf-xtal -d $LOCAL_DUT -b \\\`cat $CLKREF\\\` -p 50 100" + expect_re ppm # we catch any problems via the exit code } -begin ben.profile +begin ben.profile ben.xtal # power ? gpio_ben identify