ethercat-linux/scripts/tc-deploy.ps1
Tony Cao 309aaba342 EL6695 8-byte bidirectional exchange with per-byte verification
- 8B PDO config: ULINT-sized payload, no 0x1A01 diag PDO on SM3
  (device rejected SM3=8 with diag assigned: 'size not allowed, min/max 0xa')
- twin_layout_blob_sized(): single 64-bit mapping entry for 8B payloads
- Ticker: per-byte XOR 0x5A transform in 8B mode so TwinCAT can verify
  every byte individually (1KB path unchanged, const-guarded)
- TwinCAT automation scripts: deploy with RPC retry, LinkVariables-based
  whole-array relink (element links only carry 1 byte), ADS watch, diag
- Docs: 8B design, verification methodology, test report
2026-07-27 19:01:05 +08:00

65 lines
2.1 KiB
PowerShell

#Requires -Version 5.1
<#
.SYNOPSIS
Full EL6695 deploy pipeline: configure PDO → activate → verify.
.DESCRIPTION
Orchestrates the complete workflow:
1. tc-configure-pdo.ps1 — inject 1024-byte PDOs (if -SkipConfigure)
2. tc-activate.ps1 — activate + restart TwinCAT
3. tc-verify.ps1 — dump and verify EL6695 XML
4. Print next steps — EEPROM store + J1900 consumer test
.PARAMETER SkipConfigure
Skip step 1 (PDO already configured in tsproj).
.PARAMETER Visible
Show TwinCAT XAE windows (for debugging).
.EXAMPLE
.\tc-deploy.ps1
.\tc-deploy.ps1 -SkipConfigure # PDO already set, just activate
.\tc-deploy.ps1 -Visible
#>
[CmdletBinding()]
param(
[switch]$SkipConfigure,
[switch]$Visible
)
. "$PSScriptRoot\tc-common.ps1"
New-Log $script:DefaultLogDir
$LogFile = Join-Path $script:DefaultLogDir "deploy.log"
Write-Log "========== EL6695 Deploy Pipeline ==========" $LogFile
# Step 1: Configure PDO
if (-not $SkipConfigure) {
Write-Log "[1/3] Configure PDO..." $LogFile
& "$PSScriptRoot\tc-configure-pdo.ps1" -Activate:$false
if ($LASTEXITCODE -ne 0) { Write-Log "Configure PDO failed" $LogFile; exit 1 }
} else {
Write-Log "[1/3] Skip PDO configure (already set)" $LogFile
}
# Step 2: Activate
Write-Log "[2/3] Activate configuration..." $LogFile
$activateArgs = @()
if ($Visible) { $activateArgs += "-Visible" }
& "$PSScriptRoot\tc-activate.ps1" @activateArgs
if ($LASTEXITCODE -ne 0) { Write-Log "Activate failed" $LogFile; exit 1 }
# Step 3: Verify
Write-Log "[3/3] Verify configuration..." $LogFile
$verifyArgs = @()
if ($Visible) { $verifyArgs += "-Visible" }
& "$PSScriptRoot\tc-verify.ps1" @verifyArgs
# Next steps
Write-Log "" $LogFile
Write-Log "========== Deploy complete ==========" $LogFile
Write-Log "Next steps for EEPROM persistence:" $LogFile
Write-Log " 1. From J1900: write 0x1010:01 = 0x73617665 (Store)" $LogFile
Write-Log " 2. From J1900: write 0xF008 = 0x33336695 (Soft Reset)" $LogFile
Write-Log " 3. From J1900: ./el6695_rt --consumer --mode verify" $LogFile