sofelf转jic

一、将HW和SW合成一个JIC文件

    需要的文件:sof,elf;

step1:先将硬件映像和软件映像转换成flash文件

打开nios II commandshell,输入:

   

sof2flash --input=hello_cy3.sof--output=hwimage.flash --epcs --verbose

 

elf2flash --input=hello_world_0.elf--output=swimage.flash --epcs --after=hwimage.flash –verbose

 

  step2:把flash文件转化成hex文件

 

nios2-elf-objcopy-I srec -O ihex hwimage.flash hwimage.hex

nios2-elf-objcopy-I srec -O ihex swimage.flashs wimage.hex

 

step3:打开Quartus® IIConvert Programming File 工具,给Flash Loader添加器件类型,然后添加第2步转化出来的hex文件。添加hex文件时,选中“相对地址”选项。

   

 

点击Gererate,即生成了jic文件,再检查生成的.map 文件有hwimage.hex在起始地址0x0,swimage.hex文件在hwimage.hex结束地址后的起始地址1

hwsw_file.map显示了地址信息

 

BLOCK             START ADDRESS        END ADDRESS
hwimage.hex        0x00000000        0x00030FA5
swimage.hex        0x00030FA6        0x0003131D
Note: All the addresses in this file are byte addresses

 

注意:原SOF生成的hex文件从0地址开始编写,加入nios后的hex接在后面。

 

二、使用nios II command shell下载sof、elf文件

1、  先将sof、elf文件转化为flash文件

 

if !(test -e hwimage.flash)

then sof2flash --epcs --input=hwimage.sof --output=hwimage.flash

fi

 

if !(test -e swimage.flash)

then elf2flash --epcs --after=hwimage.flash  --input=swimage.elf  --output=swimage.flash

fi

 

2、  在下载flash文件之前需在FPGA加载hwimage.sof

 

nios2-configure-sof //未指定文件名,默认加载当前目录下的sof文件

 

3、  烧写flash文件

 

nios2-flash-programmer --epcs --base=0x00001000  hwimage.flash

nios2-flash-programmer --epcs --base=0x00001000  swimage.flash --go

注:--base :在niosII核在avalone总线上epcs核的基地址。

 

三、擦除整片epcs内容

nios2-flash-programmer --epcs--base=0x00001000  --erase-all

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值