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

Steps

  1. Open the FrontPanel Platform application.
  2. Install the Camera app by clicking the ‘+’ button in the Installed Applications panel. Then locate the Camera-ExampleDesign-vX.Y.asar file you downloaded from the latest Camera-ExampleDesign-vX.Y release. For more details, see Building the Template App Guide.
  3. Install the SZG-Camera onto Port A of the XEM8320-AU25P.
  4. Connect the XEM8320 device to your PC.
  5. Power on the XEM8320.
  6. Click and drag the Camera Application card to the available XEM8320 device.

Building the FrontPanel App

Requirements

Steps

  1. Open Folder: Open the ExampleProjects/Camera/Software/FP-Platform folder in Visual Studio Code. This file is located in the Camera-ExampleDesign-vX.Y release Source Code.
  2. Add Prebuilt Bitfile: Copy the szg-camera-xem8320.bit to the assets folder.
  3. Install Dependencies: Run npm install within a Visual Studio command terminal.
  4. Build Project: Run npm run pack within a Visual Studio command terminal.
  5. Locate Output: The app.asar file is located in the output folder.
  6. Start FrontPanel Platform: Open FrontPanel Platform Application.
  7. 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.
  8. 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

  1. 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.
  2. 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.
  3. Install FrontPanel SDK
  4. 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)
  5. Unzip to a common location, i.e. C:\wxWidgets-3.2.0
  6. 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_dll
      • C:\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_dll
      • C:\Program Files\Opal Kelly\FrontPanelUSB\API\lib\Win32
        (Use the location of your FrontPanel SDK install directory)
  7. 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 Bitfiles at the same directory level as okCameraApp.exe.
      • Place all the downloaded bitfiles into this Bitfiles directory.
      • 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_DIR to point to this directory.
      • The application will then look for FPGA bitfiles in the location you specify.
  8. Run the application.

Building the C++ Source

  1. Install FrontPanel SDK
  2. Obtain the following from wxWidgets 3.2.0 release Github:
    • wxWidgets-3.2.0-headers.7z
    • wxMSW-3.2.0_vc14x_Dev.7z (For x32)
    • wxMSW-3.2.0_vc14x_x64_Dev.7z (For x64)
  3. Unzip to a common location, i.e. c:\wxWidgets-3.2.0
  4. Set WXWIN environment variable to c:\wxWidgets-3.2.0
  5. set okFP_SDK environment variable to the location of the SDK’s API folder, i.e. C:\Program Files\Opal Kelly\FrontPanelUSB\API
  6. Open Software\Camera.sln file in Visual Studio and build it.
    • Building in Release configuration is recommended for best performance.
    • Building in Debug configuration is recommended for troubleshooting. See “Debug” section below.
  7. 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_DIR to point to this directory.
    • The application will then look for FPGA bitfiles in the location you specify.

Note

Camera.sln uses Visual Studio 2019 toolset by default, but should also be usable with both older and newer versions. See the Visual Studio documentation and communities for additional information.

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:

  1. sudo apt install ca-certificates
  2. sudo apt-key adv --fetch-keys https://repos.codelite.org/CodeLite.asc
  3. sudo apt-add-repository 'deb https://repos.codelite.org/wx3.2.0/ubuntu/ focal universe'
  4. sudo apt update
  5. sudo apt install libudev-dev libwxgtk3.2unofficial-dev

Running the Pre-built Application (Ubuntu 20.04)

  1. 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.
  2. Connect Camera to Board
  3. Install wxWidgets (see above)
  4. Install FrontPanel SDK
  5. 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 Bitfiles at the same directory level as the okCameraApp application.
      • Place all the downloaded bitfiles into this Bitfiles directory.
      • 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_DIR to point to this directory.
      • The application will then look for FPGA bitfiles in the location you specify.
  6. Run the application.

Building the C++ Source 

  1. Install wxWidgets (see above).
  2. Install FrontPanel SDK
  3. Run the provided makefile.
    1. cd Software
    2. make 
    3. DEBUG=1 on make command line is recommended for troubleshooting. See “Debug” section below.
  4. 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_DIR to 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.

  1. Open Vivado GUI and use the TCL console to cd to the HDL folder for your target integration configuration:
    cd <Camera Reference Design Installation Directory>/HDL/XEM8320/SZG-Camera
  2. 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
  3. 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
  4. Generate Bitstream.