✨ feat(jtag): add Zynq JTAG presence detection via hw_server
- Add zynq_checker.py module to detect Zynq devices on JTAG chain - Connects to hw_server via Vivado batch mode - Parses JTAG device names to extract part number (e.g. XC7Z100) - Integrates into Step 1 environment check in main_window.py - Shows JTAG status in header (JTAG: XC7Z100 ✓)
This commit is contained in:
@@ -16,6 +16,7 @@ import customtkinter as ctk
|
||||
|
||||
from config_manager import Config
|
||||
from vitis_checker import check_vitis, get_tool_status_dict
|
||||
from zynq_checker import check_zynq_jtag, get_zynq_status_dict
|
||||
from flash_programmer import full_flash_program, FlashResult
|
||||
from bitstream_programmer import full_bitstream_program, BitstreamResult
|
||||
from ip_verifier import ping_ip
|
||||
@@ -75,6 +76,8 @@ class MainWindow(ctk.CTk):
|
||||
self._worker_thread: threading.Thread | None = None
|
||||
self._uart_available: bool = False
|
||||
self._uart_message: str = ""
|
||||
self._zynq_jtag_present: bool = False
|
||||
self._zynq_jtag_info = None
|
||||
|
||||
self._load_config()
|
||||
self._build_ui()
|
||||
@@ -185,6 +188,13 @@ class MainWindow(ctk.CTk):
|
||||
)
|
||||
self._ip_status.grid(row=0, column=2, sticky="e", padx=PADDING)
|
||||
|
||||
self._jtag_status = ctk.CTkLabel(
|
||||
header,
|
||||
text="JTAG: Checking...",
|
||||
font=FONT_BODY,
|
||||
)
|
||||
self._jtag_status.grid(row=0, column=3, sticky="e", padx=PADDING)
|
||||
|
||||
def _build_workflow_panel(self, parent: ctk.CTkFrame) -> None:
|
||||
"""Build the step-by-step workflow panel."""
|
||||
panel = ctk.CTkFrame(parent, corner_radius=CORNER_RADIUS)
|
||||
@@ -510,6 +520,22 @@ class MainWindow(ctk.CTk):
|
||||
self._ip_status.configure(text=f"IP: {ip} ✗", text_color=DANGER_COLOR)
|
||||
return False
|
||||
|
||||
# Check Zynq JTAG presence
|
||||
self._log_message(" Checking Zynq JTAG presence...")
|
||||
jtag_result = check_zynq_jtag(self._config, self._jtag_callback)
|
||||
jtag_dict = get_zynq_status_dict(jtag_result)
|
||||
if jtag_result.is_present:
|
||||
self._zynq_jtag_present = True
|
||||
self._zynq_jtag_info = jtag_result.devices[0]
|
||||
part = jtag_result.devices[0].part_number
|
||||
self._log_message(f" ✓ Zynq {part} detected on JTAG chain")
|
||||
self._jtag_status.configure(text=f"JTAG: {part} ✓", text_color=SUCCESS_COLOR)
|
||||
else:
|
||||
self._zynq_jtag_present = False
|
||||
self._zynq_jtag_info = None
|
||||
self._log_message(f" ✗ Zynq not detected on JTAG: {jtag_result.error}")
|
||||
self._jtag_status.configure(text="JTAG: Not detected", text_color=WARNING_COLOR)
|
||||
|
||||
# Check UART availability
|
||||
self._log_message(" Checking UART serial port...")
|
||||
port = self._config.serial_port
|
||||
@@ -568,6 +594,10 @@ class MainWindow(ctk.CTk):
|
||||
"""Callback for flash programming progress."""
|
||||
self._log_message(f" [{status}] {message}")
|
||||
|
||||
def _jtag_callback(self, status: str, message: str) -> None:
|
||||
"""Callback for JTAG scan progress."""
|
||||
self._log_message(f" [{status}] {message}")
|
||||
|
||||
def _run_step_3_load_bootloader(self) -> bool:
|
||||
"""Step 3: Load bootloader (BIT + ELF) and verify."""
|
||||
if not self._config:
|
||||
|
||||
Reference in New Issue
Block a user