This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to reduce the size of data section in lpc 2214.?

Hi, i am develope a code in LPC2214 the max.RAm size is
16K,but i have a code,that size is exceeds 16K.I want to reduce my Data section in PRogram,for that purpose i used the #IFDEF preprocessor, even that also not reduce the data section size,it reduce only the code section size.

So, please sujjest me how to reduce the RAM size on C programming.

  • You are using too many and/or too large variables;

    Therefore you need to reduce the number and/or size of the variables in your program - especially globals & statics.

    Look at the Map file (Linker listing) for detailed information in memory usage...

  • sir,
    Is their any predefined preprocessors like #IFDEF are available?
    In my code at initial satge thier is one conditional checking is their. If iam using one part that only compile and execute remaining part is not.

  • You are entirely missing the point!

    The things that use up data memory are the variables that you define in your program.

    If you are defining too many and/or too large variables, then it is up to you to determine where the excess is!
    The compiler cannot do this for you!

    You need to look at the map file to determine what's using all the memory - and what you can remove and/or reduce.