Skip to content

Instantly share code, notes, and snippets.

View makestuff's full-sized avatar

Chris McClelland makestuff

View GitHub Profile
You can build the FX2 firmware on Linux like this:
chris@deb8$ cd $HOME
chris@deb8$ mkdir -p 20150807
chris@deb8$ cd 20150807
chris@deb8$ wget --no-check-certificate -qO- http://tiny.cc/msbil | tar zxf -
chris@deb8$ cd makestuff/libs
chris@deb8$ ../scripts/msget.sh makestuff/libfpgalink/20150807
:
chris@deb8$ cd libfpgalink/
@makestuff
makestuff / main.c
Created August 6, 2015 17:53
Raspberry Pi GPIO->JTAG
#include <stdio.h>
#include <makestuff.h>
#include <liberror.h>
#include <wiringPi.h>
#include "parser.h"
typedef enum {
TCK = 7,
TDO = 0,
TDI = 9,
#!/usr/bin/python
from scipy import interpolate
import random
size = 16
margin = 1000
foo = 512
x = [i*4 for i in range(0, size+1)]
y = [i*4 for i in range(0, 4)]
#include <stdio.h>
#include <stdlib.h>
static inline int do_loop(unsigned long i, unsigned long end) {
return (i < end) ? printf("loop %lu\n", i), do_loop(i+1, end) : 0;
}
int main(int argc, char *argv[]) {
return do_loop(0, strtoul(argv[1], NULL, 10));
(void)argc;
@makestuff
makestuff / umdkv2-readme.txt
Last active August 29, 2015 14:15
UMDKv2 tools and FPGA designs
# -----------------------------------------------------------------
# BUILD TOOLS & XSVF FILES
sudo apt-get update
sudo apt-get install build-essential libreadline-dev libusb-1.0-0-dev python-yaml
export XILINX=/opt/Xilinx/14.7/ISE_DS/ISE
export PATH=${XILINX}/bin/lin64:${PATH}
cd $HOME
mkdir 20150315
mkdir umdkv2-bin
cd 20150315
@makestuff
makestuff / lx9r3-readback
Created December 28, 2014 18:41
Load 16MiB of random data into the LX9R3's SDRAM, read it back, compare
---------------------------------------------------------------------------------------------------
Building FPGALink & the readback example VHDL for MakeStuff LX9R3 on Linux:
# Install prerequisites:
sudo apt-get install build-essential libreadline-dev libusb-1.0-0-dev python-yaml
mkdir $HOME/20140524
cd $HOME/20140524
wget -qO- http://tiny.cc/msbil | tar zxf -
# Fetch and build flcli:
@makestuff
makestuff / pom.sh
Created December 2, 2014 10:41
Pomodoro script
#!/bin/sh
# Can optionally start at pomodoro N on a given day (if I need to reboot, etc).
if [ $# -eq 0 ]; then
printf "\nBeginning workday $(date +%Y-%m-%d)...\n" >> ${HOME}/pom.log
POM=1
elif [ $# -eq 1 ]; then
POM=$1
else
echo "Synopsis: pom.sh [<pom-start>]"
@makestuff
makestuff / udfs-build.txt
Created November 24, 2014 10:45
Build UDFS server, firmware and ROMs
# Build host-side server program
sudo apt-get install build-essential libusb-1.0-0-dev
mkdir $HOME/20140120
cd $HOME/20140120
wget -qO- http://tiny.cc/msbil | tar zxf -
cd makestuff/apps
../scripts/msget.sh makestuff/udfs/20140120
cd udfs/server/
make deps
@makestuff
makestuff / aes220-howto
Created September 21, 2014 13:11
Build FPGALink and the cksum VHDL example, and use flcli to write data to an Aessent aes220, and then read data back from it.
---------------------------------------------------------------------------------------------------
Building FPGALink & the cksum example VHDL for Aessent aes220 on Linux:
# Install prerequisites:
sudo apt-get install build-essential libreadline-dev libusb-1.0-0-dev python-yaml
mkdir $HOME/20140524
cd $HOME/20140524
wget -qO- http://tiny.cc/msbil | tar zxf -
# Fetch and build flcli:
@makestuff
makestuff / ep2c5-flash.txt
Created September 6, 2014 16:22
EP2C5 flash operations
# Read the ID of the attached SPI flash
flcli -v 1d50:602b -c 1 -a 'w1 00;w1 04;w0 9F000000;w1 00;r0 4'
FF 20 20 13
# Generate .rbf file and write it to flash (note byte-swap)
quartus_cpf -c top_level.sof top_level.rbf
gordon -v 1d50:602b -t indirect:1 -w top_level.rbf:0 -s