From 1334ad4a6404e44c65a6200b628d1d2eddd44988 Mon Sep 17 00:00:00 2001 From: Myfro9 <36755290+Myfro9@users.noreply.github.com> Date: Mon, 20 Jul 2026 18:26:14 +0800 Subject: [PATCH] sync: WIN10-I9-64G 2026-07-20 --- fpga-imx6-flow/SKILL.md | 10 +++++----- fpga_update/SKILL.md | 4 ++-- smod_atsc_dev/SKILL.md | 4 ++-- smod_atsc_dev/references/imx6.md | 4 ++-- smod_atsc_dev/scripts/imx6_app.py | 30 ++++++++++++++++++++++++++++-- tools-sync/SKILL.md | 2 +- 6 files changed, 40 insertions(+), 14 deletions(-) diff --git a/fpga-imx6-flow/SKILL.md b/fpga-imx6-flow/SKILL.md index 4dfb148..02b5956 100644 --- a/fpga-imx6-flow/SKILL.md +++ b/fpga-imx6-flow/SKILL.md @@ -194,10 +194,10 @@ push it to the imx6). All of this is **network-based and fast** — no slow seri **Hosts / creds** - **imx6 mgmt: `192.168.1.143`** (Windows host is on `192.168.1.125`, same subnet — `ping` works). The old memory "imx6 not reachable over the network" is **outdated**; the mgmt port is reachable. - Login: **`root` / `anywavecom`**. (The serial console still works too but its login auto-logs-out and + Login: **`root`**, password = `SMOD_SSH_PASS` in `~\skills_env.md`. (The serial console still works too but its login auto-logs-out and is flaky; prefer network SSH for imx6 shell/log reads.) -- **Cross-compile VM: `bowei@192.168.223.128`** (Ubuntu, password **`lr7402`** — ask the user, don't - guess/brute-force). Toolchain env-setup: +- **Cross-compile VM: `bowei@192.168.223.128`** (Ubuntu; password = `CROSS_VM_PASS` in + `~\skills_env.md` — read it from there, don't guess/brute-force). Toolchain env-setup: `/opt/fsl-imx-x11/4.1.15-2.0.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi`. If VM SSH gives `kex_exchange_identification: Connection closed`, the VM's sshd is down/hung — ask the user to `sudo systemctl restart sshd`. @@ -220,11 +220,11 @@ push it to the imx6). All of this is **network-based and fast** — no slow seri **Full modify_imx6 flow (validated)** 1. Windows: `git archive --format=tar -o head_atsc.tar HEAD:imx6/src/atsc_app` (13 MB, self-contained). -2. paramiko→VM (pw `lr7402`): SFTP the tar up; extract to a **FRESH dir** (`~/atsc_head_build`, never +2. paramiko→VM (pw: `CROSS_VM_PASS` from `~\skills_env.md`): SFTP the tar up; extract to a **FRESH dir** (`~/atsc_head_build`, never touch `atsc_tsoip_build/` etc.); build: `bash -lc 'source ; cd ~/atsc_head_build && make'` → output `imx_atsc_app` (~2.92 MB ELF). 3. paramiko→VM SFTP the built `imx_atsc_app` down to Windows. -4. paramiko-2.12→imx6 (pw `anywavecom`): `cat >`-push it to `/aw/anywave/app/imx_atsc_app_head`, +4. paramiko-2.12→imx6 (pw: `SMOD_SSH_PASS` from `~\skills_env.md`): `cat >`-push it to `/aw/anywave/app/imx_atsc_app_head`, `chmod 755`, `cp -a imx_atsc_app_head imx_atsc_app` (swap active; golden stays as `imx_atsc_app.bak_pre_rx1`), md5-verify. 5. Cold-boot (tools_hw blast_off→power_off→power_on, TX-safe) so rc.local runs the new app. diff --git a/fpga_update/SKILL.md b/fpga_update/SKILL.md index 15fbcd8..9adb70d 100644 --- a/fpga_update/SKILL.md +++ b/fpga_update/SKILL.md @@ -52,7 +52,7 @@ DPD 的 sample&load 和升级数据流共用同一条 SPI1,而 FPGA 在升级 curl -s -b "session=$SESS" "http://192.168.1.143/atsc_status_cfg.cgi?sys_cfg=&" ``` -网页账号是 **`anywavecom` / `anywavecom`**(不是 `root`;`root/anywavecom` 是 SSH 的)。 +网页账号见 `~\skills_env.md` 的 `SMOD_WEB_USER` / `SMOD_WEB_PASS`(不是 `root`;SSH 凭据是 `SMOD_SSH_USER` / `SMOD_SSH_PASS`)。 ### 3. 烧进去 @@ -94,7 +94,7 @@ python scripts/fpga_ru.py --mcs ... --dry-run # 只校验文件,不碰硬 - **`ABORT_ERROR` 出现在第一帧** → mcs 格式不对,先跑 `--dry-run`。 - **`ABORT_ERROR` 出现在数据流中后段** → 怀疑 SPI1 上有别人(DPD)在写,把 ADPC 关掉重试。 - **没有应答 / 超时** → app 的 `sys_ready` 还是 0,或者 app 没在跑。 - `ssh root@192.168.1.143 'ps | grep atsc'`(SSH 密码 `anywavecom`,dropbear 老得很, + `ssh root@192.168.1.143 'ps | grep atsc'`(SSH 密码见 `~\skills_env.md` 的 `SMOD_SSH_PASS`,dropbear 老得很, 命令行 ssh 要加 `-o HostKeyAlgorithms=+ssh-rsa`)。 > 别用 `python ssh.py "tail -f ..."` 之类一次性读到 EOF 的封装去跟日志 —— 它永远不返回, diff --git a/smod_atsc_dev/SKILL.md b/smod_atsc_dev/SKILL.md index 0813494..0dacaa3 100644 --- a/smod_atsc_dev/SKILL.md +++ b/smod_atsc_dev/SKILL.md @@ -31,8 +31,8 @@ FPGA 做 8VSB 调制 / DPD / AGC / TS 前处理,imx6 跑 `atsc_app`(配置 A | FPGA / Flash | `xc7a200tfbg676-2` / Winbond **w25q128bv**(128 Mbit = 16 MB,SPIx1) | | Vivado | `D:\Xilinx\Vivado\2018.1`(`bin\vivado.bat`) | | imx6 源码 | `my_exciter\imx6\src\atsc_app`(Makefile 在该目录根) | -| imx6 设备 | `192.168.1.143`,`root` / `anywavecom`(网页 + SSH;Windows 主机 `192.168.1.125` 同网段) | -| 交叉编译 VM | `bowei@192.168.223.128`,密码 `lr7402`,构建目录 `~/atsc_head_build` | +| imx6 设备 | `192.168.1.143`,用户 `root`,密码见 `~\skills_env.md` 的 `SMOD_SSH_PASS`(网页 + SSH;Windows 主机 `192.168.1.125` 同网段) | +| 交叉编译 VM | `bowei@192.168.223.128`,密码见 `~\skills_env.md` 的 `CROSS_VM_PASS`,构建目录 `~/atsc_head_build` | | 工具链 | `/opt/fsl-imx-x11/4.1.15-2.0.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi` | | app 部署路径 | `/aw/anywave/app/imx_atsc_app`(先写 `imx_atsc_app_head`,再 `cp -a` 覆盖 active) | | app 日志 | `/var/module_log/imx_atsc_app.log` | diff --git a/smod_atsc_dev/references/imx6.md b/smod_atsc_dev/references/imx6.md index 0e37b6f..c650537 100644 --- a/smod_atsc_dev/references/imx6.md +++ b/smod_atsc_dev/references/imx6.md @@ -17,7 +17,7 @@ ## 交叉编译 -工具链在 VM `bowei@192.168.223.128`(密码 `lr7402`): +工具链在 VM `bowei@192.168.223.128`(密码见 `~\skills_env.md` 的 `CROSS_VM_PASS`): ``` /opt/fsl-imx-x11/4.1.15-2.0.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi @@ -36,7 +36,7 @@ VM 的 sshd 是现代版本,paramiko 5 / OpenSSH 都能连。若报 ## 部署到设备 -设备 `192.168.1.143`,`root` / `anywavecom`。**它的 SSH 是老 dropbear**,有两个坑: +设备 `192.168.1.143`,用户 `root`(密码见 `~\skills_env.md` 的 `SMOD_SSH_PASS`)。**它的 SSH 是老 dropbear**,有两个坑: 1. **算法太老**:paramiko 5 会报 `unknown cipher` / `no acceptable host key`。 要用 **paramiko 2.12**(有 TripleDES / aes-cbc / ssh-rsa): diff --git a/smod_atsc_dev/scripts/imx6_app.py b/smod_atsc_dev/scripts/imx6_app.py index 81ba84a..0465219 100644 --- a/smod_atsc_dev/scripts/imx6_app.py +++ b/smod_atsc_dev/scripts/imx6_app.py @@ -25,19 +25,45 @@ touch the relays; that sequencing lives in the vivado-mcp tools. import argparse import hashlib import os +import re import subprocess import sys import tarfile import tempfile + +def _env_lookup(key, default=None): + """Machine-local values (paths, IPs, credentials) live in ~/skills_env.md, never in git. + An OS environment variable of the same name overrides the file.""" + v = os.environ.get(key) + if v: + return v + path = os.path.join(os.path.expanduser("~"), "skills_env.md") + try: + with open(path, encoding="utf-8") as f: + for line in f: + m = re.match(rf"\s*{key}\s*=\s*(\S+)", line) + if m: + return m.group(1) + except OSError: + pass + if default is None: + sys.exit(f"missing {key}: add it to ~/skills_env.md or set it as an env var") + return default + + REPO = r"E:\Xilinx_design\smod\SMOD_ATSC\my_exciter" APP_SUBDIR = "imx6/src/atsc_app" -VM_HOST, VM_USER, VM_PASS = "192.168.223.128", "bowei", "lr7402" +VM_HOST = _env_lookup("CROSS_VM_HOST", "192.168.223.128") +VM_USER = _env_lookup("CROSS_VM_USER", "bowei") +VM_PASS = _env_lookup("CROSS_VM_PASS") VM_BUILD_DIR = "atsc_head_build" # relative to the VM home dir TOOLCHAIN = "/opt/fsl-imx-x11/4.1.15-2.0.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi" -IMX_HOST, IMX_USER, IMX_PASS = "192.168.1.143", "root", "anywavecom" +IMX_HOST = _env_lookup("SMOD_BOARD_IP", "192.168.1.143") +IMX_USER = _env_lookup("SMOD_SSH_USER", "root") +IMX_PASS = _env_lookup("SMOD_SSH_PASS") IMX_APP_DIR = "/aw/anywave/app" IMX_STAGING = f"{IMX_APP_DIR}/imx_atsc_app_head" IMX_ACTIVE = f"{IMX_APP_DIR}/imx_atsc_app" diff --git a/tools-sync/SKILL.md b/tools-sync/SKILL.md index 6659d88..5b1ef12 100644 --- a/tools-sync/SKILL.md +++ b/tools-sync/SKILL.md @@ -105,7 +105,7 @@ commit + push 一次,并在 codex 侧 pull,保证两边一致。 校验方式(路径以 skills_env.md 的 `CONDA_LANGGRAPH_PYTHON` 为准): ```powershell -& -c "import langgraph, langchain; print('langgraph env OK')" +& -c "import langgraph, langgraph.graph, langchain_core; print('langgraph env OK')" ``` 失败(环境不存在或包缺失)→ 调用 `langgraph-vivado-install` skill 完成安装,