From 166b53983f7e426d216bf48459081865ad9b6cf0 Mon Sep 17 00:00:00 2001 From: ETWen Date: Tue, 25 Aug 2026 15:50:56 +0800 Subject: [PATCH] feat(bmc): Re-enable bmc_monitor with an I2C write/read-back test bmc_monitor.sh comes back into the run with a second job beyond the `free -m` sampling: an I2C pattern test against bus 1, address 0x41, offset 0x00C0 -- write 55AA55AA and read it back, then write AA55AA55 and read that back. Two complementary patterns catch a stuck bit either way round, and repeating it through the soak turns an intermittent I2C fault into something the log shows rather than something the tester has to catch live. Script B starts it alongside the other stress; Script C stops it and cats log/bmc_poll.log. bmc_monitor_ddr.sh stays disabled -- BMC DDR stress runs through bgctl + bmc-manager. Docs: the "disabled" notes I added last time now applied to only half the pair and read as wrong for bmc_monitor.sh. Split so the monitor is documented as live with its I2C test, and only the _ddr variant is marked disabled. Script A -> V1.0.8. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM --- ARCHITECTURE.md | 14 ++++++++------ CLAUDE.md | 3 ++- src/Script_ABC_Blanton/1_Blanton_Script_A.ttl | 5 ++++- src/Script_ABC_Blanton/2_Blanton_Script_B.ttl | 4 ++++ src/Script_ABC_Blanton/3_Blanton_Script_C.ttl | 6 ++++++ .../Blanton_Script/bmc_monitor.sh | 4 ++++ 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 36f21b0..78445e7 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -178,8 +178,8 @@ Blanton_TTL_Script/ │ # init/clear/show/start/stop/ps/report/run ├── mgmt_ping_monitor.sh # 10G/1G 管理網路 ping 監控(iproute2) │ # eth0→TARGET_10G、eth1→TARGET_1G,兩張卡都保持 up - ├── bmc_monitor.sh # ⚠️ 已停用:B/C 內呼叫處已註解,改走 bgctl + bmc-manager - ├── bmc_monitor_ddr.sh # ⚠️ 已停用,同上 + ├── bmc_monitor.sh # BMC 監控:free -m + I2C 寫入/讀回圖樣測試 + ├── bmc_monitor_ddr.sh # ⚠️ 已停用:B/C 內呼叫處已註解,DDR 壓力改走 bgctl + bmc-manager │ # ↑ 三支都要 chmod +x 才能跑(見 Key Constraints) └── LTC2980_Margin_Script/ # 電壓 margin 子專案(另有獨立 repo) ├── margin.sh # margin_init/status/set/apply_profile/save @@ -312,7 +312,8 @@ PROFILE_CHANNELS=( "0:high:8" "1:low:8" ... ) # "channel:operation:change_perc | **電源資料** | `pwr_data` / `pwr_data_pdb` / `pwr_pdb_id` | SWB VRM 全軌 Vin/Vout/Iout/Temp 對齊表;MP29816 解析度**執行期從 `MFR_VOUT_SCALE_LOOP` 讀**,不寫死 | | **電壓 Margin** | `margin_init/status/set/apply_profile/save` + `*_all.sh` | 9 顆 LTC2980(CB CONN13、SWB0/1 CONN13~16)批次 high/low margin 與狀態掃描。v2.6.0 起 SWB 路徑真正接上共用 cb_i2c 後端,並有 `margin_swb_info/probe/scan/reset/sem` 除錯包裝 | | **管理網路 ping** | `mgmt_ping_monitor.sh {start\|stop\|status\|fg\|tail\|clear\|summary}` | 一輪 = 10G leg + 1G leg,各自 `ip address/route replace` 後 `ping -I ` 打自己的對端;兩張卡都保持 up。每 leg 記 `ip -s link show` 與該卡的 TX/RX packet delta,另出一行可 grep 的 `RESULT` | -| **BMC 監控 / 壓力** | `bmc_monitor.sh` / `bmc_monitor_ddr.sh` | ⚠️ **已停用** —— B/C 內呼叫處已註解,改由 `bgctl` + `bmc-manager run memtester` 取代。檔案保留未刪 | +| **BMC 監控** | `bmc_monitor.sh {start\|stop\|status\|fg\|tail\|clear}` | 由 host 端 `bmc-manager run` 週期取樣 `free -m`,另加一組 **I2C 寫入/讀回圖樣測試**(bus 1、addr 0x41、offset 0x00C0,寫 `55AA55AA` 讀回、再寫 `AA55AA55` 讀回)。B 啟動、C 停止並 `cat log/bmc_poll.log` | +| **BMC DDR 壓力** | `bmc_monitor_ddr.sh` | ⚠️ **已停用** —— B/C 內呼叫處已註解,改由 `bgctl run bmc-manager run memtester` 取代。檔案保留未刪 | | **打包交付** | `publish/publish.sh [-v Ver] [-f] [-z] [-n]` | 版號讀 Script A 檔頭,複製成 `publish/Script_ABC_Blanton_/`,排除 `*.log`,可另出 zip | --- @@ -711,10 +712,11 @@ margin status、全部 VRM 軌的 Vin/Vout/Iout/Temp、CB + ICB 溫感讀值, 文件已加過期警告但內文未動。第 1~4 章不受影響。 - **`wait_init.ttl` 沒有逾時出口**:若 pmon 一直起不來,`result` 既非 1 也非 2,迴圈會無限重試, Script A 既不往下走也不報錯。可加最大重試次數 + `messagebox` 提示。 -- **腳本的執行權**:`mgmt_ping_monitor.sh`(以及保留但已停用的 `bmc_monitor*.sh`)需人工 `chmod +x`。 +- **腳本的執行權**:`mgmt_ping_monitor.sh` 與 `bmc_monitor.sh`(以及已停用的 `bmc_monitor_ddr.sh`)需人工 `chmod +x`。 可在 Script B 起它之前補一行(比照既有的 `chmod +x ~/hammer/tools/amd/mlucas-avx2`),或在 publish 時處理。 -- **`bmc_monitor.sh` / `bmc_monitor_ddr.sh` 已停用**:B/C 內的呼叫都已註解,改由 `bgctl` + - `bmc-manager run memtester` 取代。檔案還留在 repo,待確認不再需要後刪除,或在檔頭標註停用。 +- **`bmc_monitor_ddr.sh` 已停用**:B/C 內的呼叫已註解,DDR 壓力改由 `bgctl run bmc-manager run memtester` + 取代。檔案還留在 repo,待確認不再需要後刪除,或在檔頭標註停用。 + (`bmc_monitor.sh` 已於 2026-08-25 重新啟用,並加上 I2C 寫入/讀回圖樣測試。) - **`rm /host/hw-eval/current/jobs/*` 清不掉子目錄**:Script A 用的是不帶 `-r` 的 `rm`,但 Script C 是 `cp -r` 那個目錄,代表裡面可能有子目錄。清不乾淨的話,上一輪的 job log 會被當成這輪的一起 複製到 USB。要確認 `bgctl` 的產出結構,必要時改成 `rm -rf .../jobs/*`。 diff --git a/CLAUDE.md b/CLAUDE.md index c3f828b..989c861 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -85,7 +85,8 @@ chmod +x ~/Blanton_Script/*.sh # 佈署後必做一次 ~/Blanton_Script/mgmt_ping_monitor.sh stop ~/Blanton_Script/mgmt_ping_monitor.sh summary # 只看每段的 RESULT 行 # ⚠️ tail 子命令是 tail -f,會卡住不返回;TTL 裡要倒 log 請用 cat -# ⚠️ bmc_monitor.sh / bmc_monitor_ddr.sh 已停用(改走 bgctl + bmc-manager),檔案仍在 +# bmc_monitor.sh start/stop # free -m + BMC I2C 寫入/讀回圖樣測試,log/bmc_poll.log +# ⚠️ bmc_monitor_ddr.sh 已停用(DDR 壓力改走 bgctl + bmc-manager),檔案仍在 # ── 背景壓力(平台工具)────────────────────────────── bgctl run /usr/sbin/memtester 1G 100 diff --git a/src/Script_ABC_Blanton/1_Blanton_Script_A.ttl b/src/Script_ABC_Blanton/1_Blanton_Script_A.ttl index 4e9d887..706dfbb 100644 --- a/src/Script_ABC_Blanton/1_Blanton_Script_A.ttl +++ b/src/Script_ABC_Blanton/1_Blanton_Script_A.ttl @@ -1,6 +1,6 @@ ; ============================================================================= ; Script A for Blanton -; Version : V1.0.7 +; Version : V1.0.8 ; Date : 2026-08-25 ; Author : ETWen ; ============================================================================= @@ -43,6 +43,9 @@ ; ScriptC Copy stress jobs log to USB, timestamped ; utils/wait_init.ttl WT_INTERVAL 10 -> 60, fix WT_MIN comments ; ScriptC Disable BMC USB journalctl dump +; V1.0.8 2026-08-25 Blanton_Script/bmc_monitor.sh Add BMC I2C write/read-back pattern test +; ScriptB Re-enable bmc_monitor.sh start +; ScriptC Re-enable bmc_monitor.sh stop + cat bmc_poll.log ; ============================================================================= include "config.ttl" diff --git a/src/Script_ABC_Blanton/2_Blanton_Script_B.ttl b/src/Script_ABC_Blanton/2_Blanton_Script_B.ttl index 6081d8c..8513b49 100644 --- a/src/Script_ABC_Blanton/2_Blanton_Script_B.ttl +++ b/src/Script_ABC_Blanton/2_Blanton_Script_B.ttl @@ -28,6 +28,10 @@ sendln "~/hammer/tools/amd/mlucas-avx2 -s l -cpu 0:15 > ~/hammer/tools/amd/mluca wait prompt_sonic_root sendln "bgctl run bmc-manager run '/usr/bin/memtester 64M 1'" +; ========== BMC Monitor Test ========== +wait prompt_sonic_root +sendln "./Blanton_Script/bmc_monitor.sh start" + ; ========== DDR MEMORY STRESS TEST ========== wait prompt_sonic_root sendln "bgctl run /usr/sbin/memtester 1G 100" diff --git a/src/Script_ABC_Blanton/3_Blanton_Script_C.ttl b/src/Script_ABC_Blanton/3_Blanton_Script_C.ttl index 077f33c..7387859 100644 --- a/src/Script_ABC_Blanton/3_Blanton_Script_C.ttl +++ b/src/Script_ABC_Blanton/3_Blanton_Script_C.ttl @@ -53,6 +53,12 @@ sendln "/usr/sbin/ras-mc-ctl --summary" ;wait prompt_sonic_root ;sendln "cat ./Blanton_Script/log/bmc_ddr.log" +; ========== BMC Monitor TAKE DATA ========== +wait prompt_sonic_root +sendln "./Blanton_Script/bmc_monitor.sh stop" +wait prompt_sonic_root +sendln "cat ./Blanton_Script/log/bmc_poll.log" + ; ========== BMC USB Test result ========== ;wait prompt_sonic_root ;sendln "journalctl -u qfx5252-bmc-usb-net-test.service --no-pager" diff --git a/src/Script_ABC_Blanton/Blanton_Script/bmc_monitor.sh b/src/Script_ABC_Blanton/Blanton_Script/bmc_monitor.sh index 6061c3e..5caa729 100644 --- a/src/Script_ABC_Blanton/Blanton_Script/bmc_monitor.sh +++ b/src/Script_ABC_Blanton/Blanton_Script/bmc_monitor.sh @@ -34,6 +34,10 @@ set -u # Add a line to add a command; comment it out to disable it. COMMANDS=( "free -m" + "i2ctransfer -f -y 1 w6@0x41 0x00 0xC0 0x55 0xAA 0x55 0xAA" + "i2ctransfer -f -y 1 w2@0x41 0x00 0xC0 r4" + "i2ctransfer -f -y 1 w6@0x41 0x00 0xC0 0xAA 0x55 0xAA 0x55" + "i2ctransfer -f -y 1 w2@0x41 0x00 0xC0 r4" #"uptime" #"cat /proc/loadavg" #"cat /proc/meminfo"