Any malloc,calloc,realloc,free causes ERROR L1102: Out of allocation space in CW 10.2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Any malloc,calloc,realloc,free causes ERROR L1102: Out of allocation space in CW 10.2

562 Views
paulking
Contributor I

I am doing product development using Digi's programmable Xbee radio modem.  Digi's SDK integrates tightly with a "special" version (10.2) of Codewarrior.  If I introduce a line such as: p = calloc(4,sizeof(int)) the linker throws ERROR L1102 and virtually nothing gets allocated memory according to the .map file.  If I comment the calloc out, the program compiles and links with no issues and still plenty of space according to the .map file.  This occurs with malloc, calloc, and free (I assume it will happen with realloc as well but since I can't get anything allocated...).

 

It has been suggested that I modify LIBDEF_HEAPSIZE in libdefs.h (which defaults to 2000 - way too big as the Xbee only has 2k of ram) and recompile the hs08 libraries.  Unfortunately, this version of CW is license restricted to ridiculously small code sizes and is therefore useless for this purpose.  I have downloaded the trial version of CW 10.7 for MPU to attempt this but it generated a huge number of compile errors I am still trying to sort through - I am not hopeful...

 

Suggestions?  

Labels (1)
0 Kudos
1 Reply

358 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

I didn't see your specific project I can only provide you general information about L1102 based on CW for HCS08 help manual:

========================================

The specified segment is not big enough to contain all objects from the sections placed in it.
<segment name>: is the name of the segment, which is too small.
<first address free>: is the first address free in this segment (i.e. the address following directly the last address used).


Tips
Set the end address of the specified segment to an higher value.

==========================================

If above information can not help you out, please upload your demo project here. I will check it directly from my side.

Thanks.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos