Prepare RF-001A RX capture task
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
TASK_ID = RF001A_CLKIN_001
|
TASK_ID = RF001A_CAPTURE_001
|
||||||
TASK_TITLE = Verify RF-001A slave CLKIN
|
TASK_TITLE = Start RF-001A common-clock IQ capture
|
||||||
SOURCE_BRANCH = video-development
|
SOURCE_BRANCH = video-development
|
||||||
EXPECTED_HEAD = b28befc69df8e1493db3ed2b122696b44ec27221
|
EXPECTED_HEAD = 442451bdfb32dd9016986611559d9204ebef7192
|
||||||
REQUIRES_APPROVAL = YES
|
REQUIRES_APPROVAL = YES
|
||||||
HARDWARE_ACCESS = YES
|
HARDWARE_ACCESS = YES
|
||||||
RF_RX = YES
|
RF_RX = YES
|
||||||
@@ -11,84 +11,207 @@ ALLOW_PUSH = RX_RESULT_ONLY
|
|||||||
RISK_LEVEL = YELLOW
|
RISK_LEVEL = YELLOW
|
||||||
|
|
||||||
This file is the authoritative current task for the RX laptop.
|
This file is the authoritative current task for the RX laptop.
|
||||||
The RX assistant must read RX_NODE_STATE.md first,
|
The RX assistant must read RX_NODE_STATE.md first, then execute this file.
|
||||||
then execute this file.
|
If chat history conflicts with these files and current Git HEAD, stop and report the conflict.
|
||||||
If chat history conflicts with these files and current Git HEAD,
|
|
||||||
stop and report the conflict.
|
|
||||||
|
|
||||||
# Current RX task
|
# Current RX task
|
||||||
|
|
||||||
TASK =
|
TASK =
|
||||||
VERIFY RF-001A SLAVE CLKIN
|
START RF-001A COMMON-CLOCK IQ CAPTURE
|
||||||
|
|
||||||
The main PC has already completed the official source-side command for MASTER serial `000000000000000097c063dc323b97d3`:
|
This is a new task. Do not reuse approval or completion state from `RF001A_CLKIN_001`. This task requires its own explicit `[A] Approve` decision before any hardware access or capture starts.
|
||||||
|
|
||||||
```powershell
|
## 1. Preconditions
|
||||||
hackrf_clock.exe -d 000000000000000097c063dc323b97d3 -o 1
|
|
||||||
```
|
|
||||||
|
|
||||||
The command returned exit code 0. Treat this as `MASTER CLKOUT COMMAND = PASS`. Do not use `hackrf_clock -r 3` or Si5351 register 29 as a blocking test of physical CLKOUT. The common clock is still unverified until this RX task confirms the signal at SLAVE CLKIN before and after a short RX-start. RF TX remains 0.
|
After approval, run `git pull --ff-only origin video-development`, then verify:
|
||||||
|
|
||||||
1. In the project path from RX_NODE_STATE.md, record `git status --short --untracked-files=no`, branch and HEAD. Require a clean tracked checkout and branch `video-development`. Run `git pull origin video-development`; then require local HEAD = `origin/video-development`. Do not commit or push.
|
- branch = `video-development`;
|
||||||
|
- `git status --short --untracked-files=no` produces no output;
|
||||||
2. Run `hackrf_info` with the verified local host tools and preserve its complete stdout. Require exactly this RX serial:
|
- local HEAD equals `origin/video-development` and `EXPECTED_HEAD` is its ancestor;
|
||||||
|
- `hackrf_info` = PASS;
|
||||||
```text
|
- RX serial = `000000000000000097c063dc2e5327d3`;
|
||||||
000000000000000097c063dc2e5327d3
|
- COMMON CLOCK = `VERIFIED` from completed task `RF001A_CLKIN_001`;
|
||||||
```
|
- the cable remains connected from MASTER CLKOUT to SLAVE CLKIN;
|
||||||
|
- the command below contains the exact line `CLKIN status: clock signal detected`:
|
||||||
Stop if the device is absent or the serial differs. Do not change firmware, CPLD, USB drivers or Zadig.
|
|
||||||
|
|
||||||
3. With the physical cable connected from MASTER CLKOUT to SLAVE CLKIN, run the official partner-side check with the explicit RX serial and preserve complete stdout:
|
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
& '<verified hackrf_clock.exe path>' -d 000000000000000097c063dc2e5327d3 -i
|
& '<verified hackrf_clock.exe path>' -d 000000000000000097c063dc2e5327d3 -i
|
||||||
```
|
```
|
||||||
|
|
||||||
Accept only the exact line `CLKIN status: clock signal detected` as `SLAVE CLKIN BEFORE RX = DETECTED`. If the signal is not detected, set `COMMON CLOCK RX VERIFIED = NO` and stop. Do not alter clock configuration automatically.
|
Run the existing hardware-independent shared RF-001A spec test:
|
||||||
|
|
||||||
4. If CLKIN was detected, perform one short, finite RX-start on SLAVE. This opens receive mode only; it does not transmit and does not create the 20-second capture:
|
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
& '<verified hackrf_transfer.exe path>' -d 000000000000000097c063dc2e5327d3 -r NUL -f 1400000000 -s 8000000 -n 65536 -l 0 -g 0 -a 0 -p 0 -B
|
python -B -m pytest tests/test_rf001a_prepare.py -q -p no:cacheprovider --basetemp .local/pytest-rf001a-capture
|
||||||
```
|
```
|
||||||
|
|
||||||
Require exit code 0 and a complete transfer of 65536 complex samples. Record all reported overruns and errors. Any nonzero overrun, USB error, incomplete transfer or nonzero exit code means `SHORT RX START = FAIL` and stops the task.
|
Require it to pass and confirm the shared spec matches the capture parameters below. If any condition fails, do not start `hackrf_transfer`. Report the failed condition, set `RX CAPTURE STARTED = NO` and `RX READY FOR TX = NO`, keep `RF TX = 0`, and STOP.
|
||||||
|
|
||||||
5. Immediately after the short RX-start, repeat the same explicit `hackrf_clock.exe ... -i` command and preserve complete stdout. Require the exact line `CLKIN status: clock signal detected`. Set `COMMON CLOCK RX VERIFIED = YES` only when CLKIN was detected before RX, the short RX-start passed, and CLKIN remained detected after RX.
|
## 2. Authorized finite RX capture
|
||||||
|
|
||||||
6. Register 29 may be read only as optional diagnostic information with the already verified read-only command. It is not a PASS/FAIL criterion. Do not use `hackrf_debug` to write registers. Do not use `hackrf_clock -r 3` as a blocking criterion.
|
Only this finite capture is authorized:
|
||||||
|
|
||||||
7. Set `RX READY TO CAPTURE = YES` only if the branch/HEAD checks, RX serial check and all three clock checks in step 5 pass. This readiness does not authorize a capture or transmission. Do not start the 20-second RF-001A capture, RF TX, continuous RX, RF-001B, firmware/CPLD updates, `hackrf_spiflash`, Zadig or USB driver changes.
|
|
||||||
|
|
||||||
8. Finish with this exact report and STOP:
|
|
||||||
|
|
||||||
```text
|
```text
|
||||||
TASK =
|
RX serial = 000000000000000097c063dc2e5327d3
|
||||||
VERIFY RF-001A SLAVE CLKIN
|
center frequency = 1400000000 Hz
|
||||||
|
sample rate = 8000000 samples/s
|
||||||
|
RX LNA = 24 dB
|
||||||
|
RX VGA = 24 dB
|
||||||
|
RF amp = OFF
|
||||||
|
antenna bias = OFF
|
||||||
|
duration = 20 s
|
||||||
|
sample count = 160000000 complex samples
|
||||||
|
hardware format = cs8
|
||||||
|
expected file size = 320000000 bytes
|
||||||
|
```
|
||||||
|
|
||||||
BRANCH =
|
Create a new directory outside the Git checkout for every attempt. Use a timestamp plus a random suffix, refuse an existing path, and never overwrite an earlier capture. Keep the IQ file, stdout, stderr and metadata there. Do not add them to Git.
|
||||||
HEAD =
|
|
||||||
|
|
||||||
RX SERIAL =
|
The required command arguments are:
|
||||||
|
|
||||||
SLAVE CLKIN BEFORE RX =
|
```text
|
||||||
DETECTED / NOT_DETECTED
|
hackrf_transfer.exe
|
||||||
|
-d 000000000000000097c063dc2e5327d3
|
||||||
|
-r <unique_capture_path>\rf001a_capture.cs8
|
||||||
|
-f 1400000000
|
||||||
|
-s 8000000
|
||||||
|
-n 160000000
|
||||||
|
-l 24
|
||||||
|
-g 24
|
||||||
|
-a 0
|
||||||
|
-p 0
|
||||||
|
-B
|
||||||
|
```
|
||||||
|
|
||||||
SHORT RX START =
|
## 3. Controlled background start
|
||||||
PASS / FAIL
|
|
||||||
|
|
||||||
SLAVE CLKIN AFTER RX =
|
Keep one PowerShell session open for the start and completion sequence. Resolve the verified local path to `hackrf_transfer.exe`, then prepare and start the process:
|
||||||
DETECTED / NOT_DETECTED
|
|
||||||
|
|
||||||
COMMON CLOCK RX VERIFIED =
|
```powershell
|
||||||
|
$runId = '{0}_{1}' -f (Get-Date -Format 'yyyyMMdd_HHmmss'), ([guid]::NewGuid().ToString('N').Substring(0, 8))
|
||||||
|
$captureRoot = Join-Path ([Environment]::GetFolderPath('MyDocuments')) 'SDR_Rover_Captures'
|
||||||
|
$captureDirectory = Join-Path $captureRoot "RF001A_CAPTURE_001_$runId"
|
||||||
|
if (Test-Path -LiteralPath $captureDirectory) { throw "Capture directory already exists: $captureDirectory" }
|
||||||
|
New-Item -ItemType Directory -Path $captureDirectory -ErrorAction Stop | Out-Null
|
||||||
|
|
||||||
|
$capturePath = Join-Path $captureDirectory 'rf001a_capture.cs8'
|
||||||
|
$stdoutPath = Join-Path $captureDirectory 'hackrf_transfer.stdout.log'
|
||||||
|
$stderrPath = Join-Path $captureDirectory 'hackrf_transfer.stderr.log'
|
||||||
|
$hackrfTransfer = '<verified absolute path to hackrf_transfer.exe>'
|
||||||
|
$startedAt = Get-Date
|
||||||
|
$captureArguments = @(
|
||||||
|
'-d', '000000000000000097c063dc2e5327d3',
|
||||||
|
'-r', $capturePath,
|
||||||
|
'-f', '1400000000',
|
||||||
|
'-s', '8000000',
|
||||||
|
'-n', '160000000',
|
||||||
|
'-l', '24',
|
||||||
|
'-g', '24',
|
||||||
|
'-a', '0',
|
||||||
|
'-p', '0',
|
||||||
|
'-B'
|
||||||
|
)
|
||||||
|
$captureProcess = Start-Process -FilePath $hackrfTransfer -ArgumentList $captureArguments `
|
||||||
|
-RedirectStandardOutput $stdoutPath -RedirectStandardError $stderrPath `
|
||||||
|
-PassThru -WindowStyle Hidden
|
||||||
|
|
||||||
|
$growthDeadline = (Get-Date).AddSeconds(2)
|
||||||
|
do {
|
||||||
|
Start-Sleep -Milliseconds 100
|
||||||
|
$captureProcess.Refresh()
|
||||||
|
$captureBytes = if (Test-Path -LiteralPath $capturePath) {
|
||||||
|
(Get-Item -LiteralPath $capturePath).Length
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
} until ($captureProcess.HasExited -or $captureBytes -gt 0 -or (Get-Date) -ge $growthDeadline)
|
||||||
|
```
|
||||||
|
|
||||||
|
The start passes only if the process remains active and the capture file exists and has grown above zero bytes. If either check fails, report `RX CAPTURE STARTED = NO`, `RX READY FOR TX = NO`, preserve the logs, keep `RF TX = 0`, and STOP.
|
||||||
|
|
||||||
|
If both checks pass, immediately print this status. Do not wait for completion, calculate SHA256, or perform another slow action before printing it:
|
||||||
|
|
||||||
|
```text
|
||||||
|
TASK_ID =
|
||||||
|
RF001A_CAPTURE_001
|
||||||
|
|
||||||
|
RX CAPTURE STARTED =
|
||||||
|
YES
|
||||||
|
|
||||||
|
RX READY FOR TX =
|
||||||
|
YES
|
||||||
|
|
||||||
|
CAPTURE PID =
|
||||||
|
<PID>
|
||||||
|
|
||||||
|
CAPTURE PATH =
|
||||||
|
<absolute path>
|
||||||
|
|
||||||
|
CAPTURE DEADLINE / EXPECTED DURATION =
|
||||||
|
20 s
|
||||||
|
|
||||||
|
RF TX =
|
||||||
|
0
|
||||||
|
```
|
||||||
|
|
||||||
|
`RX READY FOR TX = YES` means only that this RX capture is active. RF TX on the RX laptop remains forbidden. The user coordinates any separately authorized TX action on the main PC.
|
||||||
|
|
||||||
|
## 4. Capture completion
|
||||||
|
|
||||||
|
Only after printing the start status, wait for the same process in the same PowerShell session:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
$captureProcess.WaitForExit()
|
||||||
|
$finishedAt = Get-Date
|
||||||
|
$captureProcess.Refresh()
|
||||||
|
$exitCode = $captureProcess.ExitCode
|
||||||
|
$captureSize = (Get-Item -LiteralPath $capturePath).Length
|
||||||
|
$captureDurationSeconds = ($finishedAt - $startedAt).TotalSeconds
|
||||||
|
$captureHash = (Get-FileHash -LiteralPath $capturePath -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||||
|
```
|
||||||
|
|
||||||
|
Check and report the exit code, actual file size, actual duration, RX overruns, USB errors, file write errors and raw IQ SHA256. Inspect the saved stdout and stderr. The capture is complete only if the exit code is zero, the file size is exactly `320000000` bytes, and the saved output contains no RX overrun, USB error or file write error. A smaller file is incomplete. Preserve the evidence and do not retry automatically.
|
||||||
|
|
||||||
|
Write machine-readable metadata to a new file in `$captureDirectory`. Include the task ID, RX serial, requested settings, PID, start and finish timestamps, exit code, file size, duration, error counts and SHA256. The metadata and logs remain outside Git.
|
||||||
|
|
||||||
|
First report the immediate start status shown above. After completion, provide:
|
||||||
|
|
||||||
|
```text
|
||||||
|
TASK_ID =
|
||||||
|
RF001A_CAPTURE_001
|
||||||
|
|
||||||
|
RX CAPTURE STARTED =
|
||||||
YES / NO
|
YES / NO
|
||||||
|
|
||||||
RX READY TO CAPTURE =
|
RX READY FOR TX =
|
||||||
YES / NO
|
YES / NO
|
||||||
|
|
||||||
|
CAPTURE PID =
|
||||||
|
|
||||||
|
CAPTURE PATH =
|
||||||
|
|
||||||
RF TX =
|
RF TX =
|
||||||
0
|
0
|
||||||
|
|
||||||
|
RX CAPTURE COMPLETE =
|
||||||
|
YES / NO
|
||||||
|
|
||||||
|
CAPTURE SIZE =
|
||||||
|
|
||||||
|
CAPTURE DURATION =
|
||||||
|
|
||||||
|
RX OVERRUNS =
|
||||||
|
|
||||||
|
USB ERRORS =
|
||||||
|
|
||||||
|
FILE WRITE ERRORS =
|
||||||
|
|
||||||
|
RAW IQ SHA256 =
|
||||||
|
|
||||||
STOP.
|
STOP.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 5. Prohibited actions
|
||||||
|
|
||||||
|
On the RX laptop, do not perform RF TX, firmware or CPLD updates, Zadig operations, USB driver changes, clock reconfiguration, continuous RX, automatic retries, commits to `video-development`, or pushes to `video-development`.
|
||||||
|
|
||||||
|
`ALLOW_PUSH = RX_RESULT_ONLY` permits only a separately approved small result publication under the handoff protocol. It does not permit raw IQ, large logs, a commit to `video-development`, or a push to `video-development`.
|
||||||
|
|||||||
Reference in New Issue
Block a user