前言:目前的教程主要有两个问题:out of date; no details. 造成困扰很多。这里参考了
sopc.et.ntust.edu.tw
Alterawiki AND alteraforum
http://www.youtube.com/watch?v=RxlyezOf0Rs
uuoc.org/uClinux_nios2_custom_hardware.pdf
我想下一步应当转战:
http://www.rocketboards.org/foswiki/Documentation/NiosIILinuxUserManual
1. 环境
在Linux下,或至少 windows + vmware player,不建议直接使用 Windows(懒得尝试)。
使用 Linux 哪个 Distro 不重要,编译环境能成功即可。本文使用的是 Archlinux。和 Windows 共享等问题本文不涉及。所有操作都是在 Archlinux 下进行。
Quartus II 使用 13.1。硬件采用通用一些的 DE2-115。
2. NIOS II 硬件
altpll,c0->100MHz,c1->100MHz, phase delay:-2ns
Interval timer,full featured, 1ms, irq 0
jtag uart, irq, 1 (be told: should not be 0 for linux, very important)
onchip memory,1024 Bytes,Dual-port access
3. Nios2 Linux Tarball
$ cd tars
$ wget ftp://ftp.altera.com/outgoing/nios2-linux/20120802/* # git://sopc.et.ntust.edu.tw/git 已经没有uClinux-dist.git了
$ cd ..
$ md5sum --check tars/files.md5sum
$ for i in $(ls tars/nios2-linux-*.tgz); do tar -xzvf $i;done
## For mmu-less nios2 uCLinux, download the precompiled toolchain as well
## wget ftp://ftp.altera.com/outgoing/nios2-linux/nios2gcc-20080203.tar.bz2
## this extracts to nios2-linux/opt
## tar -xvf nios2gcc-20080203.tar.bz2
$ cd nios2-linux
$ ls
$ ./checkout
实际上我这次只用了linux-2.6.tgz, uClinux-dist.tgz, uClibc.tgz, toolschain-mmu.tgz.
sopc使用ptf做hardware selector,已经被替换成了qsys的devicetree。sopc2dts需要更新,这里延误了1 week。
git clone git://sopc.et.ntust.edu.tw/git/tools.git (太慢了!!!以至于没法更新其他内容