Skip to content

Commit

Permalink
cli: Force FPGA offline before reading flash UID
Browse files Browse the repository at this point in the history
Fix #102
  • Loading branch information
mossmann committed Jul 23, 2024
1 parent d9a5943 commit 826faba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions apollo_fpga/commands/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ def print_device_info(device, args):
logging.info(f"\tSerial number: {device.serial_number}")
logging.info(f"\tFirmware version: {device.get_firmware_version()}")
logging.info(f"\tUSB API version: {device.get_usb_api_version_string()}")
with device.jtag as jtag:
programmer = device.create_jtag_programmer(jtag)
flash_uid = programmer.read_flash_uid()
logging.info(f"\tFlash UID: {flash_uid:016x}")
if args.force_offline:
device.force_fpga_offline()
with device.jtag as jtag:
programmer = device.create_jtag_programmer(jtag)
flash_uid = programmer.read_flash_uid()
logging.info(f"\tFlash UID: {flash_uid:016x}")

def print_chain_info(device, args):
""" Command that prints information about devices connected to the scan chain to the console. """
Expand Down

0 comments on commit 826faba

Please sign in to comment.