# fireprog: a Xilinx Spartan 3 configuration software
Fireprog is a utility which can program Xilinx Spartan 3 FPGAs via FT232H-based USB-to-JTAG adapter.
It is based on *fpgaprog*, *Papilio-Prog*, *xc3sprog* to which support for Micron M25PE10 SPI flash was added.
Fireprog is used to configure [Prometheus FPGA](http://www.prometheus-fpga.com) boards.
Copyleft (C) Altynbek Isabekov, Onurhan Öztürk
License: GNU General Public License v2
![Prometheus FPGA](http://www.isabekov.pro/prometheus-fpga/static/img/Prometheus_FPGA_Board.jpg "Prometheus FPGA")
### Table of Contents
- [Usage](#usage)
- [Compilation on Linux](#compilation-on-linux)
- [Cross-compilation on Linux for Windows](#cross-compilation-on-linux-for-windows)
- [Cross-compilation on Linux for MacOS](#cross-compilation-on-linux-for-macos)
- [using official libftd2xx library](#cross-compilation-on-linux-for-macos-using-official-libftd2xx-library)
- [using libftdi and libusb libraries](#cross-compilation-on-linux-for-macos-using-libftdi-and-libusb-libraries)
## Usage
In order to program the Prometheus board, plug it in the USB port, Windows OS should recognize it as a USB-to-Serial (RS232) converter and associate it with the libftd2xx driver.
Now you can run "fireprog.exe" from the command line and supply the configuration bit-file.
Configuring FPGA with a bit-stream Circuit.bit:
./fireprog -v -f Circuit.bit
Configuring SPI Flash memory with a bit-stream Circuit.bit (mediator bscan_spi.bit is required):
./fireprog -v -f Circuit.bit -b bscan_spi.bit -r
The last switch "-r" triggers reconfiguration of the FPGA.
On Windows, command options are exactly the same:
![FPGA](Screenshots/fireprog_uploading_fpga.png "Configuring FPGA with a bit-stream")
![FLASH](Screenshots/fireprog_uploading_flash.png "Configuring SPI flash with a bit-stream")
## Compilation on Linux
To compile on Linux, install *libusb* and *libftdi* first and then run *make*:
sudo pacman -S libusb libftdi
make clean
make
The resulting ELF binary "fireprog" will be linked with libusb and libftdi.
## Cross-compilation on Linux for Windows
In order to cross-compile on Linux for Windows, firstly install MinGW-w64 cross-compiler:
sudo pacman -S mingw-w64-gcc mingw-w64-headers mingw-w64-binutils mingw-w64-winpthreads mingw-w64-crt
Then download the x64 version of the "CDM v2.12.24 WHQL Certified.zip" driver
from http://www.ftdichip.com/Drivers/D2XX.htm and unzip it into "libftd2xx" folder, which is at the same hierarchy level as "fireprog".
├── fireprog
│ ├── Makefile
│ ├── ...
│ ├── Makefile.MinGW64Static
│ ├── README.md
│ ├── Screenshots
│ └── src
│ ├── bitfile.cpp
│ ├── bitfile.h
│ ├── ...
│ ├── tools.cpp
│ └── tools.h
│
├── libftd2xx
│ ├── amd64
│ ├── ftd2xx.h
│ ├── ftdibus.cat
│ ├── ftdibus.inf
│ ├── ftdiport.cat
│ ├── ftdiport.inf
│ ├── i386
└── └── Static
The linker will use "../libftd2xx" folder (see the Make files). Modify the Make files to change the cross-compiler location (default is /usr/bin/i686-w64-mingw32-*).
After unzipping the libftd2xx driver, you can cross-compile on Linux for Windows (yields "fireprog.exe", which is a PE32 or PE32+ executable).
Depending on the architecture and linking type, one of the following commands should be executed:
make -f Makefile.MinGW32Static clean
make -f Makefile.MinGW32Static
make -f Makefile.MinGW32Dynamic clean
make -f Makefile.MinGW32Dynamic
make -f Makefile.MinGW64Static clean
make -f Makefile.MinGW64Static
make -f Makefile.MinGW64Dynamic clean
make -f Makefile.MinGW64Dynamic
Dynamically linked executables require some libraries from the MinGW cross-compiler. Putting these libraries in the same folder where "fireprog.exe" resides, allows execution without errors, e.g.:
fireprog-win32-dynamic
├── fireprog.exe
├── libgcc_s_sjlj-1.dll
├── libstdc++-6.dll
└── libwinpthread-1.dll
fireprog-win64-dynamic
├── fireprog.exe
├── libgcc_s_seh-1.dll
├── libstdc++-6.dll
└── libwinpthread-1.dll
## Cross-compilation on Linux for MacOS
Install OSXCross toolchain from source to an easily accessable directory (e.g. "/opt"):
# Make the directory readable and writable to the user first
sudo chown -R $(whoami):users /opt
sudo chmod 755 $(whoami):users /opt
cd /opt
git clone https://github.com/tpoechtrager/osxcross
Pack the SDK on MacOS on a real Apple computer and put the packed achive "MacOSX10.11.sdk.tar.xz" to "/opt/osxcross/tarballs".
In this example, the MacOS cross-compiler is built for **OS X 10.11 El Capitan**, *Darwin version 15*.
Check compatibility between SDK versions and corresponding targets in:
/opt/osxcross/tools/osxcross-macports
If *clang* compiler is already installed, there is no need to build it. If not, then proceed as described in
/opt/osxcross/README.md
To build the cross toolchain (using *clang*), run:
cd /opt/osxcross
./build.sh
Then build GCC:
./build_gcc.sh
Add OSXCross binary directory to the $PATH environment variable:
export PATH=$PATH:/opt/osxcross/target/bin
Check the cross-compiler:
x86_64-apple-darwin15-gcc -v
Using built-in specs.
COLLECT_GCC=x86_64-apple-darwin15-gcc
COLLECT_LTO_WRAPPER=/opt/osxcross/target/bin/../libexec/gcc/x86_64-apple-darwin15/9.2.0/lto-wrapper
Target: x86_64-apple-darwin15
Configured with: ../configure --target=x86_64-apple-darwin15 --with-sysroot=/opt/osxcross/target/bin/../SDK/MacOSX10.11.sdk --disable-nls --enable-languages=c,c++,objc,obj-c++ --without-headers --enable-lto --enable-checking=release --disable-libstdcxx-pch --prefix=/opt/osxcross/target/bin/.. --with-system-zlib --with-ld=/opt/osxcross/target/bin/../bin/x86_64-apple-darwin15-ld --with-as=/opt/osxcross/target/bin/../bin/x86_64-apple-darwin15-as --with-multilib-list=m32,m64 --enable-multilib
Thread model: posix
gcc version 9.2.0 (GCC)
### Cross-compilation on Linux for MacOS using official libftd2xx library
Once the toolchain is ready, download and unpack FTD2XX drivers for MacOS:
cd <path of the "fireprog" repository>
# Change one directory up (important!)
cd ..
mkdir libftd2xx
cd libftd2xx
wget -vc https://www.ftdichip.com/Drivers/D2XX/MacOSX/D2XX1.4.16.dmg
# Unpack archive using p7zip
7z x D2XX1.4.16.dmg release/D2XX
mv release/D2XX .
Rename the shared library file so that its name does not start with "lib":
mv D2XX/libftd2xx.1.4.16.dylib D2XX/backup_libftd2xx.1.4.16.dylib
cd ..
This is needed to **enforce static linking**, so that static library *libftd2xx.a* instead of *libftd2xx.1.4.16.dylib* is used by the linker.
The hierarchy of the folders should look like this:
├── fireprog
│ ├── Makefile
│ ├── ...
│ ├── Makefile.MinGW64Static
│ ├── README.md
│ ├── Screenshots
│ └── src
│ ├── bitfile.cpp
│ ├── bitfile.h
│ ├── ...
│ ├── tools.cpp
│ └── tools.h
│
├── libftd2xx
│ ├── D2XX
│ │ ├── ftd2xx.cfg
│ │ ├── ftd2xx.h
│ │ ├── backup_libftd2xx.1.4.16.dylib
│ │ ├── libftd2xx.a
│ │ ├── libusb
│ │ ├── Object
│ │ ├── Samples
│ │ └── WinTypes.h
└── └── D2XX1.4.16.dmg
The corresponding Makefile is written according to this directory structure.
Now compile the "fireprog":
cd <path of the fireprog repository>
make -f Makefile.MacOS_libftd2xx
Check the output
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
fireprog:Xilinx Spartan 3 配置软件 Fireprog是一种实用程序,可以通过基于FT232H的USB到JTAG适配器对Xilinx Spartan 3 FPGA进行编程。 它基于fpgaprog 、 Papilio-Prog 、 xc3sprog ,其中添加了对 Micron M25PE10 SPI 闪存的支持。 Fireprog 用于配置板。 Copyleft (C) Altynbek Isabekov, Onurhan Öztürk 许可证:GNU 通用公共许可证 v2 目录 用法 为了对 Prometheus 板进行编程,将其插入 USB 端口,Windows 操作系统应将其识别为 USB 到串行 (RS232) 转换器并将其与 libftd2xx 驱动程序相关联。 现在您可以从命令行运行“fireprog.exe”并提供配置位文件。 使用比特流 Ci
资源详情
资源评论
资源推荐
收起资源包目录
fireprog-master.zip (34个子文件)
fireprog-master
.gitignore 16B
Screenshots
fireprog_uploading_flash.png 35KB
fireprog_uploading_fpga.png 29KB
Makefile 601B
src
io_exception.h 1KB
jtag.cpp 4KB
progalgspi.h 3KB
devlist.h 303B
tools.h 302B
bitfile.h 4KB
iobase.h 2KB
butterfly.cpp 11KB
ioftdi.h 3KB
jtag.h 3KB
ioftdi.cpp 12KB
progalgxc3s.h 2KB
config.h 833B
devicedb.cpp 3KB
bitfile.cpp 7KB
devicedb.h 1KB
progalgspi.cpp 25KB
iobase.cpp 7KB
tools.cpp 2KB
progalgxc3s.cpp 10KB
fireprog.rc 1KB
fireprog.manifest 891B
Makefile.MinGW32Dynamic 875B
Makefile.MacOS_libftd2xx 835B
_config.yml 25B
Makefile.MinGW32Static 890B
README.md 13KB
Makefile.MinGW64Dynamic 882B
Makefile.MacOS_libftdi 871B
Makefile.MinGW64Static 895B
共 34 条
- 1
远离康斯坦丁
- 粉丝: 27
- 资源: 4664
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0