85 lines
2.9 KiB
PowerShell
85 lines
2.9 KiB
PowerShell
#Requires -Version 5.1
|
|
<#
|
|
.SYNOPSIS
|
|
检查 YNGJ-GT1-M AT32F403ARCT7 工程开发环境是否就绪
|
|
#>
|
|
|
|
$ErrorActionPreference = "SilentlyContinue"
|
|
$projectRoot = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
|
|
if (-not (Test-Path "$projectRoot\project\IAR_V7.4\YNGJ-GT1-M.eww")) {
|
|
$projectRoot = Split-Path $PSScriptRoot -Parent
|
|
}
|
|
|
|
Write-Host "=== YNGJ-GT1-M 开发环境检查 ===" -ForegroundColor Cyan
|
|
Write-Host "工程路径: $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 "[缺失] $name" -ForegroundColor Red
|
|
return $false
|
|
}
|
|
}
|
|
|
|
# Git
|
|
Test-Command "Git" "git" | Out-Null
|
|
|
|
# J-Link
|
|
$jlink = Test-Command "J-Link" "JLink"
|
|
if (-not $jlink) {
|
|
Write-Host " 安装: winget install NordicSemiconductor.JLink" -ForegroundColor Yellow
|
|
}
|
|
|
|
# IAR - search common install paths
|
|
$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 "[缺失] IAR Embedded Workbench for ARM" -ForegroundColor Red
|
|
Write-Host " 下载: https://www.iar.com/embedded-development-tools/free-trials" -ForegroundColor Yellow
|
|
}
|
|
|
|
# AT32 Device Pack - check for ArteryTek DDF in IAR config
|
|
$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 "[缺失] AT32 IAR Device Pack (ArteryTek)" -ForegroundColor Red
|
|
Write-Host " 下载: https://www.arterytek.com/cn/product/AT32F403A.jsp" -ForegroundColor Yellow
|
|
}
|
|
|
|
# Project files
|
|
Write-Host ""
|
|
if (Test-Path "$projectRoot\project\IAR_V7.4\YNGJ-GT1-M.eww") {
|
|
Write-Host "[OK] 主工程 YNGJ-GT1-M.eww" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "[缺失] 主工程文件" -ForegroundColor Red
|
|
}
|
|
|
|
Write-Host "`n详细配置说明见: DEVELOPMENT_SETUP.md" -ForegroundColor Cyan
|