Skip to content

Instantly share code, notes, and snippets.

View makestuff's full-sized avatar

Chris McClelland makestuff

View GitHub Profile
@makestuff
makestuff / s3board-minimus-ss.txt
Created August 18, 2019 10:25
Build FPGALink and the cksum Verilog example, and use flcli to write data to a Digilent S3BOARD using the sync-serial conduit, and then read data back.
Building FPGALink & the Verilog version of the cksum example for Digilent S3BOARD on Linux:
# Physical connections (see https://i.imgur.com/TxuNx3N.jpg)
Minimus | S3BOARD
----------+-----------------
(PD2) RXD | serData_out (E7)
(PD3) TXD | serData_in (D6)
(PD5) XCK | serClk_in (D5)
//
// Copyright (C) 2014, 2017, 2019 Chris McClelland
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
@makestuff
makestuff / umdk-win-20170708
Last active July 9, 2017 08:27
Build UMDK software version 20170708 on Windows
#!/bin/sh
echo "Starting build at $(date)"
export RELEASE=20170708
cd $HOME
rm -rf libs/* apps/* common hdlmake
cd apps
../scripts/msget.sh makestuff/flcli/${RELEASE}
../scripts/msget.sh makestuff/gordon
@makestuff
makestuff / umdk-20170319
Created March 19, 2017 18:59
Build UMDK software version 20170319
export RELEASE=20170319
export ARCH=x64
# -----------------------------------------------------------------
# BUILD UMDKv2 TOOLS
sudo apt-get update -y
sudo apt-get install -y build-essential libreadline-dev libusb-1.0-0-dev
sudo apt-get install -y cvs lzma bison flex texinfo automake libtool zlib1g-dev gawk gperf libncurses5-dev
if [ ! -e /usr/bin/libtool ]; then
sudo apt-get install -y libtool-bin
@makestuff
makestuff / ep2c5-ss-howto
Last active April 24, 2020 13:12
Build FPGALink and VHDL examples for the EP2C5+Minimus in sync-serial configuration
$ # Make sure you have udev rules for 1d50:602b and 03eb:2ffa, using a group you're a member of (I use "users"):
$ groups
users ...
$ cat /etc/udev/rules.d/10-local.rules
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="602b", GROUP="users", MODE="0660"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="2ffa", GROUP="users", MODE="0660"
$
# You'll need some stuff before we begin:
sudo apt-get install build-essential libreadline-dev libusb-1.0-0-dev python-yaml
@makestuff
makestuff / 0_reuse_code.js
Created February 25, 2016 13:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@makestuff
makestuff / foo.md
Last active December 26, 2015 14:33

STEP 0: Preparation

Unless you know what you're doing, you should test your new UMDK cart using a recent x86 or x64 Linux installation, on "real" (as opposed to virtual, e.g on VMware or VirtualBox) x86 or x64 hardware. The software will build and function correctly on MacOSX or Windows, or even on a Raspberry Pi, but whilst we're getting everyone up and running it makes sense to minimize the number of configurations being used.

So, you will need:

  • A PC with a spare USB port and an Internet connection
  • A recent Linux installation, x86 or x64 (amd64)
  • A digital multimeter, for verifying voltage levels
  • Four jumpers, for selecting options on the boards
  • A good solid block of time to run through the test and install process
  • Patience!
@makestuff
makestuff / wavdrom.c
Created November 29, 2015 17:54
Accept a .bin file from the UMDKv2 logic analyzer, and create a blob of text that can be pasted into http://wavedrom.com/editor.html
#include <stdio.h>
#include <stdint.h>
int main(int argc, const char *argv[]) {
const size_t dataLen = 1024;
uint8_t buffer[dataLen];
size_t i;
int oldVal = -1;
int newVal;
uint8_t values[dataLen];
@makestuff
makestuff / basys2-howto
Last active November 22, 2015 19:33
Build FPGALink and the cksum VHDL example, and use flcli to write data to a Basys2 board, and then read data back from it.
---------------------------------------------------------------------------------------------------
Building FPGALink & the cksum example VHDL for Digilent Basys2 on Linux:
# Install prerequisites:
sudo apt-get install build-essential libreadline-dev libusb-1.0-0-dev python-yaml gcc-avr avr-libc dfu-programmer
mkdir $HOME/20150315
cd $HOME/20150315
wget -qO- http://tiny.cc/msbil | tar zxf -
# Fetch and build flcli:
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/