当前位置:网站首页>Batch multiple files into one hex
Batch multiple files into one hex
2022-04-23 01:46:00 【Traceless rain】
Because the project contains boot Procedure area ,boot Data area ,APP Procedure area ,APP Data area , This is shown below
Therefore, multiple files need to be combined into one when producing and distributing hex download .
Through Baidu, there are several schemes as follows :
1、 adopt J-Falsh Tools , The multiple Bin File composition one hex( Specific operation method , Please Baidu );
2、 Through batch tools ( be used fsutil.exe、cat.exe and hbin.exe) The multiple Bin File composition one Bin file , Then convert it into a hex, Please refer to :bin File merge tool (UBIN) Usage method _u012572552 The blog of -CSDN Blog ;
3、 Through batch tools (srec_cat.exe) The multiple Hex Synthesis of a hex file , Please refer to :STM32 Batch multiple hex File merge , Re pass STM32CubeProg Download at the same time .
Through my actual operation , The scheme was chosen 3, use SRecord Tools ( link : Baidu SkyDrive Please enter the extraction code Extraction code : ux8q) Realized the function .
As for why to choose the scheme 3, Because the plan 2 synthesis Bin When it comes to documentation , You need to calculate the offset , I'm in trouble , It's a personal preference , It's your choice ; programme 1 Too complicated , In case of wrong address , The file is wrong , Each generation hex You have to verify .
Operation steps :
One 、 according to APP Program generation BOOT Parameter area :
because BOOT The procedure is based on BOOT Check the parameter area APP Procedure area , Judge APP Whether there are programs in the program area , Jump or not . So I wrote a gadget , according to app.bin file , Yield BootConfig.bin file . According to your actual project needs , Decide whether to produce BootConfig File and file format .
Two 、 hold BIN Document production HEX file
@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 Bin file to Hex 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.bin
set varOutFile=%varRootPath%\output\test.hex
set varOffset=0x10000
@Rem print srec_cat version
echo ------------------------------------------------------------------
%varCatToolPath% -VERSion
echo ------------------------------------------------------------------
@Rem Bin--->Hex
Rem %varCatToolPath% %varSrcFile% -binary -offset %varOffset% -o -hex-dump
%varCatToolPath% %varSrcFile% -binary -offset %varOffset% -o %varOutFile% -intel
echo Bin File had been convert to Hex file!
pause
3、 ... and 、 How many HEX Synthesis of a HEX
set varSrcFile21=%varRootPath%\src\123.hex
set varSrcFile22=%varRootPath%\src\345.hex
set varSrcFile23=%varRootPath%\src\567.hex
set varOutFile21=%varRootPath%\output\789_%year%%month%%day%.hex
@Rem Hex--->Hex
%varCatToolPath% %varSrcFile21% -intel %varSrcFile22% -intel %varSrcFile23% -intel -o %varOutFile21% -intel
Get the current time :
set "year=%date:~0,4%"
set "month=%date:~5,2%"
set "day=%date:~8,2%"
set "hour_ten=%time:~0,1%"
set "hour_one=%time:~1,1%"
set "minute=%time:~3,2%"
set "second=%time:~6,2%"
Delete some intermediate files :
del %varSrcFile% /s
del %varOutFile% /s
del %varOutFile11% /s
<----------------------------------------------------2021.10.13--------------------------------------------------------->
Yesterday, I called... Through a batch program SRecord The tool implements bin File transfer HEX,HEX Merge files into one production release file , But there is one in it “ Annoying steps ”, Need to use my own development MFC Tools according to APP Generate bootConfig.bin file , Then you can merge through batch processing . For those who pursue perfection , This is unbearable , How to solve it ?
At first I was wondering if I could put MFC The functions inside are transplanted to batch processing , So look at the batch Syntax , How to define a function , How to call functions, etc , Find it too difficult ; So I changed my mind , Since there are SRecord Tools , Can I develop a similar tool , Realize the function I want , So look for it win32 Console program data , Please have a look at : How to use VS2010 Create a new one Win32 Console application project , I found , Looked at the , hold MFC Function transplantation to Win32 Console program , Too simple. .
Yes? LOG Print ? Please have a look at : stay Win32 Used in applications Console Console output information ( primary )
How to call win32 The console program passes in parameters ? Please have a look at :_tmain(int argc, _TCHAR* ARGV[]) The usage of the next command line parameter
Here's the thing to note :
1)argc This parameter does not need to be passed in manually , The system will automatically transfer in ;argc Used to count the number of parameters , Because the path is the default Parameters of , therefore argc At least for 1
2)argv[0] Indicates the path and name of the input program , That is, when you write the full path name of the tool , Call tool , As The first parameter input ;
3)argv[1],argv[2]... Indicates the parameters you entered .
版权声明
本文为[Traceless rain]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230143119606.html
边栏推荐
- Is the stable currency a super opportunity to accelerate the death of the public chain or replace BTC?
- K zeros after leetcode factorial function
- (product resources) mingdeyang ad8488 module high performance digital X-ray FMC interface 128 analog channel high-speed ADC chip
- [experience tutorial] Alipay balance automatically transferred to the balance of treasure how to set off, cancel Alipay balance automatically transferred to balance treasure?
- iTextSharp 页面设置
- Update description of the latest process engine flowable 6.7.2
- When should I write unit tests? What is TDD?
- 2022.4.22-----leetcode.396
- LSF的常用使用命令总结
- 2022.4.10-----leetcode.804
猜你喜欢
2022 Saison 6 perfect Kid Model IPA national race Leading the Meta - Universe Track
Slow response of analysis API
Technology cloud report: cloud computing has entered the "second half". Where is the way out for domestic cloud?
Abused "architect"!
Full Permutation (DFS and next_permutation solution)
Level 4 city area table xlsx, SQL file, domestic, provincial, county, street, township level 4 address in China (name, linkage ID, level, end level or not (1-yes))
2022第六季完美童模 IPA国民赛领跑元宇宙赛道
2022 crane driver (limited to bridge crane) examination question bank and online simulation examination
ESP32使用freeRTOS的消息队列
W801 / w800 WiFi socket development (I) - UDP
随机推荐
Error in face detection and signature of Tencent cloud interface
电子采购如何成为供应链中的增值功能?
English abbreviation of role personal attribute
Chris LATTNER, father of llvm: the golden age of compilers
Vscode + PHP debug + namespace guidelines
四级城市地区表 xlsx, sql文件,国内,中国省市县街道乡镇四级地址 (名称,联动ID,层级,是否末级(1-是))
npm——配置淘宝镜像
Counting garlic customers: Sudoku (DFS)
CC2541的仿真器CC Debugger使用教程
iTextSharp 页面设置
Is the stable currency a super opportunity to accelerate the death of the public chain or replace BTC?
Jerry's CPU performance test [chapter]
紫光国微财报一枝独秀 2021年净利润三位数增长靠什么
2022 low voltage electrician examination questions and answers
42、使用mmrotate中k3det进行旋转目标检测,并进行mnn部署和ncnn部署
Question bank and online simulation examination for safety management personnel of hazardous chemical business units in 2022
Technology cloud report: cloud computing has entered the "second half". Where is the way out for domestic cloud?
Leetcode-阶乘函数后 K 个零
[registration] tf54: engineer growth map and excellent R & D organization building
安装mysql出问题求解决