README.md 1.37 KB
Newer Older
Greg Davill's avatar
Greg Davill committed
1 2
# ecpprog

Greg Davill's avatar
Greg Davill committed
3
A basic driver for FTDI based JTAG probes (FT232H, FT2232H, FT4232H), to program Lattice ECP5/Nexus FPGAs.
Greg Davill's avatar
Greg Davill committed
4 5

## Features:
Greg Davill's avatar
Greg Davill committed
6 7 8
 - SPI Flash programing via JTAG link to ECP5/NX part.
 - Validate ECP5/NX IDCODEs
 - Read/Decode ECP5/NX status register
Greg Davill's avatar
Greg Davill committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22

## Prerequisites

```
sudo apt-get install libftdi-dev
```

## Building

```
git clone https://github.com/gregdavill/ecpprog ecpprog
cd ecpprog/ecpprog
make
sudo make install
Greg Davill's avatar
Greg Davill committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
```

## Usage

### Verify JTAG connection
```
$ ecpprog -t
  init..
  IDCODE: 0x41111043 (LFE5U-25)
  ECP5 Status Register: 0x00200000
  flash ID: 0xEF 0x40 0x18 0x00
  Bye.
```

### Flash a bitstream
```
$ ecpprog /path/to/bitstream.bit
  init..
  IDCODE: 0x41111043 (LFE5U-25)
  ECP5 Status Register: 0x00200000
  reset..
  flash ID: 0xEF 0x40 0x18 0x00
  file size: 99302
  erase 64kB sector at 0x000000..
  erase 64kB sector at 0x010000..
  programming..  99302/99302
  verify..       99302/99302  VERIFY OK
  Bye.
```

### Flash User/SoC code
```
$ ecpprog -o 1M firmware.bin 
  init..
  IDCODE: 0x41111043 (LFE5U-25)
  ECP5 Status Register: 0x00200000
  reset..
  flash ID: 0xEF 0x40 0x18 0x00
  file size: 294312
  erase 64kB sector at 0x100000..
  erase 64kB sector at 0x110000..
  erase 64kB sector at 0x120000..
  erase 64kB sector at 0x130000..
  erase 64kB sector at 0x140000..
  programming..  294312/294312
Greg Davill's avatar
Greg Davill committed
68
  verify..       294312/294312  VERIFY OK
Greg Davill's avatar
Greg Davill committed
69 70
  Bye.

Greg Davill's avatar
Greg Davill committed
71
```