A collection of scripts that are helpful for setting up and debugging the NeTV2.
Most of these are openocd config scripts. Note that it assumes you have a symlink to alphamax-rpi.cfg installed in ${INSTALLDIR}/interface/.
If you compiled using this configuration:
./configure --enable-bcm2835gpio --enable-sysfsgpio --disable-werror --prefix=/opt/openocd
You would need to put the symlink in this directory:
/opt/openocd/share/openocd/scripts/interface/
Significantly, you will need to compile your own version of openocd to work with NeTV2. The mainline openocd has a bug in the bcm2835 driver code that greatly limits the reliable speed of operation, and a patch has been submitted but it looks like they aren't going to take it. Instead, take this fork:
https://github.com/AlphamaxMedia/openocd.git
Clone it recursively and build and install it. If you use this, openocd runs about 20x faster than if you use the mainline version. Be sure to use the --enable-bcm2835gpio configure option.
The default NeTV2 firmware image already includes this source directory and binary pre-installed for you.
To start flterm and talk to the RELP shell on the NeTV2 FPGA, you want a command line like this:
./flterm --port /dev/ttyS0 --speed 115200 --kernel firmware.bin
The --kernel command line argument points you to the current firmware kernel to load on boot, which is generated by running make inside the "firmware" directory of the netv2-fpga project.
If you don't have a custom firmware, you can omit the --kernel option ad the system will boot from the default firmware inside the SPINOR. However, please note that it's highly recommended you copy the firwmare associated with your FPGA bitfile, because migen/litex will occassionally munge the entire address space of the SoC without warning due to Python non-determinism (it's a feature, not a bug, apparently).
If you have your own bitstream you want to load into the FPGA, use the fpga-jtag.cfg script with openocd:
sudo openocd -f ./fpga-jtag.cfg
It assumes your bitfile is in the current directory with the file name "top.bit"