1.SRecord

SRecord 官方网站 link
SRecord Tools
The Tools
A number of tools are include in the SRecord package. All of the tools understand all of the file formats, and all of the filters.

srec_cat

The srec_cat program may be used to catenate (join) EPROM load files, or portions of EPROM load files, together. Because it understands all of the input and output formats, it can also be used to convert files from one format to another. It also understands filters.

srec_cmp

The srec_cmp program may be used to compare EPROM load files, or portions of EPROM load files, for equality.

srec_info

The srec_info program may be used to print summary information about EPROM load files.

2.Hex2bin

2.1 工程目录

Folder
其中output:生成的文件
src:待转换的文件
tool:下载的SRecord packages

2.2 BAT

复制代码到记事本然后修改后缀名为**.bat**.

@echo off
@Rem COPYRIGHT (C)2020 LIUDULAB, Inc., All Rights Reserved
@Rem Author: farmer00
@Rem Version: 1.0
@Rem Date: 4-14-2020
@Rem Convert Hex file to Bin File

set varRootPath=%cd%
set varCatToolPath=%varRootPath%\tool\srec_cat.exe
set varCmpToolPath=%varRootPath%\tool\srec_cmp.exe
set varInfoToolPath=%varRootPath%\tool\srec_info.exe

set varSrcFile=%varRootPath%\src\test.hex
set varOutFile=%varRootPath%\output\test.bin

set varOffset=-0x00010000
@Rem print srec_cat version
echo ------------------------------------------------------------------
%varCatToolPath% -VERSion
echo ------------------------------------------------------------------

@Rem Hex--->Bin
@Rem %varCatToolPath% %varSrcFile% -intel -o -hex-dump
%varCatToolPath% %varSrcFile% -intel -offset %varOffset% -o %varOutFile% -binary
echo Hex File had been convert to Bin file!
pause

欢迎关注六度杂货铺公众号, 回复 SRecord 即可索取。
在这里插入图片描述

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐