fix: FirmWare version parsing + prevent boot-from-Flash in ELF step
Issue 1 — FirmWare version not parsed:
Input: [Info] FirmWare:V1.2.1.2.1_11_07_pmu_log3
Fix: regex [Ff]irm[Ww]are:?\s* (was [Ff]irmware\s+ — no : or camelCase)
Plus broader version capture: [Vv]\d+\.\d+\.\d+[^\s;,\n]*
Issue 2 — ELF loaded from Flash instead of downloaded ELF:
Root cause: Zynq devcfg.CTRL (0xF800025C) PCAP_PROG_B may trigger
reconfiguration from Flash after fpga, causing CPU to jump to
Flash-loaded code instead of our dow'd ELF.
BIT step: add ps7_post_config after fpga (finalizes PL-PS interfaces)
add mwr 0xF800025C 0x1 (disables PCAP reconfig)
ELF step: add mwr 0xF800025C 0x1 after dow, before con
(both attempt-1 and attempt-2 fallback)
This commit is contained in:
@@ -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",
|
||||
])
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user