AXIOM Beta/Developers

From apertus wiki
Revision as of 07:11, 8 February 2019 by Johnathan (talk | contribs) (Axiom Beta Developer's Guide)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Preamble

1 Firmware

1.1 Setup Development Environment

The camera firmware is developed using Xilinx Vivado Design Suite. To setup a development environment where you can modify FPGA related code and build a firmware BIT file, do the following:

1. Download and install Vivado. You can install a trial version that is good for 30 days but is otherwise unrestricted and will allow you to build the firmware. After that you can purchase a license, or use the WebPACK version for free. If you have purchased a Zedboard you may be eligible to receive a license included with your purchase.

2. Download the MicroZed Vivado board definition files. Extract the zip file and put the files in your Vivado installation directory ~data\boards\board_files.

3. Clone the beta git repo.

4. If necessary, you may need to update the BOARD_PART property in the build script of your cloned firmware repo vivado.tcl to match the version of your board definition files. To view of a list of valid board_parts you can enter the command get_board_parts in the Vivado Tcl Console. Make sure you have put the above board part files in the proper directory and the version board version is correct.

1.2 Building Firmware

The actual beta FPGA firmware is located under peripherals/soc_main, and is built using the Vivado build script vivado.tcl in that directory.

To build firmware (in directory where you checked out axiom-beta-firmware):

1. [axiom-beta-firmware] $ cd peripherals/soc_main

2. [soc_main] $ mkdir build && cd build

3. [build] $ vivado -source ../vivado.tcl (assuming vivado is in your PATH, on Linux it is normally installed under /tools/Xilinx/Vivado/<version>/bin/vivado)

Vivado should launch the GUI and begin building the source files. If successful, you should end up with a cmv_hdmi3.bit in your build directory. This is the actual firmware bitstream and can be copied to the camera directly for testing.

1.3 Testing Firmware

1.3.1 On Camera Hardware

Firmware bit files are normally installed to /opt/BITS on the camera. A symlink in the camera root user's home directory controls which bit is loaded to the FPGA on startup, and the camera needs to reboot when changing firmware. To test a built firmware bit file on camera hardware, do the following:

1. Transfer the firmware bit file to the camera. (in your build directory):

$ scp ./cmv_hdmi3.bit root@beta:/opt/BITS/cmv_hdmi3-test.bit

2. Delete the existing symlink and link to your new firmware bit file. (on the camera):

~$ rm -f cmv_hdmi3.bit && ln -s /opt/BITS/cmv_hdmi3-test.bit ./cmv_hdmi3.bit

3. Reboot the camera:

~$ sync && reboot now

If all goes well the camera should reboot and load your new development FPGA firmware.