HI, From forum i came to know that
1. ZI Data: Zero Initialized Data
2. RO Data are the constants.
Total RAM Size = RW Data + ZI Data Total ROM Size = Code + RO Data + RW Data
so size of hex file generated after succesfull compilation should size of ROM size.
am I correct? If not correct me please.
Rajbabu.
The hex file is a file in ASCII. So every byte in the ROM is represented by two ASCII characters.
And the hex file also contains checksum information, and address information.
So in the general case, the hex file will be more than twice as large as the ROM image.
Just that in case there is a hole in the ROM image, then a binary file may contain filler data for that gap, while the hex file may instead just contain an address reference to inform where the rest of the data should be placed. So a hex file can in that case be smaller than a binary file.
In short - you shouldn't draw too large conclusions from the size of a hex file.
Thanks Per Westermark,
I also checked for HEX file format as directed by Neil and I understood what you described.
But what matter for us size of HEX file or Size of ROM during dumping .HEX file into flash.
For example my ROM size is 490KB after compilation of code and at the same time size of .HEX can be 800KB.
Now my LPC2148 has only 512KB. So can i dump this code into flash or not.
Apparently you didn't!
"For example my ROM size is 490KB after compilation of code and at the same time size of .HEX can be 800KB"
As Per explained, each byte to be programmed is represented by two characters in the Hex file. So you should expect that the Hex file will be at least twice the size of the code - shouldn't you?!
Again, a Hex file is just a means of conveying the data - the Hex file itself is not put into the Flash!
For a detailed picture of a program's memory usage, look in the Map file...
Thanks Neil,
"Again, a Hex file is just a means of conveying the data - the Hex file itself is not put into the Flash! "
Now i got it after after reading link provided by you.
Once i will repeat what i understood for confirmation.
"HEX file only envelope for our data to understand by programmer what type of data it is. So programmer will remove this envelope during programming( writing into flash) and it will write only data into flash." Is it correct.
Rajbabu
"HEX file only envelope for our data"
Correct.
"to understand by programmer what type of data it is"
Not really.
To the programmer, it's just data - the programmer has no "understanding" of what the data represents.
"So programmer will remove this envelope during programming (writing into flash) and it will write only data into flash."
Yes.
Thanks you very much Neil for your suggestions and support.