mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-09-19 04:14:34 -04:00
Add (hardware) production tests for the TK-1 and TP-1 (#69)
* ch552 firmware: add ch55x support files directly * Add sdcc compiler to docker image, for building CH552 firmware * Rework production test script * Add menu-based test runner * Rewrite production test flows as lists of individual tests * Add both production flows and manual tests to menu * Switch to using included binaries * production test: Update message format * test_txrx_touchpad: Retry if device communications fail * production test: put all binaries in binaries/ folder * binaries/top.bin: replace broken binary * flash_check: Check for explicit flash IDs * Document most test procedures * Test plan documentation * Sample udev rules * Production test: allow external references to be overridden * Remove outdated descriptions * Correct shebang * Update shebangs to comply with PEP 394 Change the python scripts to call python instead of python3, as this works cross platform. See: https://peps.python.org/pep-0394/#for-python-script-publishers * Move production test to higher-level directory * Clarify production test setup * Move USB C connector test to separate directory Co-authored-by: Michael Cardell Widerkrantz <mc@tillitis.se>
This commit is contained in:
parent
f511a84ab4
commit
072b204d3d
32 changed files with 2345 additions and 430 deletions
49
hw/production_test/touch_stability_test/touch_analyzer.py
Normal file
49
hw/production_test/touch_stability_test/touch_analyzer.py
Normal file
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import struct
|
||||
import argparse
|
||||
|
||||
# parser = argparse.ArgumentParser()
|
||||
# parser.add_argument("port")
|
||||
# args = parser.parse_args()
|
||||
|
||||
class args:
|
||||
port = '/dev/ttyACM1'
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
with open(args.port.replace('/','-'),'r') as f:
|
||||
# Skip the first two lines since they might be corrupted
|
||||
f.readline()
|
||||
f.readline()
|
||||
|
||||
records = 0
|
||||
tx_count_errors = 0
|
||||
touch_count_changes = 0
|
||||
|
||||
[first_time,last_tx_count,last_touch_count] = [int(i) for i in f.readline().split(',')]
|
||||
|
||||
try:
|
||||
while True:
|
||||
[time,tx_count,touch_count] = [int(i) for i in f.readline().split(',')]
|
||||
|
||||
if tx_count != (last_tx_count + 1) % 256:
|
||||
tx_count_errors += 1
|
||||
|
||||
if touch_count != last_touch_count:
|
||||
touch_count_changes +=1
|
||||
print('touch count change', time,touch_count,tx_count)
|
||||
|
||||
last_tx_count = tx_count
|
||||
last_touch_count = touch_count
|
||||
|
||||
records += 1
|
||||
|
||||
except Exception as e:
|
||||
print('tx_count errors:', tx_count_errors,
|
||||
'touch_count_changes:', touch_count_changes,
|
||||
'records:', records)
|
||||
|
||||
time_hours = (time - first_time)/60/60
|
||||
print('run time:{:.1f} hours'.format(time_hours))
|
||||
|
21
hw/production_test/touch_stability_test/touch_recorder.py
Normal file
21
hw/production_test/touch_stability_test/touch_recorder.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import serial
|
||||
import struct
|
||||
import argparse
|
||||
import time
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("port")
|
||||
args = parser.parse_args()
|
||||
|
||||
s = serial.Serial(args.port, 9600)
|
||||
while True:
|
||||
[report_count, touch_count] = struct.unpack('<BB', s.read(2))
|
||||
data = ','.join([str(x) for x in (int(time.time()), report_count, touch_count)])
|
||||
|
||||
print(data)
|
||||
with open(args.port.replace('/','-'),'a') as f:
|
||||
f.write(data)
|
||||
f.write('\n')
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue