Nios程序烧写到EPCS方法 - 第1页 - asus119's Blog - EDN China电子设计技术

这里主要是针对EP3C系列FPGA的Nios程序固化到EPCS中的方法做简要说明。
硬件SOPC
1、要固化程序到EPCS,在SOPC Builder中首先需要添加EPCS_Controller核,此外,CPU的reset vector设置为EPCS_Co
ntroller,Exception Vector一般设置为SDRAM即可。
2、生成该nios_cpu。对于EP3C系列的FPGA来说,在生成cpu后,会出现与EPCS_Controller相关的4根引线(如图),

这在之前的EP2C等早期系列的FPGA中是没有的,因为系统已经默认完成了相应的设置,而EP3C是需要自己来对这些引脚设置的,这一点尤为要注意,下面就来具体说明一下。
这4根信号线分别为(EP3C10F256):
EPCS_DATA0   ->  H2
ASDO                 ->  C1
nCS0,(Flash_nCE)  ->  D2
DCLK                ->  H1
在对这4根引线进行引脚分配的时候,要在Device中将这些双功能引脚功能都设置为regular I/O Pin,
否则会出现错误:
比如:Error:Can't place multiple pins assigned to pin location PIN_H2
                        ......
对这些引脚做完这些设置后,即可进行编译、下载了(引脚分配如下图)。

另外,在使用Quartus II 10.0高版本编译Cyclone IV器件的时候,可能在Device->Dual Purpose里面的DCLK等引脚没有USE AS Regular I/O选项,用户就无法给DCLK这些引脚指定Pin Assignment。
这时的解决办法是:
打开工程的.qsf文件,加上以下几句(若存在对这4个引脚的其它类似配置信息时,先删除):
set_global_assignment -name RESERVED_FLASH_NCE_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVED_DATA0_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVED_DATA1_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVED_DCLK_AFTER_CONFIGURATION "USE AS REGULAR IO"
保存并编译,就可以正确读写EPCS了。
软件Nios
1、在nios中建立相应工程,并编译。
2、编译完成之后,打开FLASH Programmer。
勾上Program FPGA configuration data into hardware-image region of flash memory(将FPGA的配置文件写入Flash(EPCS)),
并设置对应的.sof文件Hardware Image设置为Custom,Memory设置为EPCS_Controller,offset为0x0,
不勾选Program a file into flash memory(可将二进制文件写入Flash)。
完成后如图所示:

以上所有设置完成后,Apply,然后Program Flash即可。烧写成功后,会有如下信息:

#!/bin/sh
#
# This file was automatically generated by the Nios II IDE Flash Programmer.
#
# It will be overwritten when the flash programmer options change.
#

cd D:/MySoftwares/QuartusII/Mywork/sopc_project/led_test/software/led_test/Debug

# Creating .flash file for the FPGA configuration
"$SOPC_KIT_NIOS2/bin/sof2flash" --epcs --input="D:/MySoftwares/QuartusII/Mywork/
sopc_project/led_test/led_test.sof" --output="led_test.flash"
Info: *******************************************************************
Info: Running Quartus II Convert_programming_file
Info: Command: quartus_cpf --no_banner --convert --device=EPCS128 --option=led_t
est.opt D:/MySoftwares/QuartusII/Mywork/sopc_project/led_test/led_test.sof led_t
est.pof
Info: Quartus II Convert_programming_file was successful. 0 errors, 0 warnings
    Info: Peak virtual memory: 70 megabytes
    Info: Processing ended: Wed Mar 30 12:34:48 2011
    Info: Elapsed time: 00:00:02
    Info: Total CPU time (on all processors): 00:00:02
Info: *******************************************************************
Info: Running Quartus II Convert_programming_file
Info: Command: quartus_cpf --no_banner --convert led_test.pof led_test.rpd
Info: Quartus II Convert_programming_file was successful. 0 errors, 0 warnings
    Info: Peak virtual memory: 68 megabytes
    Info: Processing ended: Wed Mar 30 12:34:51 2011
    Info: Elapsed time: 00:00:03
    Info: Total CPU time (on all processors): 00:00:02

# Programming flash with the FPGA configuration
"$SOPC_KIT_NIOS2/bin/nios2-flash-programmer" --epcs --base=0x01001800 --sidp=0x0
1002018 --id=1794073991 --timestamp=1301451768 --instance=0 "led_test.flash"
Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
Resetting and pausing target processor: OK
Reading System ID at address 0x01002018: verified

: Checksumming existing contents

00000000      : Verifying existing contents

00010000      : Verifying existing contents

00020000      : Verifying existing contents

00000000      : Reading existing contents

00010000      : Reading existing contents

00020000      : Reading existing contents

Checksummed/read 54kB in 1.4s

00000000 ( 0%): Erasing

00010000 (33%): Erasing

00020000 (66%): Erasing

Erased 192kB in 1.9s (101.0kB/s)

00000000 ( 0%): Programming

00010000 (33%): Programming

00020000 (66%): Programming

Programmed 139KB +53KB in 3.3s (58.1KB/s)                 
Did not attempt to verify device contents
Leaving target processor paused

# Creating .flash file for the project
"$SOPC_KIT_NIOS2/bin/elf2flash" --epcs --after="led_test.flash" --input="led_tes
t.elf" --output="epcs_controller.flash"

# Programming flash with the project
"$SOPC_KIT_NIOS2/bin/nios2-flash-programmer" --epcs --base=0x01001800 --sidp=0x0
1002018 --id=1794073991 --timestamp=1301451768 --instance=0 "epcs_controller.fla
sh"
Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
Resetting and pausing target processor: OK
Reading System ID at address 0x01002018: verified

: Checksumming existing contents

00020000      : Verifying existing contents

00020000      : Reading existing contents

Checksummed/read 42kB in 1.1s

00020000 ( 0%): Erasing

Erased 64kB in 0.6s (106.6kB/s)

00020000 ( 0%): Programming

Programmed 23KB +41KB in 0.7s (91.4KB/s)                  
Did not attempt to verify device contents
Leaving target processor paused

烧写完成,Reset或者断电重启,烧写在EPCS中的程序即开始运行了。

Nios程序烧写到EPCS方法 - 第1页 - asus119's Blog - EDN China电子设计技术的更多相关文章

  1. 【DSP开发】TMS320C66x DSP SPI Nor Flash的程序烧写

    经过一段时间的研究终于把TMS320C6657单核和双核的SPI Nor Flash的程序烧写调通了.工具都是前辈的工作,有需要的可以留下邮箱,我有空可以发. 原理参考钱丰的<TI c66x 系 ...

  2. sd卡脱机烧写系统的方法(测试成功)

    一.sd卡烧写系统的基本思路: (1)把uboot.bin烧写到sd卡 (2)把image整个文件夹复制到sd卡 (3)开发板从sd卡启动,就开始自动烧写到nandflash中了. 二.烧写uboot ...

  3. 走进STM32世界之Hex程序烧写

    多数51单片机(STC系列单片机)的初学者都知道,在51单片机初上电时,可以通过PC机上位机软件将程序引导至bootloader,从而将新程序的hex文件下载至单片机中,完成程序的升级或是更新.在32 ...

  4. MDK972-EK开发板裸调试设置和裸机程序烧写(转)

    硬件平台:MDK972-EK开发板编译调试软件:KEIL uVision4仿真工具:JLINK V7/V8   本例子从串口输出信息,如图:       KEIL uVision4调试设置如图所示: ...

  5. esp32(M5STACK)程序烧写(Ubuntu)

    由于我们的开发环境在Ubuntu上,所以介绍一下如何在Ubuntu上烧写esp32的程序 首先下载esptools   pip install esptool           擦除 sudo es ...

  6. 关于NIOS ii烧写的几种方式(转)

    源:http://www.cnblogs.com/bingoo/p/3450850.html 1. 方法一:.sof和.elf全部保存在FPGA内,程序加载和运行也是在FPGA内部. 把FPGA的配置 ...

  7. 关于NIOS ii烧写的几种方式

    1. 方法一:.sof和.elf全部保存在FPGA内,程序加载和运行也是在FPGA内部. 把FPGA的配置文件.sof通过JTAG方式下载(其实是在线运行)进入FPGA本身,此时在NIOS II的界面 ...

  8. 在远程服务器上完成本地设备的程序烧写和调试(基于vivado ,SDK软件)

    在使用vivado和SDK进行设计开发的时候,通常需要登录到远程服务器上进行,但是会遇到一个问题就是,所使用的开发板通常是连接在自己的电脑上(local-PC),那要怎么才能让运行在服务器上的设计软件 ...

  9. adi 程序烧写

    3.2 U-Boot Console Output Here we need set up minicom to open target board serial console. sudo mini ...

随机推荐

  1. QT5的exe的发布

    直接release的exe文件需要很多dll关联,一个一个找又太麻烦. 其实QT5带有一个 windeployqt 工具 Qt Widgets Application可执行程序发布方式 首先用 QtC ...

  2. 使用nginx进行负载均衡

    nginx主要用于1:请求分流 2:负载均衡.用在大型系统(集群)上,在单机上体现不出优势.  本实例在windows环境下进行.  一.安装nginx  1.下载nginx1.8.0版 2.解压至1 ...

  3. 每天一个Linux命令(32)date命令

          date命令是显示或设置系统时间与日期.        (1)用法:       用法:  date [选项]  [参数]       (2)功能:       功能:  根据指定格式显示 ...

  4. 【leetcode刷题笔记】Insertion Sort List

    Sort a linked list using insertion sort. 题解:实现链表的插入排序. 要注意的地方就是,处理链表插入的时候尽量往当前游标的后面插入,而不要往前面插入,后者非常麻 ...

  5. Redis的管理

    一.redis持久化 redis是内存数据库,一切的数据都是存储到内存中的,我们知道,当服务器意外关机,那么在内存中的数据都将丢失,但是redis为我们提供持久化功能,这样就能把数据保存到硬盘上.re ...

  6. sass表达式前后出现空格

    最近发现一个问题,当我用mixin将px转rem时: @mixin pxToRem($remVal: 1){ font-size: ($remVal/75)rem; }.a { @include px ...

  7. delphi通过Idhttp和php交互

    最近需要做delphi和php交互的方法: 就把这2个方法写了下 一,Get方法 const Url = 'http://www.cnblogs.com'; procedure TForm1.Butt ...

  8. Spring Cloud之统一fallback接口

    每个方法都配备一个fallback方法 不利于开发的 用类的方式 并且整个方法都是在同一个线程池里面的 主要对于client的修改: pom: <project xmlns="http ...

  9. bash rz 上传文件失败问题

    原文链接: https://blog.csdn.net/heavendai/article/details/7549065 单独用rz会有两个问题:上传中断.上传文件变化(md5不同), 解决办法是上 ...

  10. windows 批处理ping ip

    //pingSingleIp ;;@Echo off @for /f "tokens=1-4 delims=." %%i in (ip.txt) do (@ping -w 600 ...