diff --git a/src/bitstream_programmer.py b/src/bitstream_programmer.py index 5279a99..fc5ab09 100644 --- a/src/bitstream_programmer.py +++ b/src/bitstream_programmer.py @@ -214,7 +214,7 @@ def _program_with_xsct( if callback: callback("progress", "Initializing PS then programming FPGA...") - # Build TCL: PS init first, then FPGA config + # Build TCL: PS init first, then FPGA config, then post-config lines = ["connect"] if ps7_init_tcl and Path(ps7_init_tcl).exists(): lines.append("targets 1") @@ -223,6 +223,12 @@ def _program_with_xsct( if callback: callback("progress", "PS initialized (clocks, DDR, MIO)") lines.append(f'fpga -file "{bit_path}"') + if ps7_init_tcl and Path(ps7_init_tcl).exists(): + lines.append("ps7_post_config") + if callback: + callback("progress", "PS post-config (PL-PS interfaces)") + # Prevent boot from Flash by disabling PCAP reconfiguration + lines.append("mwr 0xF800025C 0x00000001") lines.append("exit") tcl_script = "\n".join(lines) @@ -422,6 +428,7 @@ def _run_elf_with_xsct( "connect", "targets 2", "dow \"%s\"" % elf_path, + "mwr 0xF800025C 0x00000001", "con", "exit", ]) @@ -459,6 +466,7 @@ def _run_elf_with_xsct( "ps7_init", "targets 2", "dow \"%s\"" % elf_path, + "mwr 0xF800025C 0x00000001", "con", "exit", ]) diff --git a/src/serial_monitor.py b/src/serial_monitor.py index a0d367a..cef79dc 100644 --- a/src/serial_monitor.py +++ b/src/serial_monitor.py @@ -74,8 +74,8 @@ def parse_boot_output(lines: list[str]) -> BootInfo: version_patterns = [ re.compile(r"[Vv]ersion[:\s]+([^\s;,\n]+)", re.IGNORECASE), re.compile(r"[Bb]oot\s+([^\s;,\n]+)", re.IGNORECASE), - re.compile(r"[Ff]irmware\s+([^\s;,\n]+)", re.IGNORECASE), - re.compile(r"(?:^|[\s:=])(v\d+\.\d+\.\d+)(?:\s|$)", re.IGNORECASE), + re.compile(r"[Ff]irm[Ww]are:?\s*([^\s;,\n]+)", re.IGNORECASE), + re.compile(r"(?:^|[\s:=])([Vv]\d+\.\d+\.\d+[^\s;,\n]*)", re.IGNORECASE), ] boot_complete_patterns = [ re.compile(r"boot\s+complete", re.IGNORECASE),