In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what are HEX files and BIN files". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
What are Hex files and Bin files
Hex files save compiled binary file information in ASCII text. The Hex file uses ASCII text to save the contents of the Bin file and some configuration information of the Bin file. Hex files can be burned and written to the ROM of MCU by downloaders such as jlink.
The Bin file is the final form of burning MCU firmware, which means that the content burned in the ROM of MCU is exactly the content of the Bin file.
The relationship between Hex file and Bin file
The Hex file can be said to be the intermediate form of the MCU firmware, which is generated by the software of the downloader according to the Hex file and then burned to the ROM of MCU. Since Bin files are what we want in the end, what is the value of Hex files? Why don't we generate the Bin file directly, but the Hex file instead? This starts from the content format of the Hex file.
Content format of Hex
From the above we know that the Hex file not only saves the contents of the Bin file, but also some configuration information. Let's outline the structure of the Hex file with an example, as shown in the following figure:
The Hex file above contains a total of 6 lines. Each row starts with':', followed by address field, data type, data field, and checksum.
The data type of the last line is 0x01, which means the file is over.
The existence value of Hex file and Bin file
From the above introduction, we find that each line in the Hex file is like the data frame in which we send serial data, and the last line also indicates that the file is over. We get two advantages of hex files:
\ 1. Use ASCII text to save firmware information, making it easy to view some firmware content
\ 2. Through the checksum of each line of the file and the end flag of the last line of the file, the integrity of the firmware can be found in the process of transferring and saving the file.
Hex files are more readable, and the most important thing is that hex files can ensure the integrity of firmware during storage and transfer. Therefore, hex files are more suitable for saving and transferring. The Bin file is a pure binary file, which only contains the compiled machine code and variable data. When the file is corrupted, we cannot know that the file is corrupted. However, as the final form of firmware, Bin files are irreplaceable when downloading programs using serial ports or upgrading remotely.
This is the end of the content of "what are HEX files and BIN files". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.