
Last input command: Bin2Hex hwb.bin hwb.hex, after input, you can see the prompt said conversion success, we check whether there is a hex file, the code support for this article is greater than 64K, we will convert the hex download to a single-chip computer run try.(Unit values from 128 to 255 do not exist in the ASCII table. Then click on the menu start, run-and input cmd-> into the DOS window, adjust the current directory as C:, this if you do not know Baidu can be a bit, cannot be the command CD. #ifndef bin2hex_h#define bin2hex_htypedef unsigned char uint8_t typedef unsigned short uint16_t typedef unsigned long UIn t32_t /******************************************************************************** is every time you read and write Bin file n bytes, Then convert to hex format stream, hex format Stream Length calculation method: + length + address + type + N data (n >= 0) + checksum 1 + 2 + 4+ 2 + N * 2 + 2****************************** /#define Number_of_one_line0x20#definemax_buffer_of_one_line ( Number_of_one_line * 2 + one) typedef struct Ĭompile and build the Bin2hex.c file for three source files.īelow is a description of the following usage:Ĭopy the bin2hex.c file to the C packing directory, and then copy a bin file that needs to be converted, here I copy a hwb.bin file. Said so much, the following directly posted code, there is not detailed can give me a message, but also welcome everyone to spray me. The next one is the hex file converted to a bin file, just as opposed to this article. Originally should be to describe the data format of the hex file, this left the next article to describe, in fact, there are many Baidu. I use the Development Board s3c2440 on the ADS1.2 compiled code is the bin format stream, with J-flash open the file when you need to fill in the offset address, Samsung platform Flash offset address is 0, and stm32 platform Flash offset address is 0x08000000. Interested classmates, can try to use disassembly, get is the assembly code. And the bin file is no address, all binary data stream, stop, is actually what we call the machine code. Most commonly speaking, Hex is with the address, when downloading with the downloader, do not need to set the offset address, it is the file stream format, is the standard ASCII code. What does that bin file mean, and what's the difference between it and the hex file? This is not the focus of this article, the following simple description:


For the embedded, the hex file may be familiar to everyone, yes, we study in the University of the 51 single-chip computer code compiled on the Keil generated after the hex file.
