I have been thinking about this content for a long time, but either I got busy or my writing skills were off, so I never got around to it. Today, I’ll finally share it; otherwise, it would be buried deep in my brain. Haha. The content is quite simple; it’s just about setting up the IAR environment (cough, you could say there’s hardly any technical content). However, the core idea of this article is to broaden everyone’s perspective: “Oh, so this is how it can be done”…
Now let’s get to the main topic:
First, let’s talk about the origins of these three file formats. The bin file is the most common binary file; it is a pure data file, meaning “what you see is what you get”. So if we want to check the size of the data that needs to be downloaded to the microcontroller’s flash, the simplest method is to look at the size of the bin file generated after compilation and linking. The hex file, on the other hand, is a file format introduced by Intel a long time ago (Intel is still incredibly impressive, isn’t it?). It contains not only valid data information but also some extraneous information (including address information, checksums, and other details), which is why hex files are larger. Ultimately, the data that gets written to the microcontroller’s flash is only the valid data segment, while the other information segments serve as auxiliary information for the flash programming software (including address information). Therefore, a common issue arises: when burning or downloading a bin file, the software prompts for the starting address, but when burning a hex file, there is no need to input the address information again because it is already included in the hex file. Haha, has anyone experienced this? That’s the reason! As for the S19 file, it is a file format proposed by Freescale, similar in principle to hex, but with a different format. I won’t go into detail about the specific hex and S19 file formats; you can google it yourself, haha~
Alright, I’ve discussed the theoretical basis; now let’s talk about how to operate it. It’s incredibly simple—so simple that I’m almost embarrassed to say it, so I’ll just show some images, haha:
As demonstrated in the images above, once you have selected the appropriate settings, click “OK”, then make it again, and you can find the file of the selected format in the FLASH_512KB_PFLASH\Exe directory under the project root. If you want to generate a different file format again, just set it up again, and it won’t overwrite the other formats. Then you can use the flash programming software to burn the newly generated file into the microcontroller. If it’s Kinetis, I recommend checking out an article I previously wrote titled “Teaching You to Use J-Flash ARM Tool to Independently Burn Programs to Kinetis” at http://www.eeskill.com/article/id/36563, which details what to do after generating the burn file, haha, very complementary, right?…
Let me take a sip of water~~ It’s actually very simple, right? Haha, the power of IAR still awaits us to explore. At some point in the future, I will share more colorful and practical tips about IAR, so stay tuned, haha, to be continued~