Because I know I'll be asked:
Micro: MSP430F2619
CCS version: 5.3.0.00090 - using TI's compiler
I'm working on an application that uses a lot of the 4K of RAM in 2619. I've got it running, but I've been watching my RAM usage quite closely and discovered something in the MAP file that I don't understand. When I scroll down through the MAP file I come to a section titled: GLOBAL SYMBOLS: SORTED BY Symbol Address. Scrolling down to address 0x01100 my global variables are listed, with their respective addresses. Most of them use exactly the amount of memory they need. For example an unsigned int will take up 2 bytes, a long 4 bytes. I've got a couple of arrays and they use exactly the amount of space I allocated in my program. However, there are a few variables that have to have gaps in RAM between their address and the next variable. Which would lead me to believe I have memory that is being wasted.
For example at address 0x1884 I have an unsigned int variable named "rawVcc" this should only take up two bytes of RAM, the next variable is an unsigned char named "Sector" but it's mapped to address 0x188E - (10 bytes down). This means there are 8 bytes of unused RAM between rawVcc and Sector. There's a few other variables are doing the same thing- each having gaps between 8 to 12 bytes. I have confirmed that these variables are declared as char, int, or long, etc. and not arrays.
Currently this isn't causing me problems, but before I'm done with this application, I'm going to be need more RAM and the 20 to 30 bytes being wasted might mean the difference between my code running and not running.
So.... Why is the compiler/linker leaving gaps in my RAM? Is there anyway to force the compiler/linker to not leave these gaps?
Thanks