pacman: Fix failures when performing simultaneous measurements

This commit fixes an issue where performing measurements on seperate
pacdebuggers fails with `pyftdi.i2c.I2cIOError: No answer from FTDI`.
Currently, the code creates FTDI URLs for each pacdebugger by grabbing
all connected devices with the correct VID:PID and then identifies them
by their bus:address. This apparently can cause issues lower in the
stack, causing communication with the pacdebugger to fail. This commit
changes the code to use an FTDI URL with the serial number included
which unambiguously identifies each pacdebugger.

BUG=b:241540324
TEST=Ran simultaneous measurements on two pacdebuggers a dozen times,
did not encounter any failures.

Change-Id: I9c1187ea35964f15096a22db15e25b89a1ef08e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/3900831
Tested-by: Robert Zieba <robertzieba@google.com>
Auto-Submit: Robert Zieba <robertzieba@google.com>
Commit-Queue: Parker Holloway <jparkerh@google.com>
Reviewed-by: Parker Holloway <jparkerh@google.com>
diff --git a/contrib/power_measurement/pacman/pacboard.py b/contrib/power_measurement/pacman/pacboard.py
index 628ed60..da8fec8 100644
--- a/contrib/power_measurement/pacman/pacboard.py
+++ b/contrib/power_measurement/pacman/pacboard.py
@@ -95,20 +95,8 @@
     @staticmethod
     def url_by_serial(serial):
         """Returns the device URL of a pacdebugger by serial number"""
-        devices = pyftdi.ftdi.Ftdi.find_all([
-            (PacDebugger.PROVISIONED_VID, PacDebugger.PROVISIONED_PID)
-        ])
-
-        for ((vid, pid, bus, addr, _, _, _), _) in devices:
-            ftdi_url = f'ftdi://{vid:#x}:{pid:#x}:{bus:x}:{addr:x}/1'
-
-            eeprom = pyftdi.eeprom.FtdiEeprom()
-            eeprom.open(ftdi_url, size=PacDebugger.EEPROM_SIZE)
-
-            if eeprom.serial == serial:
-                return ftdi_url
-
-        return ''
+        return (f'ftdi://{PacDebugger.PROVISIONED_VID:#x}'
+                f':{PacDebugger.PROVISIONED_PID:#x}:{serial}/1')
 
     @staticmethod
     def unbrick(unbricker_url):
diff --git a/contrib/power_measurement/pacman/pacman.py b/contrib/power_measurement/pacman/pacman.py
index 0f71eb7..9d2ce99 100755
--- a/contrib/power_measurement/pacman/pacman.py
+++ b/contrib/power_measurement/pacman/pacman.py
@@ -10,7 +10,6 @@
 import datetime
 import os
 import pathlib
-import sys
 from sys import modules
 import urllib
 
@@ -92,12 +91,6 @@
     if args.device != '':
         ftdi_url = pacboard.PacDebugger.url_by_serial(args.device)
 
-        if ftdi_url == '':
-            print(f'Failed to find Pacdebugger with serial {args.device}',
-                file=sys.stderr)
-            return False
-
-
     # If single, take a single shot of these measurements then quit.
     # Print which files are being used for clarity
     if args.single: