Getting Started
This getting started guide walks through two separate applications: Camera-Platform and okCameraApp.
- The Camera-Platform application is built using FrontPanel Platform. It is built with TypeScript, JavaScript, HTML, and CSS, and uses the Platform API to communicate with FrontPanel devices. You might choose this approach if you want faster time to market, easier customization, and access to modern UI features.
- The okCameraApp application is built using the wxWidgets cross-platform C++ GUI class library. You might choose this approach if you want maximum performance.
Note: Be sure to follow the tutorial for the application you’re interested in (Camera-Platform or okCameraApp). Each has its own setup steps.
Camera-Platform (TypeScript/JavaScript)
Running the Pre-built FrontPanel App
Requirements
- FrontPanel v6.0.0 (beta) or later
Camera-ExampleDesign-vX.Y.asarfrom the latest Camera-ExampleDesign-vX.Y GitHub release.- XEM8320-AU25P
- SZG-Camera on Port A of the XEM8320-AU25P
Steps
- Open the FrontPanel Platform application.
- Install the Camera app by clicking the ‘+’ button in the Installed Applications panel. Then locate the
Camera-ExampleDesign-vX.Y.asarfile you downloaded from the latest Camera-ExampleDesign-vX.Y release. For more details, see Building the Template App Guide. - Install the SZG-Camera onto Port A of the XEM8320-AU25P.
- Connect the XEM8320 device to your PC.
- Power on the XEM8320.
- Click and drag the Camera Application card to the available XEM8320 device.
Building the FrontPanel App
Requirements
- Latest Camera-ExampleDesign-vX.Y release Source Code (zip or tar.gz)
szg-camera-xem8320.bitfrom theCamera-ExampleDesign-vX.Y-Bitfiles.zipbundle located in the latest Camera-ExampleDesign-vX.Y release- Install prerequisites from the Building the Template App guide.
- FrontPanel 6.0.0 installed
Steps
- Open Folder: Open the
ExampleProjects/Camera/Software/FP-Platformfolder in Visual Studio Code. This file is located in the Camera-ExampleDesign-vX.Y release Source Code. - Add Prebuilt Bitfile: Copy the
szg-camera-xem8320.bitto theassetsfolder. - Install Dependencies: Run
npm installwithin a Visual Studio command terminal. - Build Project: Run
npm run packwithin a Visual Studio command terminal. - Locate Output: The
app.asarfile is located in theoutputfolder. - Start FrontPanel Platform: Open FrontPanel Platform Application.
- Install Application: Install the app.asar by clicking the ‘+’ button in the Installed Applications panel of the FrontPanel Platform. For more details, see Building the Template App Guide.
- Run Application: Click and drag the Camera Application card to an available XEM8320 device.
okCameraApp (C++)
Resources
- Source files are available on GitHub at Camera.
- Pre-built binaries are attached as GitHub releases and can be found at GitHub Releases.
Windows Platforms
Running the Pre-built Application
- You require a compatible board and camera. You can see which products are compatible, and with which applications, in the support matrix located in the release notes.
- Connect Camera to Board
- If using the XEM7320, install the SZG-CAMERA on SYZYGY Port A.
- If using the XEM8320, install the SZG-CAMERA or SZG-MIPI-8320 on SYZYGY Port A.
- For all other boards and camera hardware, there is only one way to connect them — simply attach the board and camera together as instructed.
- Install FrontPanel SDK
- Obtain the following from wxWidgets 3.2.0 release Github:
wxMSW-3.2.0_vc14x_ReleaseDLL.7z(For x32)wxMSW-3.2.0_vc14x_x64_ReleaseDLL.7z(For x64)
- Unzip to a common location, i.e.
C:\wxWidgets-3.2.0 - Depending on your build target, add the following directories to the PATH environment variable:
- For x64 (64-bit):
C:\wxWidgets-3.2.0\lib\vc14x_x64_dllC:\Program Files\Opal Kelly\FrontPanelUSB\API\lib\x64
(Use the location of your FrontPanel SDK install directory)
- For x32 (32-bit):
C:\wxWidgets-3.2.0\lib\vc14x_dllC:\Program Files\Opal Kelly\FrontPanelUSB\API\lib\Win32
(Use the location of your FrontPanel SDK install directory)
- For x64 (64-bit):
- Prepare the bitfiles (two possible methods):
- Method 1 (executable directory):
- Download all the pre-built bitfiles included in the Camera-ExampleDesign-vX.Y GitHub Releases.
- Create a directory named
Bitfilesat the same directory level asokCameraApp.exe. - Place all the downloaded bitfiles into this
Bitfilesdirectory. - The application will automatically look for FPGA bitfiles in this location.
- Method 2 (custom directory and environment variable):
- Download all the pre-built bitfiles included in the Camera-ExampleDesign-vX.Y GitHub Releases.
- Create a directory with any name you choose, and place it anywhere on your system.
- Copy the pre-built bitfiles into this directory.
- Set the environment variable
okCAMERA_BITFILES_DIRto point to this directory. - The application will then look for FPGA bitfiles in the location you specify.
- Method 1 (executable directory):
- Run the application.
Building the C++ Source
- Install FrontPanel SDK
- Obtain the following from wxWidgets 3.2.0 release Github:
wxWidgets-3.2.0-headers.7zwxMSW-3.2.0_vc14x_Dev.7z(For x32)wxMSW-3.2.0_vc14x_x64_Dev.7z(For x64)
- Unzip to a common location, i.e.
c:\wxWidgets-3.2.0 - Set
WXWINenvironment variable toc:\wxWidgets-3.2.0 - set
okFP_SDKenvironment variable to the location of the SDK’sAPIfolder, i.e.C:\Program Files\Opal Kelly\FrontPanelUSB\API - Open
Software\Camera.slnfile in Visual Studio and build it.- Building in
Releaseconfiguration is recommended for best performance. - Building in
Debugconfiguration is recommended for troubleshooting. See “Debug” section below.
- Building in
- When running from the Visual Studio output directory, you will need access to bitfiles. You can use the provided pre-built bitfiles from the GitHub release:
- Download all the pre-built bitfiles included in the Camera-ExampleDesign-vX.Y GitHub Releases.
- Create a directory with any name you choose, and place it anywhere on your system.
- Copy the pre-built bitfiles into this directory.
- Set the environment variable
okCAMERA_BITFILES_DIRto point to this directory. - The application will then look for FPGA bitfiles in the location you specify.
Linux Platforms
Install wxWidgets
The latest camera example design includes pre-built applications that were built using Ubuntu 20.04 and wxWidgets 3.2. To install wxWidgets 3.2, execute the following sequence of commands:
sudo apt install ca-certificatessudo apt-key adv --fetch-keys https://repos.codelite.org/CodeLite.ascsudo apt-add-repository 'deb https://repos.codelite.org/wx3.2.0/ubuntu/ focal universe'sudo apt updatesudo apt install libudev-dev libwxgtk3.2unofficial-dev
Running the Pre-built Application (Ubuntu 20.04)
- You require a compatible board and camera. You can see which products are compatible, and with which applications, in the support matrix located in the release notes.
- Connect Camera to Board
- Install wxWidgets (see above)
- Install FrontPanel SDK
- Prepare the bitfiles (two possible methods):
- Method 1 (executable directory):
- Download all the pre-built bitfiles included in the Camera-ExampleDesign-vX.Y GitHub Releases.
- Create a directory named
Bitfilesat the same directory level as theokCameraAppapplication. - Place all the downloaded bitfiles into this
Bitfilesdirectory. - The application will automatically look for FPGA bitfiles in this location.
- Method 2 (custom directory and environment variable):
- Download all the pre-built bitfiles included in the Camera-ExampleDesign-vX.Y GitHub Releases.
- Create a directory with any name you choose, and place it anywhere on your system.
- Copy the pre-built bitfiles into this directory.
- Set the environment variable
okCAMERA_BITFILES_DIRto point to this directory. - The application will then look for FPGA bitfiles in the location you specify.
- Method 1 (executable directory):
- Run the application.
Building the C++ Source
- Install wxWidgets (see above).
- Install FrontPanel SDK
- Run the provided makefile.
cd SoftwaremakeDEBUG=1on make command line is recommended for troubleshooting. See “Debug” section below.
- When running from the build output directory, you will need access to bitfiles. You can use the provided pre-built bitfiles from the GitHub release:
- Download all the pre-built bitfiles included in the Camera-ExampleDesign-vX.Y GitHub Releases.
- Create a directory with any name you choose, and place it anywhere on your system.
- Copy the pre-built bitfiles into this directory.
- Set the environment variable
okCAMERA_BITFILES_DIRto point to this directory. - The application will then look for FPGA bitfiles in the location you specify.
Debug
When building okCameraApp for debugging, the program needs to find the resource.xrc file during execution. If it is not found in the default location, okCAMERA_RESOURCES_DIR environment variable can be used to specify its directory, e.g.
okCAMERA_RESOURCES_DIR=`pwd`/okCameraApp ./bin/okCameraApp
Note that in release/production builds, the resource file is embedded directly into the application executable (or application bundle under macOS) and this environment variable is not used.
Building the Gateware
All 7-Series and UltraScale devices provide a TCL script build method to generate the required IPs and import the required source files for the Vivado project mode work flow. These brief instructions presume you already have familiarity with the FrontPanel SDK and Vivado.
- Open Vivado GUI and use the TCL console to
cdto theHDLfolder for your target integration configuration:cd <Camera Reference Design Installation Directory>/HDL/XEM8320/SZG-Camera - Run the provide TCL script. If the product is offered in multiple device densities then use the TCL script with the correct suffix that applies for your product:
source project.tcl - Import FrontPanel HDL for your product into the project. These sources are located within the FrontPanel SDK installation. Files are located at the following:
<FrontPanel Installation Directory>/FrontPanelUSB/FrontPanelHDL/XEM8320-AU25P/Vivado-2021 - Generate Bitstream.