altera FPGA 程序固化命令
一、命令解析
1)sof文件轉為flash文件的命令:
qsys_sdram.sof為sof文件名稱,hwimage.flash為生成的flash名稱,針對不同的工程只需要更改這兩個地方就可以
sof2flash --input=qsys_sdram.sof --output=hwimage.flash --epcs --verbose
2)elf文件轉為flash文件
qsys_sdram_rw.elf為elf文件的名稱,swimage.flash為要輸出的flash文件名字,第一個步驟生成的文件hwimage.flash作為參數輸入,輔助這次flash文件的生成;
elf2flash --input=qsys_sdram_rw.elf --output=swimage.flash --epcs --after=hwimage.flash -verbose
3)flash文件轉為hex文件
swimage.flash為第2步生成的flash文件,swimage.hex為要生成的hex文件。文章來源:http://www.zghlxwxcb.cn/news/detail-729634.html
nios2-elf-objcopy --input-target srec --output-target ihex swimage.flash swimage.hex
二、小梅哥程序固化命令腳本
腳本使用方法直接上小梅哥的視頻:傳送門文章來源地址http://www.zghlxwxcb.cn/news/detail-729634.html
https://www.bilibili.com/video/BV1NE411q7Y3/?p=16&vd_source=58dae662e3d0551fcf0adfdc00c4e557
- generate_jic.cof
<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
<cof>
<eprom_name>EPCS16</eprom_name>
<flash_loader_device>EP4CE10</flash_loader_device>
<output_filename>./myoutput_files/hs_combined.jic</output_filename>
<n_pages>1</n_pages>
<width>1</width>
<mode>7</mode>
<hex_block>
<hex_filename>./myoutput_files/swimage.hex</hex_filename>
<hex_addressing>relative</hex_addressing>
<hex_offset>0</hex_offset>
</hex_block>
<sof_data>
<user_name>Page_0</user_name>
<page_flags>1</page_flags>
<bit0>
<sof_filename>myoutput_files/hwimage.sof</sof_filename>
</bit0>
</sof_data>
<version>5</version>
<create_cvp_file>0</create_cvp_file>
<options>
<map_file>1</map_file>
</options>
</cof>
- generate_jic.sh
#/bin/sh
rm -rf flashconv
mkdir flashconv
chmod 777 ../../output_files/*.sof
cp ../../output_files/*.sof ./flashconv/hwimage.sof
cp *.elf ./flashconv/swimage.elf
cd flashconv
chmod 777 swimage.elf
sof2flash --input=hwimage.sof --output=hwimage.flash --epcs -verbose
elf2flash --input=swimage.elf --output=swimage.flash --epcs --after=hwimage.flash --verbose
nios2-elf-objcopy --input-target srec --output-target ihex swimage.flash swimage.hex
rm -rf ../../../myoutput_files
mkdir ../../../myoutput_files
cp swimage.hex ../../../myoutput_files/swimage.hex
cp hwimage.sof ../../../myoutput_files/hwimage.sof
cp ../generate_jic.cof ../../../generate_jic.cof
cp ../generate_jic.tcl ../../../generate_jic.tcl
cd ../
- generate_jic.tcl
exec quartus_cpf -c generate_jic.cof
---曉凡 2023年10月2日于武漢書
到了這里,關于altera FPGA 程序固化命令的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!