91 lines
3.3 KiB
PowerShell
91 lines
3.3 KiB
PowerShell
#Requires -Version 5.1
|
|
<#
|
|
.SYNOPSIS
|
|
Check YNGJ-GT1-M AT32F403ARCT7 development environment.
|
|
#>
|
|
|
|
$ErrorActionPreference = "SilentlyContinue"
|
|
$projectRoot = Split-Path $PSScriptRoot -Parent
|
|
|
|
Write-Host "=== YNGJ-GT1-M Dev Environment Check ===" -ForegroundColor Cyan
|
|
Write-Host "Project: $projectRoot`n"
|
|
|
|
function Test-Command($name, $cmd) {
|
|
$found = Get-Command $cmd -ErrorAction SilentlyContinue
|
|
if ($found) {
|
|
Write-Host "[OK] $name -> $($found.Source)" -ForegroundColor Green
|
|
return $true
|
|
} else {
|
|
Write-Host "[MISS] $name" -ForegroundColor Red
|
|
return $false
|
|
}
|
|
}
|
|
|
|
Test-Command "Git" "git" | Out-Null
|
|
|
|
$jlink = Test-Command "J-Link" "JLink"
|
|
if (-not $jlink) {
|
|
Write-Host " Install: winget install NordicSemiconductor.JLink" -ForegroundColor Yellow
|
|
Write-Host " Or download: https://www.segger.com/downloads/jlink/" -ForegroundColor Yellow
|
|
} else {
|
|
$jlinkDev = Get-PnpDevice -ErrorAction SilentlyContinue | Where-Object { $_.InstanceId -match 'VID_1366' }
|
|
if ($jlinkDev) {
|
|
$online = $jlinkDev | Where-Object { $_.Present -eq $true }
|
|
if ($online) {
|
|
Write-Host "[OK] J-Link USB device present" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "[FAIL] J-Link ghost device only (Present=False). Run scripts\repair-jlink.ps1" -ForegroundColor Red
|
|
}
|
|
} else {
|
|
Write-Host "[FAIL] J-Link not detected on USB (plug in debugger)" -ForegroundColor Red
|
|
}
|
|
}
|
|
|
|
$iarPaths = @(
|
|
"C:\Program Files\IAR Systems",
|
|
"C:\Program Files (x86)\IAR Systems",
|
|
"F:\IAR_WorkBench"
|
|
)
|
|
$iarFound = $false
|
|
foreach ($base in $iarPaths) {
|
|
if (Test-Path $base) {
|
|
$iarBuild = Get-ChildItem -Path $base -Recurse -Filter "IarBuild.exe" -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
$iarIde = Get-ChildItem -Path $base -Recurse -Filter "IarIdePm.exe" -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
if ($iarBuild) {
|
|
Write-Host "[OK] IAR Build -> $($iarBuild.FullName)" -ForegroundColor Green
|
|
$iarFound = $true
|
|
}
|
|
if ($iarIde) {
|
|
Write-Host "[OK] IAR IDE -> $($iarIde.FullName)" -ForegroundColor Green
|
|
}
|
|
}
|
|
}
|
|
if (-not $iarFound) {
|
|
Write-Host "[MISS] IAR Embedded Workbench for ARM" -ForegroundColor Red
|
|
Write-Host " Download: https://www.iar.com/embedded-development-tools/free-trials" -ForegroundColor Yellow
|
|
}
|
|
|
|
$at32Pack = $false
|
|
foreach ($base in $iarPaths) {
|
|
$ddf = Get-ChildItem -Path $base -Recurse -Filter "AT32F403AxC*.ddf" -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
if ($ddf) {
|
|
Write-Host "[OK] AT32 Device Pack -> $($ddf.DirectoryName)" -ForegroundColor Green
|
|
$at32Pack = $true
|
|
break
|
|
}
|
|
}
|
|
if (-not $at32Pack -and $iarFound) {
|
|
Write-Host "[MISS] AT32 IAR Device Pack (ArteryTek)" -ForegroundColor Red
|
|
Write-Host " Download: https://www.arterytek.com/cn/product/AT32F403A.jsp" -ForegroundColor Yellow
|
|
}
|
|
|
|
Write-Host ""
|
|
if (Test-Path "$projectRoot\project\IAR_V7.4\YNGJ-GT1-M.eww") {
|
|
Write-Host "[OK] Main project YNGJ-GT1-M.eww" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "[MISS] Main project file" -ForegroundColor Red
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "See DEVELOPMENT_SETUP.md for full setup guide." -ForegroundColor Cyan
|