imx6: document VM bootstrap, stop hardcoding the cross-compile VM's IP
The VMware segment changed, so the VM moved from 192.168.223.128 to 192.168.154.128 and every hardcoded reference was stale. A freshly-installed VM also has neither sshd nor the toolchain, which previously only surfaced half-way through a modify_imx6 iteration. - fpga-imx6-flow: new "VM prerequisite check" section -- how to detect a missing sshd (Connection refused) and reach the guest over vmrun/VMware Tools when SSH is impossible, plus the Yocto SDK install + ARM-ELF verification step. Records the real gotchas hit during install: unattended-upgrades holding the dpkg lock, EOL xenial repos, and CRLF breaking scripts pushed into the guest. - smod_atsc_dev SKILL/imx6.md: refer to CROSS_VM_HOST/USER/PASS, no literal IP. - imx6_app.py: drop the stale 192.168.223.128 default so a missing CROSS_VM_HOST fails loudly instead of dialing the wrong host. Machine-local values (IP, credentials, vmx/vmrun paths, toolchain prefix) live in ~/skills_env.md, which stays out of git. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
88f96fa5fa
commit
a7e20d807d
+50
-5
@@ -139,7 +139,7 @@ it, then resume the **same `--thread-id`** with a JSON payload. Repeat until exi
|
||||
| `meets_requirement` | 符合设计要求? | Judge the analysis against the design requirement | `{"meets": true}` or `{"meets": false}` |
|
||||
| `propose` | 分析原因,提出修改方案 | Diagnose root cause; decide what to change + next program mode | `{"reason":"...","need_fpga": true/false,"need_imx6": true/false,"program_mode":"bitstream"或"flash"}` |
|
||||
| `modify_fpga` | 改 RTL→综合→出 bit/flash | Edit RTL, run Vivado synth/impl, produce bit + flash files | `{"bit_path":"...","flash_path":"...","program_mode":"flash"}` |
|
||||
| `modify_imx6` | VM 改 app→交叉编译 | In the Ubuntu VM (`bowei@192.168.223.128`) edit app + cross-compile | `{"app_path":"..."}` |
|
||||
| `modify_imx6` | VM 改 app→交叉编译 | In the Ubuntu VM (`CROSS_VM_USER@CROSS_VM_HOST`, see `~\skills_env.md`) edit app + cross-compile | `{"app_path":"..."}` |
|
||||
|
||||
Resume command:
|
||||
|
||||
@@ -196,11 +196,56 @@ push it to the imx6). All of this is **network-based and fast** — no slow seri
|
||||
The old memory "imx6 not reachable over the network" is **outdated**; the mgmt port is reachable.
|
||||
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 = `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`.
|
||||
- **Cross-compile VM (VMware, Ubuntu 16.04.3)**: host/user/password = `CROSS_VM_HOST` /
|
||||
`CROSS_VM_USER` / `CROSS_VM_PASS` in `~\skills_env.md` — read them from there, don't
|
||||
guess/brute-force and **don't hardcode the IP** (it moved from `192.168.223.128` to
|
||||
`192.168.154.128` when the VMware segment changed). Toolchain env-setup:
|
||||
`CROSS_VM_ENV_SETUP` (currently
|
||||
`/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`.
|
||||
`sudo systemctl restart ssh`. If it gives **`Connection refused`**, sshd isn't installed at
|
||||
all → see *VM prerequisite check* below.
|
||||
|
||||
**VM prerequisite check (do this BEFORE the first cross-compile of a session)**
|
||||
|
||||
A freshly-installed VMware Ubuntu has **neither sshd nor the toolchain**. Check both up
|
||||
front — discovering it half-way through `modify_imx6` wastes a whole loop iteration:
|
||||
|
||||
```bash
|
||||
# 1. is sshd even listening? (Connection refused => not installed)
|
||||
ssh -o ConnectTimeout=5 $CROSS_VM_USER@$CROSS_VM_HOST 'ls -d /opt/fsl-imx-x11/*'
|
||||
```
|
||||
|
||||
- **`Connection refused`** → sshd not installed. You **cannot** fix this over SSH; use
|
||||
**`vmrun`** (VMware Tools channel, `VMRUN_PATH` + `CROSS_VM_VMX` in `~\skills_env.md`):
|
||||
```
|
||||
vmrun -T ws -gu <user> -gp <pass> CopyFileFromHostToGuest <vmx> <local.sh> /tmp/s.sh
|
||||
vmrun -T ws -gu <user> -gp <pass> runProgramInGuest <vmx> /bin/bash /tmp/s.sh
|
||||
vmrun -T ws -gu <user> -gp <pass> CopyFileFromGuestToHost <vmx> /tmp/out.log <local.log>
|
||||
```
|
||||
Then in the guest: `sudo apt-get install -y openssh-server && sudo systemctl enable --now ssh`.
|
||||
- **`ls: No such file`** (SSH works, no `/opt/fsl-imx-x11/*`) → toolchain missing, install it.
|
||||
|
||||
*Installing the toolchain* — the Yocto/FSL SDK installer lives with the project notes at
|
||||
`…\my_exciter\Notes_imx6\agt_devlp_ext_260616\fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa7hf-neon-toolchain-4.1.15-2.0.0.sh`
|
||||
(776 MB). `scp` it to the VM, verify `md5sum` matches the local copy, then:
|
||||
|
||||
```bash
|
||||
chmod +x toolchain.sh && sudo ./toolchain.sh -y -d /opt/fsl-imx-x11/4.1.15-2.0.0
|
||||
```
|
||||
|
||||
`-y` makes it non-interactive; `-d` must match `CROSS_VM_ENV_SETUP`'s parent. Verify by
|
||||
compiling a throwaway `.c` and confirming `file` reports **`ELF 32-bit LSB … ARM, EABI5`** —
|
||||
a successful `gcc --version` alone does not prove the sysroot is wired up.
|
||||
|
||||
Gotchas seen on a real install (2026-07-20):
|
||||
- `apt-get` may fail with `Could not get lock /var/lib/dpkg/lock` because **`unattended-upgrades`
|
||||
runs on boot**. Don't kill it — poll `fuser /var/lib/dpkg/lock` until it clears (~90 s).
|
||||
- Xenial is EOL. `us.archive.ubuntu.com` still served it here, but if `apt-cache policy
|
||||
openssh-server` shows no candidate, rewrite `/etc/apt/sources.list` to
|
||||
`old-releases.ubuntu.com` (back it up first).
|
||||
- Scripts pushed via `CopyFileFromHostToGuest` must have **LF** line endings; CRLF makes
|
||||
bash fail obscurely. Write them with `[System.IO.File]::WriteAllText`, not `Set-Content`.
|
||||
|
||||
**SSH library quirk (critical)**
|
||||
- The imx6's SSH server is **old (legacy ciphers + `ssh-rsa` host key)**. paramiko **5.0 fails**
|
||||
|
||||
Reference in New Issue
Block a user