• Stars
    star
    118
  • Rank 299,923 (Top 6 %)
  • Language
    C++
  • License
    Other
  • Created over 8 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

xc3sprog is a suite of utilities for programming Xilinx FPGAs, CPLDs, and EEPROMs with the Xilinx Parallel Cable and other JTAG adapters under Linux. Used to program the FPGA of the MATRIX Creator/Voice via Raspberry Pi.

Installation

# Add repo and key
curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list

# Update packages and install
sudo apt-get update
sudo apt-get upgrade

#Installation
sudo apt install matrixio-xc3sprog

Spartan3, XCF and CPLD JTAG programmer and other utilities

Copyright (C) 2004 Andrew Rogers (C) 2005-2011 Uwe Bonnes [email protected]

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Please also read the file "COPYING" which is a copy of the GNU General Public License

Prerequisites

This program should run without installation. For accessing USB cables, libusb0 is required as runtime dynamic linked library.

To compile, you need CMAKE, the static libftdi library and usb.h.

Compilation

$ mkdir build; cd build; cmake ..; make

To crosscompile for Win32 with mingw:

$ mkdir build-win32; cd build-win32; 
$ cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake ..

Options

####Get a description:

$ ./xc3sprog -h

Note: This will also list the supported cables.

####Get a chain description:

$ ./xcs3prog -j

Device description is searched in the file pointed to by the XCDB environment variable, or when not found the built-in list is used.

####Test the chain integrity:

$ ./xc3sprog -T -j

Here "-j" stops xc3sprog from entering the program/verify/read the part. If things go wrong, an endless loop is entered to facilitate hardware degugging with the scope. Stop with ^C.

###Programming The Platform Flash PROM of the Xilinx Spartan3 Starter Kit can be programmed by specifying it's location in the JTAG chain. Example command line below.

$ ./xc3sprog -c pp -p 1 <bitfile.bit>

Program the flash of an XC3S50AN by loading the bscan_spi bitfile first. Aassume the XC3S50AN as single part in the jtag chain

$ ./xc3sprog  ../bscan_spi/xc3s50an.bit

Now program the flash

$ ./xc3sprog -I <your_bitfile.bit>

Verify the flash content against a file

$ ./xc3sprog -I -C <your_bitfile.bit>

You can readout XCF/ISF flash and CPLD

ISF flash probably mean Incircuit Serial Flash, as internal to XC3SAN or external connected to XC3SA/XC3SA or XC6S

First load an appropriate bitfile. Some bitfiles are in bscan_spi. Otherwise use the appropriate HDL file from bscan_spi and a fitting UCF file to create a ISE Project and run the Xilinx tools to generate the bitfile.

Load the bitfile, like

$ ./xc3sprog bscan_spi/xc6s_cs324.ucf

After loading the ISF Bitfile, you can now talk to the ISF Flash. When writing to the ISF, at the end the FPGA tries to reconfigure from flash and the ISF Bitfile is lost.

$ ./xc3sprog -r (-I) <file to store>

xc3sprog handles XC3, XCF0x and XC95xxxXx. XC4 should work but is untested.

There is also a utility program included that parses and prints the header of a Xilinx .bit file.

$ ./bitparse echo_out.bit

Jedecfiles for CPLD programming can be parsed with

$ ./jedecparse <jedecfile.jed>

When using a FT2232D|L programmer, speed is noticely enhance with a USB-2.0 Hub between the adapter and the PC. Some effort has been made to concatenate as many JTAG actions as possible.

Example fallback multi boot setup on XC6S

Load intermediate BSCAN_SPI bitfile:

$ ./xc3sprog -I <package specific bscan_spi bitfile>

Eventually erase (not really needed):

$ ./xc3sprog -I -e

Prepare the Multiboot header from the Template. Adapt GENERAL2 and GENERAL4 for your setup. Here a 32 MiBit Flash and a XC6SLX45 is used. The Bitstream length is about 1484404 = 0x16a674 bytes, so with placing the golden image at 0x10000 the golden image ends at 0x17a674 and with placing the normal image at 0x190000, there should be enough spacing between both. Double check that GENERAL2 and GENERAL4 match the offsets.

Write the header

$ ./xc3sprog -I<boot_header_only_SPI_x1.hex> 

Write golden image

$ ./xc3sprog -I <golden image>:w:0x10000

Write normal image

$ ./xc3sprog -I <normal image>:w:0x190000

Reboot

$ ./xc3sprog -R

All all in one

$ ./xc3sprog -R -I<boot_header_only_SPI_x1.hex> <golden image>:w:0x10000 \
   <normal image>:w:0x190000

Special Thanks

More Repositories

1

matrix-os

MATRIX OS Codebase
JavaScript
75
star
2

matrix-creator-hal

Hardware Abstraction Layer for MATRIX Creator & MATRIX Voice
C++
70
star
3

matrix-documentation

Documentation describing MATRIX and its APIs.
CSS
46
star
4

pi-wifi

Node wrapper for Wifi access on Raspberry Pi using wpa_supplicant
JavaScript
45
star
5

matrix-creator-quickstart

MATRIX Creator Quickstart
Shell
43
star
6

matrix-cli

Command Line Interface for MATRIX Open Source
JavaScript
35
star
7

matrix-lite-js

Program your MATRIX device with JavaScript! A Node.js addon for MATRIX HAL.
C++
28
star
8

matrix-creator-fpga

Reference HDL code for the MATRIX Creator's Spartan 6 FPGA
Verilog
27
star
9

matrixio-kernel-modules

MATRIX HAL in kernel space
C
22
star
10

MATRIX-Creator-Case

22
star
11

matrix-voice-fpga

HDL code for the MATRIX Voice's Spartan 6 FPGA http://voice.matrix.one
Verilog
21
star
12

matrix-creator-malos

MATRIX Creator abstraction for MOS
C++
19
star
13

matrixio_hal_esp32

ESP32 HAL for MATRIX VOICE - https://www.matrix.one/products/voice
C++
19
star
14

matrix-gesture-node-sdk

MATRIX Gesture Detection Node SDK
Makefile
18
star
15

matrix-rhal

(under early development) Rust Hardware Abstraction Layer for MATRIX Creator & MATRIX Voice
Rust
18
star
16

matrix-malos-wakeword

MALOS wake word service (Deprecated)
C++
16
star
17

matrix-creator-pocketsphinx

Examples using MATRIX Devices and PhocketSphinx.
CMake
14
star
18

matrix-lite-py

Program your MATRIX device with Python!
C++
14
star
19

matrix-creator-alexa-voice-demo

Python
12
star
20

matrix-lite-nfc-js

Program NFC with JavaScript! A Node.js addon for HAL NFC.
C++
10
star
21

matrix-node-sdk

Used by MatrixOS and Matrix CLI to interface with API and Streaming Server
JavaScript
8
star
22

matrix-firebase

Firebase Integration
JavaScript
8
star
23

protocol-buffers

CMake
8
star
24

matrix-app-config-helper

JavaScript
8
star
25

matrix-creator-android-things

Android Things app for controlling MATRIX Creator and MATRIX Voice
Java
8
star
26

matrix-lite-go

Program your MATRIX device with Go! Go bindings for MATRIX HAL.
Go
8
star
27

matrix-creator-init

Debian package to initialize MATRIX Creator on boot
Shell
7
star
28

google-assistant-matrixio

google-assistant-matrixio example
Python
7
star
29

matrix-srcjs-apps

JavaScript
6
star
30

Arm-DevDay-2019

(Deprecated) Setup guide & source code for Arm DevDay 2019
JavaScript
6
star
31

matrix-gesture-cpp-sdk

MATRIX Gesture Detection C++ SDK
C++
6
star
32

matrix-creator-malos-android

Android application that interfaces with MATRIX Creator MALOS layer.
Java
6
star
33

malos-eye

Computer Vision
5
star
34

matrix-malos-zigbee

MALOS service for ZigBee
C++
5
star
35

face-analytics

Detect faces and other objects using our REST API.
JavaScript
5
star
36

esp32-platformio

PlatformIO OTA for MatrixVoice ESP32 board!
C++
5
star
37

matrix-creator-openocd

The GNU ARM Eclipse OpenOCD. Used to program the EM3588 SoC and the SAM3S microcontroller of the MATRIX Creator via Raspberry Pi.
C
5
star
38

matrix-core-examples

Examples for using MATRIX CORE drivers
Python
5
star
39

MATRIX-Pay

MATRIX Lab's project for the 2017 eMerge Americas Hackathon
Swift
4
star
40

matrix-eventfilter

JavaScript
4
star
41

matrix-test-altitude-sensor

JavaScript
4
star
42

matrix-hal-nfc

NFC interface for MATRIX HAL!
C++
4
star
43

matrixio-models

4
star
44

matrixio-alexa-sdk-guide

Guide on how to setup the Alexa SDK in a Raspberry Pi with a MATRIX Creator/Voice.
4
star
45

hackathon

Landing page for hackathons
CSS
4
star
46

matrix-malos-zwave

MALOS service for ZWave
C++
4
star
47

matrix-sensor-template

Template for Sensor Specification.
JavaScript
4
star
48

matrix-ml

3
star
49

matrix-examples

Examples for MATRIX OS
JavaScript
3
star
50

matrix-sdk

3
star
51

matrix-malos-lib

Library for the MATRIX MALOS protocol
C++
3
star
52

lmtool-cli

CLI for PocketSphinx LMTool (http://www.speech.cs.cmu.edu/tools/lmtool-new.html)
JavaScript
3
star
53

raspi-systemd-quickstart

Learn how to create & automatically start a service for the Raspberry Pi.
JavaScript
3
star
54

matrix-continuity

3
star
55

matrix-hal-swig

SWIG wrapper for MATRIX Hal.
C++
3
star
56

matrix-creator-nfc-unstable-preview

Project has moved here https://github.com/matrix-io/matrix-hal-nfc
Makefile
3
star
57

matrix-gesture-python-sdk

MATRIX Gesture Detection Python SDK
3
star
58

zipgateway

Unofficial debian package for zipgateway for Raspbian with MATRIX Creator
Roff
3
star
59

matrix-test-monitor-sensor

JavaScript
3
star
60

matrix-cv

3
star
61

matrix-creator-mcu

Firmware for the SAM3 MCU of the MATRIX Creator
C++
3
star
62

malos-python

A tiny set of python coroutines to work with MALOS drivers
Python
3
star
63

MATRIX-Voice-CAD

3
star
64

rhasspy-examples

Code snippets on how to interact with the Rhasspy voice assistant
JavaScript
2
star
65

matrix-test-temperature-sensor

JavaScript
2
star
66

snips-light-switch

Control your lights with voice using Snips
JavaScript
2
star
67

matrix-lite-rb

(Under Development) Program your MATRIX device with Ruby!
Ruby
2
star
68

matrix-creator-documentation

2
star
69

matrix-hal-examples

Examples for using MATRIX HAL
C++
2
star
70

matrix-lite-nfc-py

Program NFC with Python!
C++
2
star
71

matrix-protos-go

Golang Protocol Buffers for the MATRIX CORE Protocol
1
star
72

iot-fuse-2020-workshop

1
star
73

esp32-mozilla-webthing

Set up your MATRIX Voice ESP32 standalone device as a Mozilla WebThing device to control it through the Mozilla WebThings Gateway.
C++
1
star
74

rhasspy-light-switch

Control your lights with voice using Rhasspy
JavaScript
1
star
75

matrix-mozilla-iot-addon

(Under Early Development) Mozilla IoT add-on for MATRIX Creator & Voice
JavaScript
1
star
76

matrix-creator-uv-demo

JavaScript
1
star
77

google-assistant-matrixio-picovoice

Google Assistant Service with PicoVoice Wake Word on MATRIX Devices
Python
1
star
78

matrix-creator-ir-test

Run this quick & simple test for the IR sensor and IR emitter on your MATRIX Creator
Python
1
star
79

esp32-halloween-2019

ESP32 eye animation for 8x8 LED MATRIX in evil bowler hat project
C++
1
star
80

fpga-environment-setup

How to set up the Xilinx compiler for FPGA code to flash the SPARTAN-6 FPGAs on MATRIX devices.
1
star
81

esp32-arduino-ota

Program your Voice ESP32 through the Arduino IDE!
C++
1
star