Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 62 additions & 50 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause

name: CMake Build

on: [push, pull_request]
Expand Down Expand Up @@ -37,6 +40,23 @@
shell: pwsh
run: curl --ssl-no-revoke "https://web.archive.org/web/20250820134143/https://ftdichip.com/wp-content/uploads/2023/09/CDM-v2.12.36.4-WHQL-Certified.zip" -o "third-party\CDM-v2.12.36.4-WHQL-Certified.zip"

fetch-ftdi-windows-arm64:
runs-on: windows-11-arm
steps:
- uses: actions/checkout@v6

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: yaml.github-actions.security.github-actions-mutable-action-tag.github-actions-mutable-action-tag

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.

- name: Cache FTDI archive for ARM64
id: cache-ftdi-windows-arm64
uses: actions/cache@v5

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: yaml.github-actions.security.github-actions-mutable-action-tag.github-actions-mutable-action-tag

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608`.
with:
path: third-party\CDM-v2.12.36.20-for-ARM64-WHQL-Certified.zip
key: ftdi-windows-arm64-2.12.36.20

- name: Download FTDI archive for ARM64
if: steps.cache-ftdi-windows-arm64.outputs.cache-hit != 'true'
shell: pwsh
run: curl --ssl-no-revoke "https://web.archive.org/web/20250821211500/https://ftdichip.com/wp-content/uploads/2025/03/CDM-v2.12.36.20-for-ARM64-WHQL-Certified.zip" -o "third-party\CDM-v2.12.36.20-for-ARM64-WHQL-Certified.zip"

build-linux:
needs: fetch-ftdi-linux
runs-on: ${{ matrix.os }}
Expand All @@ -45,15 +65,14 @@
matrix:
os: [ubuntu-22.04, ubuntu-latest]
qt_version: ['6.9.2', '6.10.0']
build_type: [Debug, Release]

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
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

- name: Cache Qt installation on Linux
uses: actions/cache@v5
Expand All @@ -66,29 +85,17 @@

- name: Install Qt ${{ matrix.qt_version }} on ${{ matrix.os }}
run: |
aqt install-qt linux desktop ${{ matrix.qt_version }} linux_gcc_64
aqt install-qt linux desktop ${{ matrix.qt_version }} linux_gcc_64 -m qtmultimedia qtserialport
echo "QT_ROOT_DIR=$HOME/work/qcom-test-automation-controller/qcom-test-automation-controller/${{ matrix.qt_version }}/gcc_64" >> $GITHUB_ENV
echo "$HOME/work/qcom-test-automation-controller/qcom-test-automation-controller/${{ matrix.qt_version }}/gcc_64/bin" >> $GITHUB_PATH
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: Extract FTDI library on Linux
run: |
mkdir -p __Builds/Linux/Debug/lib __Builds/Linux/Release/lib
tar -xvf third-party/libftd2xx-linux-x86_64-1.4.33.tgz -C third-party/
find third-party/ -name "libftd2xx-static.a" -exec cp {} __Builds/Linux/Debug/lib/libftd2xx.a \;
cp __Builds/Linux/Debug/lib/libftd2xx.a __Builds/Linux/Release/lib/libftd2xx.a

- name: Configure CMake for ${{ matrix.build_type }}
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_PREFIX_PATH="$QT_ROOT_DIR/lib/cmake"

- name: Build with ${{ matrix.build_type }}
run: cmake --build build --config ${{ matrix.build_type }}
- name: Build
run: ./build.sh

build-windows:
needs: fetch-ftdi-windows
Expand All @@ -97,7 +104,6 @@
fail-fast: false
matrix:
qt_version: ['6.9.2', '6.10.0']
build_type: [Debug, Release]

steps:
- uses: actions/checkout@v6
Expand All @@ -116,45 +122,51 @@
shell: pwsh
run: |
aqt install-qt windows desktop ${{ matrix.qt_version }} win64_msvc2022_64 --outputdir "C:\Qt" -m qtserialport qtmultimedia

$qtRoot = "C:\Qt\${{ matrix.qt_version }}\msvc2022_64"
echo "QT_ROOT_DIR=$qtRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "$qtRoot\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
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: Extract FTDI library on Windows
shell: pwsh
run: |
$debugLib = "__Builds\x64\Debug\lib"
$releaseLib = "__Builds\x64\Release\lib"
$debugBin = "__Builds\x64\Debug\bin"
$releaseBin = "__Builds\x64\Release\bin"
New-Item -ItemType Directory -Force -Path $debugLib, $releaseLib, $debugBin, $releaseBin | Out-Null

$tmp = "third-party\ftdi_extract"
Expand-Archive -Path "third-party\CDM-v2.12.36.4-WHQL-Certified.zip" -DestinationPath $tmp -Force

$lib = Get-ChildItem -Path $tmp -Filter "ftd2xx.lib" -Recurse | Where-Object { $_.FullName -match "amd64" } | Select-Object -First 1
if (-not $lib) { $lib = Get-ChildItem -Path $tmp -Filter "ftd2xx.lib" -Recurse | Select-Object -First 1 }
Copy-Item $lib.FullName -Destination $debugLib
Copy-Item $lib.FullName -Destination $releaseLib

$dll = Get-ChildItem -Path $tmp -Filter "FTD2XX64.dll" -Recurse | Select-Object -First 1
if ($dll) {
Copy-Item $dll.FullName -Destination "$debugBin\ftd2xx.dll"
Copy-Item $dll.FullName -Destination "$releaseBin\ftd2xx.dll"
}
Remove-Item -Recurse -Force $tmp

- name: Configure CMake for ${{ matrix.build_type }}
- name: Build
shell: cmd
run: build.bat

build-windows-arm64:
needs: fetch-ftdi-windows-arm64
runs-on: windows-11-arm
strategy:
fail-fast: false
matrix:
qt_version: ['6.9.2', '6.10.0']

steps:
- uses: actions/checkout@v6

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: yaml.github-actions.security.github-actions-mutable-action-tag.github-actions-mutable-action-tag Warning

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.

- name: Install Python dependencies
shell: pwsh
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_PREFIX_PATH="$env:QT_ROOT_DIR\lib\cmake"
run: pip install aqtinstall

- name: Build with ${{ matrix.build_type }}
- name: Cache Qt installation for ARM64
uses: actions/cache@v5

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: yaml.github-actions.security.github-actions-mutable-action-tag.github-actions-mutable-action-tag Warning

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.
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: cmake --build build --config ${{ matrix.build_type }}
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

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: yaml.github-actions.security.github-actions-mutable-action-tag.github-actions-mutable-action-tag Warning

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.
with:
path: third-party\CDM-v2.12.36.20-for-ARM64-WHQL-Certified.zip
key: ftdi-windows-arm64-2.12.36.20

- name: Build
shell: cmd
run: build.bat
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ ui_*
**/*/dist
__pycache__/
.pytest_cache/
*.egg-info/
*.pyc
*.pyo
*.pyd

# MCP logs
examples/MCP/**/*.log

# Qt build directory
__Builds/
Expand Down
35 changes: 2 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,5 @@
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the
# disclaimer below) provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# * Neither the name of Qualcomm Technologies, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
# GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
# HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Author: Biswajit Roy (biswroy@qti.qualcomm.com)
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause

cmake_minimum_required(VERSION 3.22)
project(QTAC-Workspace VERSION 1.0 LANGUAGES CXX)
Expand Down
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,26 @@ QTAC is a software suite that enables users to control Qualcomm devices remotely
| **OS** | Windows / Debian | Windows 10+ / Ubuntu 22.04+ |
| **Compiler** | [MSVC 2022](https://aka.ms/vs/17/release/vs_community.exe) / GCC | MSVC 2022 / GCC-11, G++-11, GLIBC-2.35 |
| **Build System** | [CMake](https://cmake.org/download/) | 3.22+ |
| **Build Tool** | [Ninja](https://ninja-build.org/) (via Qt installer, system package manager, or direct download) | 1.10+ |
| **UI Framework** | [Qt Open-source](https://www.qt.io/download-qt-installer-oss) | 6.9.0+ |

> [!NOTE]
> Review license terms for [Visual Studio](https://visualstudio.microsoft.com/license-terms/) and [Qt](https://www.qt.io/development/download-open-source). MSVC 2022 is linked as Qt doesn't support MSVC 2026 yet.
> Review license terms for [Visual Studio](https://visualstudio.microsoft.com/license-terms/) and [Qt](https://www.qt.io/development/download-open-source). MSVC 2022 is linked as Qt does not yet support later MSVC versions.

### Drivers

- **[FTDI D2XX drivers](https://ftdichip.com/drivers/d2xx-drivers/)**: For debug board interaction.
- **[Qualcomm USB Drivers](https://softwarecenter.qualcomm.com/catalog/item/Qualcomm_Userspace_Driver)**: To view device status.

> [!NOTE]
> FTDI libraries are installed _automatically_ during the cmake configuration step when building from source.
> FTDI libraries are downloaded _automatically_ during the cmake configuration step when building from source.
> If the automatic download fails (e.g. due to network restrictions), download the archive manually and place it in the `third-party/` directory before re-running cmake:
>
> | Platform | Archive |
> | :-- | :-- |
> | **Windows x64** | [`CDM-v2.12.36.4-WHQL-Certified.zip`](https://web.archive.org/web/20250820134143/https://ftdichip.com/wp-content/uploads/2023/09/CDM-v2.12.36.4-WHQL-Certified.zip) |
> | **Windows ARM64** | [`CDM-v2.12.36.20-for-ARM64-WHQL-Certified.zip`](https://web.archive.org/web/20250821211500/https://ftdichip.com/wp-content/uploads/2025/03/CDM-v2.12.36.20-for-ARM64-WHQL-Certified.zip) |
> | **Linux x86_64** | [`libftd2xx-linux-x86_64-1.4.33.tgz`](https://web.archive.org/web/20250822044524/https://ftdichip.com/wp-content/uploads/2025/03/libftd2xx-linux-x86_64-1.4.33.tgz) |

### Optional Software

Expand All @@ -84,29 +92,39 @@ git clone https://github.com/qualcomm/qcom-test-automation-controller.git
1. **Visual Studio**: Install **Desktop development with C++** and **.NET desktop development**.
![Desktop development with C++](./docs/resources/qtac-msvc-2022-requirements.png)
2. **Qt**: Install Qt 6.9+ for **MSVC 2022 64-bit**, **Qt Serial Port** and **Qt Multimedia** components.
For ARM64, also install the **MSVC 2022 ARM64** Qt component.

> [!NOTE]
> Installation using Qt Online Installer will require users to create a Qt account.
3. **Environment Variable**:

**x64**:
```cmd
setx QTBIN C:\Qt\<version>\msvc2022_64\bin
```
**ARM64**:
```cmd
setx QTBIN C:\Qt\<version>\msvc2022_arm64\bin
```

### Build & Usage

Execute `build.bat` to generate executables:
Execute `build.bat` to generate executables. The build targets the host architecture automatically (x64 on an x64 host, ARM64 on an ARM64 host):

```cmd
build.bat
```

**Build output**:
- Debug: `__Builds\x64\Debug`
- Release: `__Builds\x64\Release`
- x64 Debug: `__Builds\x64\Debug`
- x64 Release: `__Builds\x64\Release`
- ARM64 Debug: `__Builds\ARM64\Debug`
- ARM64 Release: `__Builds\ARM64\Release`

**Usage**:
```cmd
__Builds\x64\Release\QTAC.exe
__Builds\ARM64\Release\QTAC.exe
```

## Linux Guide
Expand All @@ -132,7 +150,7 @@ __Builds\x64\Release\QTAC.exe
sudo cp udev-rules/99-QTAC-USB.rules /etc/udev/rules.d/
sudo udevadm control --reload
```
4. **Environment Variable**:
3. **Environment Variable**:
```bash
export QTBIN=/path/to/Qt/directory/<version>/gcc_64/bin
```
Expand All @@ -149,9 +167,6 @@ Execute `build.sh` to generate executables:
- Debug: `__Builds/Linux/Debug`
- Release: `__Builds/Linux/Release`

> [!NOTE]
> Ensure that [make](https://www.gnu.org/software/make/) is available in your environment before building.

**Usage**:
```bash
./__Builds/Linux/Release/QTAC
Expand Down
Loading
Loading