Hi
Presently I am using freescale CW:5.7.0, limited version with 32K(32768 B) code size limitation.
I am aware that .map file shows you the details of all the ROM,RAM memory usage. But I observed something which I am not able to understand. The map file shows the ROM used as 30892 Bytes, but the CW does compile the code as it shows that code is above 32KB.
Summary of section sizes per section type:
READ_ONLY (R): 78AB (dec: 30891)
READ_WRITE (R/W): 132A (dec: 4906)
NO_INIT (N/I): CE1 (dec: 3297)
the map file is attached for more information.
Pls enlighten me.
Codewarrior IDE takes and shows the sum of code/data sizes of all compiled modules, while map file shows code size after removing all unused variables and subroutines (deadstriping).
You may get code size also at the end of map file, "Total size of all blocks to be downloaded" is application code size:
ExeFile:
--------
Number of blocks to be downloaded: 9
Total size of all blocks to be downloaded: 30891
Thank you kef for your response.
May be I am not clear on my previous post. My actual question is the codewarrior(limited ver should compile the code size upto 32KB (32768 B), but it stops at 30892 telling the code size excedded the 32KB limit. I am not able to understand it.
greatj,
Did you take used library routines into account? I guess map file is not updated when linker finds you exceeded 32kB. Maybe you see map file from the last successful linking attempt, I'm not sure.
Hi kef
I tried compiling the code of different sizes both above and below 30892 Bytes. During this trial and error procedure only I found the magic no: 30892 Bytes, from and above which the IDE will give 32KB limitation message.
All the time I changed the code size(for both above and below 30892B) Iam getting ROM, RAM memory status changed.
For my verification I used only MAP file, do other normally used lib: routines doesnt get noted down in map file.
HI Lundin,
You maybe right, but Iwant to be sure.......
Hi Lundin,
Based on your suggestion, I commented some of the codes of certain files which I knew where not used anywhere , But still problem exists. I feel either it is a bug with Freeescle CW or we are missing something.
The linker, which is checking the license limitations, only considers allocated objects.
However the linker checks the objects which are read in from the C compiler, not the ones which
are written to the generated ELF file.
This is significant in multiple ways, first only C is limited, not other contributions. Well this would help you as you can indeed link apps > 32k, just as long as the >32k part is not from C.
However the linker counts initialized variables to the limit as well, not just code. Basically any content from C.
Therefore a struct like "int sample_arr[1000] = {1}; " counts as 2000 bytes even though when finally emitting the ELF file, the linker will only emit the information to zero out the whole thing and to write a single 1. So in the final ELF file this sample_arr variable only adds a few bytes to the ROM image (in the copy down and zero out data structures). That's why you can end up with a flash size smaller than 32k and still the linker starts complaining when you add one more byte to the app.
Daniel
Thank you CompilerGuru,
I verified . It seems compiler is taking the global variable also into accout to put the 32K ROM restriction. Is there any way to verify from map file, so as to get exact details.
Thank you once again.