r4815 - in developers/werner: . wlan-resume
werner at docs.openmoko.org
werner at docs.openmoko.org
Sat Nov 22 04:55:50 CET 2008
Author: werner
Date: 2008-11-22 04:55:49 +0100 (Sat, 22 Nov 2008)
New Revision: 4815
Added:
developers/werner/wlan-resume/
developers/werner/wlan-resume/trigger
developers/werner/wlan-resume/vds.py
Log:
Backup my WLAN resume debugging environment.
Added: developers/werner/wlan-resume/trigger
===================================================================
--- developers/werner/wlan-resume/trigger (rev 0)
+++ developers/werner/wlan-resume/trigger 2008-11-22 03:55:49 UTC (rev 4815)
@@ -0,0 +1,5 @@
+#!/bin/sh
+rmmod s3cmci.ko
+echo 0 >/sys/bus/platform/drivers/gta02-pm-wlan/gta02-pm-wlan.0/power_on
+echo 1 >/sys/bus/platform/drivers/gta02-pm-wlan/gta02-pm-wlan.0/power_on
+insmod s3cmci.ko trigger=$1
Property changes on: developers/werner/wlan-resume/trigger
___________________________________________________________________
Name: svn:executable
+ *
Added: developers/werner/wlan-resume/vds.py
===================================================================
--- developers/werner/wlan-resume/vds.py (rev 0)
+++ developers/werner/wlan-resume/vds.py 2008-11-22 03:55:49 UTC (rev 4815)
@@ -0,0 +1,102 @@
+#!/usr/bin/python
+
+from tmc.scope import *
+from tmc.trigger import *
+import os, time
+
+#
+# In a typical session, 176-181 command are sent. We set the limit to 175, so
+# that we don't hang in a short session. In case this happens anyway, just
+# restarting the device will fix the problem, as long as the limit is within a
+# session length that occurs reasonably often.
+#
+
+n = 5
+start = 0
+
+s = rigol_ds1000c()
+s.debug = False
+
+#
+# Sample window (-1ms, +1ms) around trigger at 100MSa/s or better.
+#
+#s.window(100e6, -1e-3, 1e-3)
+# -20ms,+20ms at 10MSa/s
+
+s.window(2e6, -20e-3, 80e-3)
+
+ch = s.ch[0]
+ch.pos = 1.5
+ch.scale = 0.5
+
+edge(slope = slope.Rising, level = 1.5).source(ch)
+
+s.hor.sweep = sweep.Single
+s.hor.stop()
+
+
+def system(cmd):
+ ret = os.system(cmd)
+ print cmd, "->", "%x" % ret
+ while ret & 0xff:
+ pass
+
+
+def neo(cmd):
+ system("ssh -q lab "+
+ "/home/moko/svn.openmoko.org/developers/werner/bin/neo -q "+
+ cmd)
+
+
+for i in range(0, n):
+ # pseudo-randomize the trigger time to that we collect samples from a wider
+ # range more quickly
+ tr = start+(i*41) % n
+
+ for rep in range(0, 1):
+ id = "%03d-%d" % (tr, rep)
+
+ print "Round", id
+
+ # reset trigger
+ neo("gpio f6=zr")
+
+ # start scope
+ s.hor.run()
+
+ # load the module and set the trigger
+ neo("./trigger "+str(tr))
+
+# # set the next trigger time (see the script "trigger" for details)
+# neo("./trigger "+str(tr))
+#
+# # hard reset the device
+# neo("dbgrst")
+
+ print "Waiting for trigger ..."
+
+ # wait for trigger
+ while s.hor.state() != state.Stop:
+ time.sleep(1)
+
+ print "Downloading ..."
+
+ # grab the transmission(s) - a bit before the message and a lot after
+ t0 = time.time()
+# w = s.wave([1, 2, 3, 4, 5, 6], start = -0.1e-3, end = 2e-3)
+ w = s.wave([1, 2, 3, 4, 5, 6], start = -20e-3, end = 80e-3)
+ t1 = time.time()
+ w.save("sdio-"+id)
+ t2 = time.time()
+# print t0, t1, t2
+ print "download", t1-t0, "save", t2-t1
+
+ # Give the system time to finish booting
+ # -- no need. now that we're really operating at 100MSa/s, the download
+ # takes long enough
+ print "Saved", i, tr, rep
+# time.sleep(60)
+# print "AWAKE"
+
+ # record the kernel messages as well
+ neo("dmesg -s 2000000 >dmesg-"+id)
Property changes on: developers/werner/wlan-resume/vds.py
___________________________________________________________________
Name: svn:executable
+ *
More information about the commitlog
mailing list