summaryrefslogtreecommitdiff
path: root/extra/tigertool
Commit message (Collapse)AuthorAgeFilesLines
* pylintrc: Copy Chromium OS platform2's configCraig Hesling2021-08-027-0/+28
| | | | | | | | | | | | | | | | | | | | This requests that cros lint (and repo upload hook) use the new Chromium OS 4 space indent policy. Since legacy python scripts still use 2 space, I added pylint ignore statements to the individual files to disable indentation checking. Note: There are still valid pylint errors in some of these legacy scripts. BRANCH=none BUG=none TEST=cros lint util/*.py Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I439f5a87bc50f1f43a4996e574bbc0626922a88e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3064761 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* docs: Run mdformat on all .md filesTom Hughes2021-01-281-10/+20
| | | | | | | | | | | BRANCH=none BUG=b:178648877 TEST=view in gitiles Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I0ac5581ba7bc512234d40dbf34222422afa9c725 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2650551 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* servo_updater: make more robust on resetsRuben Rodriguez Buchillon2020-12-101-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | long-term, we need to pull this into hdctools, rather than reimplement everything twice. Short term, this is a fine solution. It essentially makes sure that 1. we only keep one pty/stm32uart/stm32usb object around for communication 2. we always reset it properly when it could need a reset e.g. when the stm32 is rebooting, or a new firmware was flashed 3. it expands the timeout for the chip to come back to 2s the tiny_servod will eventually also land in hdctools, though for now it just ensures that we can reset the pyusb communication without larger issues and a larger refactor. BUG=chromium:1152838 BRANCH=None // Timeout before change, runs after change TEST=sudo servo_updater --board servo_micro // Timeout before change, runs after change TEST=sudo servo_updater --board sweetberry // Timeout before change, runs after change TEST=sudo servo_updater --board servo_micro --force // to show the serialname support. This is a fake serial, and it gets stuck waiting TEST=sudo servo_updater -s MICRO-S-2009020022 --board servo_micro // to show the serialname support. This is a real serial and it proceeds TEST=sudo servo_updater -s MICRO-S-2009020022 --board servo_micro Change-Id: I747ca69881c13c1aadd8e90a35badecbf4e6a09e Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2580854 Reviewed-by: Otabek Kasimov <otabek@google.com> Reviewed-by: Garry Wang <xianuowang@chromium.org>
* stm32uart: add delay after readingRuben Rodriguez Buchillon2020-12-091-0/+3
| | | | | | | | | | | | | | | | | This implementation of the uart reading code lacks the fix inside hdctools that adds a delay here. Amend the code. BUG=chromium:1152838 BRANCH=None TEST=sudo servo_updater --board servo_micro TEST=sudo servo_updater --board sweetberry TEST=sudo servo_updater --board servo_micro --force Change-Id: I28f62f4553c726f1e63c7404508a5e59ce098990 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2580853 Reviewed-by: Garry Wang <xianuowang@chromium.org> Reviewed-by: Otabek Kasimov <otabek@google.com>
* servo_updater: Add timeout on the pty flushBrian J. Nemec2020-10-211-2/+8
| | | | | | | | | | | | | | | | | | | If the servo is in a loop where it sends output on a continuous basis, the flush operation needs to eventually timeout. If the servo sends commands out faster than the timeout provided to the expects() call, it would never advance. This blocked the servo_updater from advancing. BUG=b:162628581 TEST=Connect Servo_v4p1 to DUT validate servo_updater works TEST=Modify Servo firmware to generate many console messages in a loop. Validate that the flush operation succeeds and servo updater still works. Change-Id: I8c0e65a0733b4d4ee25a9f9c866aa2b863cb0e5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2487256 Reviewed-by: Matthew Blecker <matthewb@chromium.org> Tested-by: Brian Nemec <bnemec@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* tigertool: Migrate tigertool.py to python2/3 compatibleYilin Yang2020-09-291-2/+4
| | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=None Signed-off-by: kerker <kerker@chromium.org> Change-Id: I50b9aa6724bc6d9db5c7f743909d81c0b2dfc849 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2431319 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ecusb: Fix subprocess argument to make it py2/3 compatibleYilin Yang2020-09-261-2/+12
| | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=None Signed-off-by: kerker <kerker@chromium.org> Change-Id: I78713f635e00cf01e1df641436b3a6d2f5c3c00b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2431318 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* usb_updater: Migrate servo_updater.py to python2/3 compatibleYilin Yang2020-09-263-5/+11
| | | | | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=`sudo python3 ./extra/usb_updater/servo_updater.py -b servo_v4 --force` shows "update complete". TEST=`sudo python2 ./extra/usb_updater/servo_updater.py -b servo_v4 --force` shows "update complete". Signed-off-by: kerker <kerker@chromium.org> Change-Id: I632203b9eca4aa99dc63063c37f0ab5fc2e54dbb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2425784 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* tigertool: fix regexNick Sanders2020-01-181-1/+1
| | | | | | | | | | | | | | Change $ to \s in regex. BUG=None (tigertail serserialno fail TEST=./tigertool.py --setserialno test BRANCH=none Change-Id: I006ff8e70b3d20be44590c2050f9e341f10a2d53 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2008450 Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Unify #! use in python scriptsStefan Reinauer2019-10-011-1/+1
| | | | | | | | | | | | | | | | | | Right now we have several different versions of #! in our python scripts. Unify them all and specify that we are using python2. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> BUG=none BRANCH=none TEST=make buildall Change-Id: Iab33a3f5d4b827451a55542bcee8837b00da7867 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1817948 Commit-Queue: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ec-devutils: restore servo_updater functionalityKevin Shelton2019-06-052-0/+6
| | | | | | | | | | | | | | | | | | Adds back and uses the close method that was defined in change 1125354. BRANCH=None BUG=chromium:968700 TEST=ran servo updater on a servo that needed an update (so that the version check was exercised twice). Signed-off-by: Kevin Shelton <kmshelton@chromium.org> Change-Id: I0ddce9749a3548d5019c138a2a2266fd93a85ca9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1643658 Tested-by: Kevin Shelton <kmshelton@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org> Commit-Queue: Kevin Shelton <kmshelton@chromium.org>
* ec-devutils: update for pyusb-1.0.2Nick Sanders2019-05-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pyusb 1.0.2 changed two API calls upon which we depend: b3ee6cdfef8f find function returns an iterator. dac78933f6a6 Removed unnecessary length argument to util.get_string This CL only updates callers of these APIs (the previous CL contained some unrelated changes around kernel driver detach and closing stm32usb). Signed-off-by: Nick Sanders <nsanders@chromium.org> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Based-on: https://chromium-review.googlesource.com/1125354 BRANCH=None BUG=chromium:958677 TEST=precq passes TEST=chromiumos-sdk tryjob buildbucketId=8915374561970847360 TEST=using servo v2 servod -b grunt => no python exceptions when starting servod TEST=using servo v4 servod -b grunt => no python exceptions when starting servod TEST=using u-Servo: servod -b grunt => no python exceptions when starting servod for i in {1..10000} ; do echo $i $(dut-control ec_uart_en spi1_buf_en ); done => No stability regression versus pyusb-1.0.0b1 TEST=servo_updater, EC console via servo Cq-Depend: chromium:1597548,chromium:1597156,chromium:1597157 Change-Id: Ic8101707838e5d19e901cf1f7125b97b5102f089 Reviewed-on: https://chromium-review.googlesource.com/1597156 Commit-Ready: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Daniel Kurtz <djkurtz@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
* ec-devutils: Fix fdpexpect importDaniel Kurtz2019-05-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | As of pexpect 3.0, the fdexpect module was moved into the pexpect package. Prior to 4.0, a wrapper module was installed along with pexpect, so "import fdexpect" continued to work. In 4.0 this wrapper was removed. Importing fdexpect from pexpect works for our current pexpect 3.3, and will continue to work when we update pexpect to 4.0+. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> BRANCH=none BUG=chromium:958677 TEST=(0) with pexpect 3.3, (1) sudo servod --board=grunt TEST=(0) Uprev pexpect to 4.2.1, (1) sudo servod --board=grunt => servod works in both cases Change-Id: I9d21042713d0cc1826cf55da4af7a16f44b746bb Reviewed-on: https://chromium-review.googlesource.com/1593419 Commit-Ready: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Chris McDonald <cjmcdonald@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org>
* Revert "ec-devutils: update pyusb to 1.0.2"Nick Sanders2018-07-262-17/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7d26ae49bffcf269df82df7d0fee00e8c3341166. pyusb 1.0.2 fails under load and locks up the usb endpoint. BUG=b:111658037, chromium:865482 TEST=while RES=$(dut-control ec_uart_en spi1_buf_en ); do echo ${RES}; done CQ-DEPEND=CL:1149509 Original change's description: > ec-devutils: update pyusb to 1.0.2 > > Pyusb interface has changed yet again. Patch calls to get_string > and usb.core.find. Modify ordering of detetch kernel driver > and avoid rereferencing endpoints. > > BRANCH=None > BUG=b:110907544 > TEST=emerge ec-devutils, run powerlog, usb_console, servo_updater > > CQ-DEPEND=CL:1119632 > > Signed-off-by: Nick Sanders <nsanders@chromium.org> > > Change-Id: I33df474ce3bb57d2e11c9f384ac013b51d210843 > Reviewed-on: https://chromium-review.googlesource.com/1125354 > Commit-Ready: Nick Sanders <nsanders@chromium.org> > Tested-by: Nick Sanders <nsanders@chromium.org> > Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Bug: b:110907544 Change-Id: I04f015b4924e7fee76ab0f1734267e8e2d14faaa Reviewed-on: https://chromium-review.googlesource.com/1150963 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* ec-devutils: update pyusb to 1.0.2Nick Sanders2018-07-062-9/+17
| | | | | | | | | | | | | | | | | | | | Pyusb interface has changed yet again. Patch calls to get_string and usb.core.find. Modify ordering of detetch kernel driver and avoid rereferencing endpoints. BRANCH=None BUG=b:110907544 TEST=emerge ec-devutils, run powerlog, usb_console, servo_updater CQ-DEPEND=CL:1119632 Signed-off-by: Nick Sanders <nsanders@chromium.org> Change-Id: I33df474ce3bb57d2e11c9f384ac013b51d210843 Reviewed-on: https://chromium-review.googlesource.com/1125354 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* servo: add usb updaterNick Sanders2017-10-253-16/+34
| | | | | | | | | | | | | | This updater combines console and firmware update commands to update both RO and RW sections of servo_v4 and servo_micro. BRANCH=None BUG=b:37513705 TEST=updated firmware Change-Id: I9f585c90f5849f8dd7c9d2e08111ffbd5770fd54 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/668156 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* tigertool: add serial number checkNick Sanders2017-09-281-0/+24
| | | | | | | | | | | | | Add --check_serial to check serial number. BRANCH=None BUG=b:35849284 TEST=check serial number. Change-Id: I1e2d5617bcf65e2388b88aca7ed63b9cdc096d87 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/676723 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* tigertool: add power log and versionNick Sanders2017-08-251-1/+104
| | | | | | | | | | | | | | | | --power provides a single sample from the INA --powerlog [n] provides n samples --check_version returns the tigertail's firmware version --bus selects which bus to probe power on [vbus|cc1|cc2] BRANCH=None BUG=b:35849284 TEST=check power readings, version. Change-Id: I728d954b6649fe0401093bf3beb7ec89f27822a6 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/634566 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* tigertool: update pyusb callsNick Sanders2017-05-251-2/+2
| | | | | | | | | | | | | | | Update pyusb calling format to match chroot version. BRANCH=None BUG=b:35849284 TEST=flash, control tigertail successfully Change-Id: I27f34d63c8ddc09c903dcc1da39d18e7dbf15710 Reviewed-on: https://chromium-review.googlesource.com/511668 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* tigertail: tigertool command line apiNick Sanders2017-05-169-0/+1020
This tool allows an easy commandline interface to set the USB-C mux position, as well as init and reboot. BRANCH=None BUG=b:35849284 TEST=flash, control tigertail successfully Change-Id: I8d60c215fee04de158c22edca5377c3c6cd48cf0 Reviewed-on: https://chromium-review.googlesource.com/493617 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>