From 941ff7053bb45a75e3c37f1100811a585894cd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Mon, 7 Aug 2017 02:46:10 +0200 Subject: [PATCH] Add scripts to print and log I2C hangs. --- usb/log-i2c-hangs.sh | 3 +++ usb/print-i2c-hangs.sh | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100755 usb/log-i2c-hangs.sh create mode 100755 usb/print-i2c-hangs.sh diff --git a/usb/log-i2c-hangs.sh b/usb/log-i2c-hangs.sh new file mode 100755 index 00000000..b1ffa4e8 --- /dev/null +++ b/usb/log-i2c-hangs.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./print-i2c-hangs.sh > i2c-hangs-`date +%Y-%m-%d_%H:%M:%S`.log diff --git a/usb/print-i2c-hangs.sh b/usb/print-i2c-hangs.sh new file mode 100755 index 00000000..93863001 --- /dev/null +++ b/usb/print-i2c-hangs.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +while true; do + startSeconds=`date +%s` + ./wait-until-i2c-dies.js + endSeconds=`date +%s` + elapsedSeconds=$((startSeconds-endSeconds)) + echo $elapsedSeconds + ./jump-to-bootloader.js > /dev/null + sleep 6 +done