diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3433092..1a829f57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -301,6 +301,318 @@ jobs: path: __Builds\installer\QTAC-windows-arm64.exe if-no-files-found: error + build-source-linux: + needs: [fetch-ftdi-linux, build-docs] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, ubuntu-latest] + qt_version: ['6.9.2', '6.10.0'] + + steps: + - uses: actions/checkout@v6 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y python3-pip wget libxkbcommon-x11-0 x11-common libxcb-xinerama0-dev build-essential libgl1-mesa-dev mesa-common-dev uuid-dev libpulse-dev ninja-build libudev-dev + + - name: Cache Qt installation on Linux + uses: actions/cache@v5 + with: + path: ${{ matrix.qt_version }}/gcc_64 + key: ${{ matrix.os }}-qt-${{ matrix.qt_version }} + + - name: Install aqtinstall + run: pip install aqtinstall + + - name: Install Qt ${{ matrix.qt_version }} on ${{ matrix.os }} + run: | + aqt install-qt linux desktop ${{ matrix.qt_version }} linux_gcc_64 -m qtmultimedia qtserialport + echo "QTBIN=$HOME/work/qcom-test-automation-controller/qcom-test-automation-controller/${{ matrix.qt_version }}/gcc_64/bin" >> $GITHUB_ENV + + - name: Restore FTDI archive on Linux + uses: actions/cache/restore@v5 + with: + path: third-party/libftd2xx-linux-x86_64-1.4.33.tgz + key: ftdi-linux-1.4.33 + + - name: Configure + run: | + export PATH="$QTBIN:$PATH" + cmake -S source -B build/source/Release \ + -DCMAKE_PREFIX_PATH="$(dirname $QTBIN)" \ + -DCMAKE_COLOR_DIAGNOSTICS=ON \ + -DCMAKE_GENERATOR=Ninja \ + -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: cmake --build build/source/Release + + - name: Run tests + run: | + cd build/source/Release + ctest --output-on-failure + + - name: Install patchelf + run: sudo apt-get install -y patchelf + + - name: Deploy Qt runtime + run: | + export PATH="$QTBIN:$PATH" + QT_ROOT="$(dirname $QTBIN)" + DEPLOY_BIN_DIR="source/__Builds/Linux/Release/bin" + DEPLOY_LIB_DIR="source/__Builds/Linux/Release/lib" + DEPLOY_PLUGIN_DIR="source/__Builds/Linux/Release/plugins" + mkdir -p "$DEPLOY_LIB_DIR" "$DEPLOY_PLUGIN_DIR" + find "$DEPLOY_BIN_DIR" -type f -executable -exec ldd {} \; 2>/dev/null \ + | awk '/=>/ {print $3}' | sort -u \ + | grep "$QT_ROOT" \ + | xargs -I{} cp -an {} "$DEPLOY_LIB_DIR/" || true + find "$QT_ROOT/lib" -maxdepth 1 -name "libQt6*.so*" -exec cp -an {} "$DEPLOY_LIB_DIR/" \; || true + find "$QT_ROOT/lib" -maxdepth 1 -name "libicu*.so*" -exec cp -an {} "$DEPLOY_LIB_DIR/" \; || true + for plugin_dir in iconengines imageformats platforminputcontexts platforms platformthemes xcbglintegrations; do + if [ -d "$QT_ROOT/plugins/$plugin_dir" ]; then + mkdir -p "$DEPLOY_PLUGIN_DIR/$plugin_dir" + cp -a "$QT_ROOT/plugins/$plugin_dir/." "$DEPLOY_PLUGIN_DIR/$plugin_dir/" + fi + done + find "$DEPLOY_BIN_DIR" -type f -executable | while read exe; do + patchelf --set-rpath '$ORIGIN/../lib' "$exe" || true + done + + - name: Download built docs artifact + uses: actions/download-artifact@v4 + with: + name: qtac-docs-html + path: docs-html + + - name: Replace docs source with built HTML + run: | + rm -rf docs + mv docs-html docs + + - name: Package QTAC (source) + run: | + chmod +x packaging/linux/package_QTAC.sh + PKG_NAME=qualcomm-qtac-source \ + SRC_DIR="$(pwd)/source/__Builds/Linux/Release" \ + ./packaging/linux/package_QTAC.sh + + - name: Package QTAC (source, no-GUI) + run: | + PKG_NAME=qualcomm-qtac-source-nogui \ + SRC_DIR="$(pwd)/source/__Builds/Linux/Release" \ + NO_GUI=1 \ + ./packaging/linux/package_QTAC.sh + + - name: Upload installer artifact + uses: actions/upload-artifact@v4 + with: + name: QTAC-source-${{ matrix.os }}-qt${{ matrix.qt_version }} + path: packaging/linux/build/*.deb + if-no-files-found: error + + build-source-windows: + needs: [fetch-ftdi-windows, build-docs] + runs-on: windows-2022 + strategy: + fail-fast: false + matrix: + qt_version: ['6.9.2', '6.10.0'] + + steps: + - uses: actions/checkout@v6 + + - name: Install Python dependencies + shell: pwsh + run: pip install aqtinstall + + - name: Cache Qt installation on Windows + uses: actions/cache@v5 + with: + path: C:\Qt\${{ matrix.qt_version }}\msvc2022_64 + key: ${{ runner.os }}-qt-${{ matrix.qt_version }} + + - name: Install Qt ${{ matrix.qt_version }} for MSVC + shell: pwsh + run: | + aqt install-qt windows desktop ${{ matrix.qt_version }} win64_msvc2022_64 --outputdir "C:\Qt" -m qtserialport qtmultimedia + echo "QTBIN=C:\Qt\${{ matrix.qt_version }}\msvc2022_64\bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Restore FTDI archive on Windows + uses: actions/cache/restore@v5 + with: + path: third-party\CDM-v2.12.36.4-WHQL-Certified.zip + key: ftdi-windows-2.12.36.4 + + - name: Install .NET Framework 4.8 Developer Pack + shell: pwsh + run: choco install netfx-4.8-devpack -y + + - name: Build (source) + shell: pwsh + run: | + $env:QTDIR = "C:\Qt\${{ matrix.qt_version }}\msvc2022_64" + .\build_app.ps1 + + - name: Run tests + shell: pwsh + run: | + cd build\Release + ctest --output-on-failure + + - name: Download built docs artifact + uses: actions/download-artifact@v4 + with: + name: qtac-docs-html + path: docs-html + + - name: Replace docs source with built HTML + shell: pwsh + run: | + Remove-Item -Recurse -Force docs + Move-Item docs-html docs + + - name: Deploy Qt runtime (source, x64) + shell: pwsh + run: | + $qtBin = "C:\Qt\${{ matrix.qt_version }}\msvc2022_64\bin" + $binDir = "source\__Builds\x64\Release\bin" + $env:PATH = "$qtBin;$env:PATH" + & "$qtBin\windeployqt.exe" --release --no-translations --no-system-d3d-compiler ` + (Get-ChildItem $binDir -Filter "*.exe" | Select-Object -First 1 -ExpandProperty FullName) + + - name: Build installer (QTAC-source-windows-x64.exe) + shell: pwsh + run: | + .\packaging\windows\build-installer.ps1 ` + -BinDir "source\__Builds\x64\Release\bin" + + - name: Build installer (QTAC-source-windows-x64-nogui.exe) + shell: pwsh + run: | + .\packaging\windows\build-installer.ps1 ` + -BinDir "source\__Builds\x64\Release\bin" ` + -NoGui + + - name: Upload installer artifact + uses: actions/upload-artifact@v4 + with: + name: QTAC-source-windows-x64-qt${{ matrix.qt_version }} + path: __Builds\installer\QTAC-windows-*.exe + if-no-files-found: error + + build-source-windows-arm64: + needs: [fetch-ftdi-windows-arm64, build-docs] + runs-on: windows-11-arm + strategy: + fail-fast: false + matrix: + qt_version: ['6.9.2', '6.10.0'] + + steps: + - uses: actions/checkout@v6 + + - name: Install Python dependencies + shell: pwsh + run: pip install aqtinstall + + - name: Cache Qt installation for ARM64 + uses: actions/cache@v5 + with: + path: C:\Qt\${{ matrix.qt_version }}\msvc2022_arm64 + key: windows-arm64-qt-${{ matrix.qt_version }} + + - name: Install Qt ${{ matrix.qt_version }} for MSVC ARM64 + shell: pwsh + run: | + aqt install-qt windows_arm64 desktop ${{ matrix.qt_version }} win64_msvc2022_arm64 --outputdir "C:\Qt" --autodesktop -m qtserialport qtmultimedia + echo "QTBIN=C:\Qt\${{ matrix.qt_version }}\msvc2022_arm64\bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Restore FTDI archive for ARM64 + uses: actions/cache/restore@v5 + with: + path: third-party\CDM-v2.12.36.20-for-ARM64-WHQL-Certified.zip + key: ftdi-windows-arm64-2.12.36.20 + + - name: Build (source) + shell: pwsh + run: | + $env:QTDIR = "C:\Qt\${{ matrix.qt_version }}\msvc2022_arm64" + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + $vsPath = "" + if (Test-Path $vswhere) { + $vsPath = & $vswhere -nologo -latest -property installationPath 2>$null + } + if (-not $vsPath) { + foreach ($e in @('Enterprise','Community','Professional')) { + $p = "C:\Program Files\Microsoft Visual Studio\2022\$e" + if (Test-Path $p) { $vsPath = $p; break } + } + } + if (-not $vsPath) { throw "VS2022 not found" } + $vcvarsall = "$vsPath\VC\Auxiliary\Build\vcvarsall.bat" + $envLines = cmd /c "`"$vcvarsall`" arm64 && set" 2>&1 + $envLines | Where-Object { $_ -match '^[A-Za-z_][A-Za-z0-9_]+=.' } | ForEach-Object { + $kv = $_ -split '=', 2 + if ($kv.Count -eq 2) { [System.Environment]::SetEnvironmentVariable($kv[0], $kv[1]) } + } + $qtRoot = $env:QTDIR + $env:PATH = "$qtRoot\bin;$env:PATH" + cmake -S source -B build\Release -DCMAKE_PREFIX_PATH="$qtRoot" -G Ninja -DCMAKE_BUILD_TYPE=Release + if ($LASTEXITCODE -ne 0) { throw "Configure failed" } + cmake --build build\Release + if ($LASTEXITCODE -ne 0) { throw "Build failed" } + + - name: Run tests + shell: pwsh + run: | + cd build\Release + ctest --output-on-failure + + - name: Download built docs artifact + uses: actions/download-artifact@v4 + with: + name: qtac-docs-html + path: docs-html + + - name: Replace docs source with built HTML + shell: pwsh + run: | + Remove-Item -Recurse -Force docs + Move-Item docs-html docs + + - name: Deploy Qt runtime (source, ARM64) + shell: pwsh + run: | + $qtBin = "C:\Qt\${{ matrix.qt_version }}\msvc2022_arm64\bin" + $binDir = "source\__Builds\ARM64\Release\bin" + $env:PATH = "$qtBin;$env:PATH" + & "$qtBin\windeployqt.exe" --release --no-translations --no-system-d3d-compiler ` + (Get-ChildItem $binDir -Filter "*.exe" | Select-Object -First 1 -ExpandProperty FullName) + + - name: Build installer (QTAC-source-windows-arm64.exe) + shell: pwsh + run: | + .\packaging\windows\build-installer.ps1 ` + -BinDir "source\__Builds\ARM64\Release\bin" + + - name: Build installer (QTAC-source-windows-arm64-nogui.exe) + shell: pwsh + run: | + .\packaging\windows\build-installer.ps1 ` + -BinDir "source\__Builds\ARM64\Release\bin" ` + -NoGui + + - name: Upload installer artifact + uses: actions/upload-artifact@v4 + with: + name: QTAC-source-windows-arm64-qt${{ matrix.qt_version }} + path: __Builds\installer\QTAC-windows-*.exe + if-no-files-found: error + publish-release-linux: name: Publish release (Linux) if: github.ref_type == 'tag' @@ -440,6 +752,143 @@ jobs: } } $assets = Get-ChildItem release-assets -File | ForEach-Object { $_.FullName } + gh release upload "$env:TAG" $assets ` + --repo "$env:GITHUB_REPOSITORY" ` + --clobber + + publish-release-source-linux: + name: Publish release (source Linux) + if: github.ref_type == 'tag' + needs: build-source-linux + runs-on: ubuntu-22.04 + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Verify tag is on main branch + id: verify_main + run: | + set -euo pipefail + git fetch origin main --quiet + if git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then + echo "Tagged commit $GITHUB_SHA is on main; proceeding with release." + echo "on_main=true" >> "$GITHUB_OUTPUT" + else + echo "Tagged commit $GITHUB_SHA is NOT on main; skipping release publish." + echo "on_main=false" >> "$GITHUB_OUTPUT" + fi + + - name: Download source Linux build artifacts + if: steps.verify_main.outputs.on_main == 'true' + uses: actions/download-artifact@v4 + with: + pattern: QTAC-source-*ubuntu* + path: release-artifacts + + - name: Flatten artifacts into a single directory + if: steps.verify_main.outputs.on_main == 'true' + run: | + set -euo pipefail + mkdir -p release-assets + find release-artifacts -mindepth 2 -type f -print0 | while IFS= read -r -d '' f; do + artifact_name="$(basename "$(dirname "$f")")" + filename="$(basename "$f")" + cp "$f" "release-assets/${artifact_name}_${filename}" + done + echo "Source Linux release assets to upload:" + ls -la release-assets + + - name: Ensure GitHub Release exists and upload assets + if: steps.verify_main.outputs.on_main == 'true' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ github.ref_name }} + run: | + set -euo pipefail + if ! gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then + gh release create "$TAG" \ + --repo "$GITHUB_REPOSITORY" \ + --title "$TAG" \ + --generate-notes || \ + gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1 + fi + gh release upload "$TAG" release-assets/* \ + --repo "$GITHUB_REPOSITORY" \ + --clobber + + publish-release-source-windows: + name: Publish release (source Windows) + if: github.ref_type == 'tag' + needs: [build-source-windows, build-source-windows-arm64] + runs-on: windows-2022 + permissions: + contents: write + steps: + - name: Checkout repository (full history) + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Verify tag is on main branch + id: verify_main + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + git fetch origin main --quiet + git merge-base --is-ancestor "$env:GITHUB_SHA" origin/main + if ($LASTEXITCODE -eq 0) { + Write-Host "Tagged commit $env:GITHUB_SHA is on main; proceeding with release." + "on_main=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + } else { + Write-Host "Tagged commit $env:GITHUB_SHA is NOT on main; skipping release publish." + "on_main=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + } + + - name: Download source Windows build artifacts + if: steps.verify_main.outputs.on_main == 'true' + uses: actions/download-artifact@v4 + with: + pattern: QTAC-source-windows-* + path: release-artifacts + + - name: Flatten artifacts into a single directory + if: steps.verify_main.outputs.on_main == 'true' + shell: pwsh + run: | + New-Item -ItemType Directory -Force -Path release-assets | Out-Null + Get-ChildItem release-artifacts -Directory | ForEach-Object { + $artifactName = $_.Name + Get-ChildItem $_.FullName -File -Recurse | ForEach-Object { + $target = Join-Path 'release-assets' ("${artifactName}_$($_.Name)") + Copy-Item $_.FullName $target -Force + } + } + Write-Host "Source Windows release assets to upload:" + Get-ChildItem release-assets | Format-Table -AutoSize + + - name: Ensure GitHub Release exists and upload assets + if: steps.verify_main.outputs.on_main == 'true' + shell: pwsh + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ github.ref_name }} + run: | + $ErrorActionPreference = 'Stop' + gh release view "$env:TAG" --repo "$env:GITHUB_REPOSITORY" 2>$null + if ($LASTEXITCODE -ne 0) { + gh release create "$env:TAG" ` + --repo "$env:GITHUB_REPOSITORY" ` + --title "$env:TAG" ` + --generate-notes + if ($LASTEXITCODE -ne 0) { + gh release view "$env:TAG" --repo "$env:GITHUB_REPOSITORY" + } + } + $assets = Get-ChildItem release-assets -File | ForEach-Object { $_.FullName } gh release upload "$env:TAG" $assets ` --repo "$env:GITHUB_REPOSITORY" ` --clobber \ No newline at end of file diff --git a/.semgrepignore b/.semgrepignore new file mode 100644 index 00000000..b6321b41 --- /dev/null +++ b/.semgrepignore @@ -0,0 +1,6 @@ +# Third-party code — not subject to Semgrep analysis +third-party/ + +# Vendor headers bundled with the source library +source/library/ftd2xx.h +source/library/WinTypes.h diff --git a/build_app.bat b/build_app.bat new file mode 100644 index 00000000..1ec30b5b --- /dev/null +++ b/build_app.bat @@ -0,0 +1,48 @@ +@echo off +setlocal + +:: Locate vcvars64 via vswhere (prefers newest VS install) +set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +if not exist "%VSWHERE%" ( + echo vswhere.exe not found. Is Visual Studio 2022 installed? + exit /b 1 +) +for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.VisualCpp.Tools.HostX64.TargetX64 -property installationPath`) do set "VS_INSTALLPATH=%%i" +if not defined VS_INSTALLPATH ( + echo No VS2022 install with VC++ x64 tools found. + exit /b 1 +) +call "%VS_INSTALLPATH%\VC\Auxiliary\Build\vcvars64.bat" >nul 2>&1 +echo vcvars loaded + +:: Locate Qt — honor QTDIR env var, else use default install location +if defined QTDIR ( + set "QTBIN=%QTDIR%\bin" +) else ( + :: Search for msvc2022_64 under C:\Qt + for /f "usebackq tokens=*" %%i in (`dir /b /s /ad "C:\Qt\msvc2022_64" 2^>nul`) do ( + if exist "%%i\bin\qmake.exe" set "QTROOT=%%i" & goto :qt_found + ) + echo Qt not found. Set QTDIR or install Qt to C:\Qt\ + exit /b 1 + :qt_found + set "QTBIN=%QTROOT%\bin" +) +set "PATH=%QTBIN%;%PATH%" + +cmake -S source -B build\Release -DCMAKE_PREFIX_PATH="%QTROOT%" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=cl > build_out.txt 2>&1 +if errorlevel 1 ( + echo CMAKE CONFIGURE FAILED + type build_out.txt + exit /b 1 +) + +cmake --build build\Release --target qtac-app TACDev test_tacdev_api test_hardware_psoc >> build_out.txt 2>&1 +if errorlevel 1 ( + echo CMAKE BUILD FAILED + type build_out.txt + exit /b 1 +) + +echo BUILD SUCCESS +type build_out.txt diff --git a/build_app.ps1 b/build_app.ps1 new file mode 100644 index 00000000..886eca8d --- /dev/null +++ b/build_app.ps1 @@ -0,0 +1,58 @@ +$ErrorActionPreference = 'Continue' +$root = $PSScriptRoot + +# Locate VS via vswhere +$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" +if (Test-Path $vswhere) { + $vsInstallPath = & $vswhere -latest -products * -requires Microsoft.VisualCpp.Tools.HostX64.TargetX64 -property installationPath + $vcvars = "$vsInstallPath\VC\Auxiliary\Build\vcvars64.bat" +} else { + $vcvars = @( + "${env:ProgramFiles}\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat", + "${env:ProgramFiles}\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat", + "${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat", + "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" + ) | Where-Object { Test-Path $_ } | Select-Object -First 1 +} +if (-not $vcvars -or -not (Test-Path $vcvars)) { Write-Error "vcvars64.bat not found - is VS2022 installed?"; exit 1 } + +# Locate Qt — honor QTDIR env var, else search standard install locations +if ($env:QTDIR -and (Test-Path "$env:QTDIR\bin\qmake.exe")) { + $qtRoot = $env:QTDIR +} else { + $qtRoot = Get-ChildItem 'C:\Qt' -Filter 'msvc2022_64' -Recurse -Depth 2 -Directory -ErrorAction SilentlyContinue | + Where-Object { Test-Path "$($_.FullName)\bin\qmake.exe" } | + Sort-Object FullName -Descending | + Select-Object -First 1 -ExpandProperty FullName +} +if (-not $qtRoot) { Write-Error "Qt not found. Set QTDIR or install Qt to C:\Qt\"; exit 1 } +$qtbin = "$qtRoot\bin" + +# Import MSVC environment +$envLines = cmd /c "`"$vcvars`" && set" 2>&1 +$envLines | Where-Object { $_ -match '^[A-Za-z_][A-Za-z0-9_]+=.' } | ForEach-Object { + $kv = $_ -split '=', 2 + if ($kv.Count -eq 2) { [System.Environment]::SetEnvironmentVariable($kv[0], $kv[1]) } +} +$env:PATH = "$qtbin;$env:PATH" +Write-Output "MSVC env loaded from: $vcvars" +Write-Output "Qt root: $qtRoot" +Write-Output "cl.exe: $((Get-Command cl.exe -ErrorAction SilentlyContinue).Source)" + +Set-Location $root + +# Configure +Write-Output "--- Configuring ---" +& cmake -S "source" -B "build\Release" "-DCMAKE_PREFIX_PATH=$qtRoot" -G Ninja -DCMAKE_BUILD_TYPE=Release +if ($LASTEXITCODE -ne 0) { Write-Error "Configure failed"; exit 1 } + +# Build qtac-app and TACDev +Write-Output "--- Building qtac-app ---" +& cmake --build "build\Release" --target qtac-app +if ($LASTEXITCODE -ne 0) { Write-Error "Build failed"; exit 1 } + +Write-Output "--- Building TACDev ---" +& cmake --build "build\Release" --target TACDev +if ($LASTEXITCODE -ne 0) { Write-Error "Build failed"; exit 1 } + +Write-Output "--- BUILD SUCCESS ---" diff --git a/build_tests.ps1 b/build_tests.ps1 new file mode 100644 index 00000000..98d521fe --- /dev/null +++ b/build_tests.ps1 @@ -0,0 +1,15 @@ +$ErrorActionPreference = 'Stop' +. "$PSScriptRoot\env_setup.ps1" + +$build = "$PSScriptRoot\build\Release" +$out = "$PSScriptRoot\build_out.txt" + +Write-Host "--- Configuring ---" +& cmake -S "$PSScriptRoot\source" -B "$build" "-DCMAKE_PREFIX_PATH=$qtRoot" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=cl 2>&1 | Tee-Object -FilePath $out +if ($LASTEXITCODE -ne 0) { Write-Error "Configure failed"; exit 1 } + +Write-Host "--- Building ---" +& cmake --build "$build" --target qtac-app TACDev test_tacdev_api test_hardware_psoc 2>&1 | Tee-Object -FilePath $out -Append +if ($LASTEXITCODE -ne 0) { Write-Error "Build failed"; exit 1 } + +Write-Host "BUILD SUCCESS" diff --git a/configurations/TAC_FTDI_13.tcnf b/configurations/TAC_FTDI_13.tcnf new file mode 100644 index 00000000..d1fa2dc5 --- /dev/null +++ b/configurations/TAC_FTDI_13.tcnf @@ -0,0 +1,551 @@ +{ + "author": "bryantf-qc", + "bus": [ + { + "bus": "A", + "bus_function": 1, + "chip_index": 0 + }, + { + "bus": "B", + "bus_function": 1, + "chip_index": 0 + }, + { + "bus": "C", + "bus_function": 2, + "chip_index": 0 + }, + { + "bus": "D", + "bus_function": 2, + "chip_index": 0 + } + ], + "buttons": [], + "chip_count": 1, + "creation_date": "Mon Jul 7 00:00:00 2026", + "description": "ALPACA LITE (FTDI) - default layout", + "fileVersion": 1, + "modification_date": "Mon Jul 7 00:00:00 2026", + "name": "ALPACA LITE (FTDI)", + "pins": [ + { + "bus": "A", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "0", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "A", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "1", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "A", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "2", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "A", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "3", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "A", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "4", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "A", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "5", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "A", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "6", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "A", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "7", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "B", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "0", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "B", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "1", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "B", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "2", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "B", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "3", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "B", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "4", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "B", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "5", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "B", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "6", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "B", + "chip_index": 0, + "command": "", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "", + "initial_value": false, + "input": false, + "inverted": false, + "name": "", + "pin_number": "7", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "C", + "chip_index": 0, + "command": "pshold", + "command_group": 2, + "enabled": true, + "group": "General", + "help_hint": "Force PS_HOLD to high", + "initial_value": false, + "input": true, + "inverted": false, + "name": "Force PS_HOLD High", + "pin_number": "0", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "C", + "chip_index": 0, + "command": "uim1", + "command_group": 2, + "enabled": true, + "group": "General", + "help_hint": "Disconnects the UIM 1", + "initial_value": false, + "input": true, + "inverted": false, + "name": "Disconnect UIM1", + "pin_number": "1", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "C", + "chip_index": 0, + "command": "headset", + "command_group": 2, + "enabled": true, + "group": "General", + "help_hint": "Disconnects headset", + "initial_value": false, + "input": true, + "inverted": false, + "name": "Headset Disconnect", + "pin_number": "2", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "C", + "chip_index": 0, + "command": "uim2", + "command_group": 2, + "enabled": true, + "group": "General", + "help_hint": "Disconnects the UIM 2", + "initial_value": false, + "input": true, + "inverted": false, + "name": "Disconnect UIM2", + "pin_number": "3", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "C", + "chip_index": 0, + "command": "sdcard", + "command_group": 2, + "enabled": true, + "group": "General", + "help_hint": "Disconnects the SD Card", + "initial_value": false, + "input": true, + "inverted": false, + "name": "Disconnect SD Card", + "pin_number": "4", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "C", + "chip_index": 0, + "command": "sedl", + "command_group": 2, + "enabled": true, + "group": "Fusion", + "help_hint": "Secondary Emergency Download Mode", + "initial_value": false, + "input": true, + "inverted": false, + "name": "Secondary Emergency Download Mode (EDL)", + "pin_number": "5", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "C", + "chip_index": 0, + "command": "usb1", + "command_group": 1, + "enabled": true, + "group": "General", + "help_hint": "Disconnects VBUS 1", + "initial_value": false, + "input": true, + "inverted": true, + "name": "USB 1 (VBUS Only)", + "pin_number": "6", + "priority": 2, + "run_priority": "-1,-1" + }, + { + "bus": "C", + "chip_index": 0, + "command": "sresn", + "command_group": 2, + "enabled": true, + "group": "Fusion", + "help_hint": "Fusion Secondary PM_RESIN_N", + "initial_value": false, + "input": true, + "inverted": false, + "name": "Secondary PM_RESIN_N_SEC", + "pin_number": "7", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "D", + "chip_index": 0, + "command": "volup", + "command_group": 3, + "enabled": true, + "group": "General", + "help_hint": "VOL_UP + PWR_ON = Held for boot to UEFI menu", + "initial_value": false, + "input": true, + "inverted": false, + "name": "Volume Up", + "pin_number": "0", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "D", + "chip_index": 0, + "command": "battery", + "command_group": 1, + "enabled": true, + "group": "General", + "help_hint": "Battery power off/on", + "initial_value": false, + "input": true, + "inverted": true, + "name": "Battery", + "pin_number": "1", + "priority": 2, + "run_priority": "-1,-1" + }, + { + "bus": "D", + "chip_index": 0, + "command": "voldn", + "command_group": 3, + "enabled": true, + "group": "General", + "help_hint": "(PM_RESIN_N) (Held to boot to fastboot)", + "initial_value": false, + "input": true, + "inverted": false, + "name": "Volume Down", + "pin_number": "2", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "D", + "chip_index": 0, + "command": "pkey", + "command_group": 3, + "enabled": true, + "group": "General", + "help_hint": "Power On (VOL_UP + PWR_ON = Held for boot to UEFI menu)", + "initial_value": false, + "input": true, + "inverted": false, + "name": "Power Key", + "pin_number": "3", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "D", + "chip_index": 0, + "command": "eud", + "command_group": 2, + "enabled": true, + "group": "General", + "help_hint": "Embedded USB Debug (EUD)", + "initial_value": false, + "input": true, + "inverted": false, + "name": "EUD", + "pin_number": "4", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "D", + "chip_index": 0, + "command": "pedl", + "command_group": 2, + "enabled": true, + "group": "General", + "help_hint": "Primary Emergency Download Mode", + "initial_value": false, + "input": true, + "inverted": false, + "name": "EDL", + "pin_number": "5", + "priority": -1, + "run_priority": "-1,-1" + }, + { + "bus": "D", + "chip_index": 0, + "command": "TC_READY_N", + "command_group": 0, + "enabled": false, + "group": "General", + "help_hint": "SW must program it to 1 to enable some output signals. False - Disables the control on some of the FTDI pins: DDBUS 0/2/4/7, CDBUS 0/2/4/7. True - Enable the control on all the FTDI pins.", + "initial_value": true, + "input": true, + "inverted": false, + "name": "TC_READY_N", + "pin_number": "6", + "priority": 1, + "run_priority": "-1,-1" + }, + { + "bus": "D", + "chip_index": 0, + "command": "usb0", + "command_group": 1, + "enabled": true, + "group": "General", + "help_hint": "Disconnects VBUS0", + "initial_value": false, + "input": false, + "inverted": true, + "name": "USB 0 (VBUS Only)", + "pin_number": "7", + "priority": 2, + "run_priority": "-1,-1" + } + ], + "platform_id": 13, + "platform_type": "FTDI", + "reset_enabled": false, + "script": "", + "tabs": [] +} diff --git a/configurations/TAC_FTDI_65.tcnf b/configurations/TAC_FTDI_65.tcnf index 1a15d85f..143c7675 100644 --- a/configurations/TAC_FTDI_65.tcnf +++ b/configurations/TAC_FTDI_65.tcnf @@ -532,15 +532,15 @@ { "bus": "D", "chip_index": 0, - "command": "", + "command": "ftdi_en", "command_group": 0, "enabled": true, - "group": "