altera FPGA 程序固化命令

altera FPGA 程序固化命令

一、命令解析

1)sof文件转为flash文件的命令:

qsys_sdram.sof为sof文件名称,hwimage.flash为生成的flash名称,针对不同的工程只需要更改这两个地方就可以

tlc 复制代码
 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文件。

复制代码
nios2-elf-objcopy --input-target srec --output-target ihex swimage.flash swimage.hex

二、小梅哥程序固化命令脚本

脚本使用方法直接上小梅哥的视频:传送门

复制代码
https://www.bilibili.com/video/BV1NE411q7Y3/?p=16&vd_source=58dae662e3d0551fcf0adfdc00c4e557
  1. generate_jic.cof
javascript 复制代码
<?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>
  1. generate_jic.sh
shell 复制代码
#/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 ../
  1. generate_jic.tcl
c 复制代码
exec quartus_cpf -c generate_jic.cof
c 复制代码
	---晓凡  2023年10月2日于武汉书
相关推荐
s09071361 小时前
FPGA实现Gamma校正的系统性指南
图像处理·fpga开发·gama校正
读书点滴2 小时前
FPGA中如何获取任何一条路径的延时
fpga开发
minglie12 小时前
嵌入式协程AlarmProtothread
mcu·fpga开发
Godspeed Zhao3 小时前
自动驾驶中的传感器技术79——Sensor Fusion(2)
人工智能·fpga开发·自动驾驶
ShiMetaPi3 小时前
GM-3568JHF丨ARM+FPGA异构开发板系列教程:外设教程 07 音频
arm开发·fpga开发·音视频·fpga·rk3568
bitQ13 小时前
ZBoot-MP:ZYNQ 多介质 Linux 启动与升级解决方案
fpga开发
我爱C编程1 天前
【1.22】基于FPGA的Costas环开发课程学习总结
学习·fpga开发·costas环
FPGA_无线通信1 天前
USB3.0 GPIF II接口
fpga开发
Terasic友晶科技1 天前
5-DE10-Nano的HDMI方块移动案例——基于FPGA的I2C控制模块设计
单片机·嵌入式硬件·fpga开发·时钟分频·hdmi方块移动·i2c控制模块设计·配置寄存器
Joshua-a1 天前
AGM FPGA AG10K 使用Supra新建Quartus工程开发教程
fpga开发