The AWX Starter Kit facilitates remote debugging of custom Audio object code on the hardware with VS Code using a VS Code workspace and debug configurations that are included in the GTT installation.
Running a remote debug session requires some essential Linux packages to be present on the Raspberry Pi, which are pre-installed in the custom Raspberry PI image <download link>. When using the official Raspbian OS, these packages can be installed using the SKUtility tool by running the command.
python3 SKUtility.py dev -stp
The Raspberry Pi must be connected to the internet to install the required packages.
Running a Debug Session for the Custom AWX External Object
The below steps illustrate how to start a remote debug session and step-through the source code of the custom AWX External Object in an SFD on the Starter Kit hardware.
- First, set the Starter Kit to developer mode using the interactive configuration as explained in Starter Kit Utility Tool.
- Build the AWX Amp application in “debug” mode, flash it on to the Starter Kit, and start the AWX Amp application on the Starter Kit hardware by running the following commands.
python3 SKUtility.py dev -pr rpiVirtualAmp -b -d
python3 SKUtility.py dev -pr rpiVirtualAmp -f -d
python3 SKUtility.py dev -r
- Now, in the GTT window, include the AWX External Object from the toolbox into the SFD, save the SFD and click “Send Device Config” from the “Device Designer” tab of GTT to flash the SFD on to the Starter Kit.
- Open a new window of VS Code, go to File > Open Workspace from File, and select the VS Code workspace file named “StartKitDebug.code-workspace” in “StarterKit” directory of the installation directory.
- Open the AWX External Object source file “external\src\AwxAudioObjExt\generic\AwxAudioObjExt.cpp” from the file tree.
- Place breakpoints in the source code by clicking to the left of the line number intended as shown below (line 42):
- Press the “F5” key to start the debug session. This step makes use of the following files to first start a “gdbserver” on the Starter Kit hardware, and thstarts a debug session on VS Code that attaches to the remote gdbserver.
StarterKit\StarterKitUtility\.vscode\launch.json
StarterKit\StarterKitUtility\.vscode\tasks.json
Once the debug session has started, the code will stop at the placed breakpoints as shown below.