怎么把uclinux下载到EPCS中

sof in EPCS, program in EPCS

Using Altera Nios Dev board, Cyclone II 2C35 , standard example, find out and change the sof path, and epcs base below.

# config the fpga
nios2-configure-sof $SOPC_KIT_NIOS2/examples/verilog/niosII_cycloneII_2c35/standard/standard.sof
# change to your uClinux image dir
cd ~/uClinux-dist/images
# Creating .flash file for the FPGA configuration
sof2flash --epcs --input=$SOPC_KIT_NIOS2/examples/verilog/niosII_cycloneII_2c35/standard/standard.sof --output=standard.flash
# Programming flash with the FPGA configuration
nios2-flash-programmer --epcs --base=0x02200000 standard.flash
# Creating .flash file for the project
elf2flash --epcs --after=standard.flash --input=zImage --output=epcs_controller.flash --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_epcs.srec
# Programming flash with the project
nios2-flash-programmer --epcs --base=0x02200000 epcs_controller.flash

MMU example

sof2flash --epcs --input=NiosII_cycloneII_2c35_full_featured.sof --output=fpga.flash

nios2-flash-programmer --epcs --mmu --base=0x03200000 fpga.flash

elf2flash --epcs --after=fpga.flash --input=zImage --output=zImage.flash --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_epcs.srec

nios2-flash-programmer --epcs --mmu --base=0x03200000 zImage.flash

**************************************************************************************************************************

首先把SOF文件下载到FPGA中,我们可以打开Nios II Command Shell,用cd命令切换到你放工程的sof文件和uclinux的zImage文件里面,注意cd /cygdrive/路径。再使用
nios2-configure-sof下载SOF文件,然后建立一个epcs.sh文件,比如:vim epcs.sh,输入下面命令:

sof2flash --epcs --input=uclinux.sof --output=standard.flash

#将sof文件转化为flash文件,uclinux.sof转为standard.flash,名字根据实际情况决定
nios2-flash-programmer --epcs --base=0x00401800 standard.flash

#下载转化sof的flash文件到epcs里面,0x00401800为epcs的基地址,为sopc里面epcs的基地址

elf2flash --epcs --after=standard.flash --input=zImage --output=epcs_controller.flash --boot SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_epcs.srec

#在standard.flash后面,将uclinux映像文件zImage文件转为flash文件epcs_controller.flash

#boot后面是bootload文件,SOPC_KIT_NIOS2为Quartus II安装目录\nios2eds,比如:E:\altera\10.1\nios2eds

#boot_loader_epcs.srec为安装目录里面的bootload文件

 nios2-flash-programmer --epcs --base=0x00401800 epcs_controller.flash

#下载zImage转化的flash到EPCS中,base=0x00401800问EPCS在SOPC中的基地址

**************************************************************************************************************************

改变epcs.sh shell文件的可执行权限,比如:chmod 777 epcs.sh,然后运行:./epcs.sh

现在可以把FPGA开发板断电再开电,看uclinux系统断电会不会消失。

再输入:nios2-terminal命令

怎么擦除EPCS芯片里的内容

1、首先一定要关掉Nios II Command Shell

2、打开Quartus II工程,进入下载界面,选择AS模式,Mode:Active Serial Programming,打开pof文件,选择Erase,FPGA开发板选择EPCS下载接口,点击开始即可

 

 

 

原文地址:https://www.cnblogs.com/Neddy/p/2011226.html