In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "the difference between hex file, bin file and axf file in STM32 development", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn the difference between hex files, bin files and axf files in STM32 development.
The process of compilation
STM32 is also developed in C language and goes through a similar compilation process, but we often use MDK or other IDE to compile, and the compilation process is as follows:
For example, our LED program compilation process is as follows:
When compiling in IDE, we only need to click the compile button to complete these processes. The tools used in the compilation process (.exe file) are in a folder under the installation directory of IDE, such as the path of the compilation tool we use here:
Generally, some of the compilation tools for these IDE or toolsets are placed in the bin folder. For example, the compilation tool path for our MinGW toolset (which contains a gcc/g++ compiler that can compile programs that run on computers) is:
Back to the point, our MDK compile time is to use these compilation tools under the installation path to complete our compilation process.
In essence, we can also compile our STM32 program through commands in the cmd command window (provided that the environment variables are configured, otherwise we can compile under the path where the compilation tool is located).
But we won't do that because IDE has already provided us with a lot of convenience. For example:
Let's take a look at what happens by running the armcc command under the cmd window:
We have seen a lot of hints about the armcc command, and some common compilation options have been integrated into MDK for us to choose from, such as:
Burnable file
Axf files, hex files and bin files can all be run on our stm32. They all store the machine code generated by the compiler according to the source code, and they vary according to the application.
Axf file: contains debugging information. Hex file: contains address information. Bin file: the most direct code image.
The axf file, which is used for debug debugging in MDK, is the file that is generated by default and contains not only code data, but also debugging information.
The hex file can be generated only by checking the following options in MDK:
The hex file is a code record represented by hexadecimal symbols, recording the address where the code should be stored in FLASH, and the downloader can assist in downloading based on this information.
The bin file is generated from the axf file, and you need to add a command similar to the following format under MDK to generate the corresponding bin file:
The bin file is the smallest file that can be run, and it contains the most direct code image. Among the three files, axf file is the largest, hex file is the second, and bin file is the smallest, such as:
The difference between them is just a simple explanation. Friends who have time, energy and interest can analyze their contents.
The burning method of offline files
The burning of hex files can be downloaded through the serial port using the FlyMcu tool:
FlyMcu cannot burn bin files, because as mentioned above, bin files only contain the most direct code image and do not contain address information. The following error will occur:
Bin files can be downloaded through STLINK using the STM32CubeProgrammer software:
At this point, I believe you have a deeper understanding of "the difference between hex files, bin files and axf files in STM32 development". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.