This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Checking Memory Usage

Other Parts Discussed in Thread: TMS320F2812

Hi,

 

I'm a novice with TI devices.  I'm working on a project which uses a TMS320F2812.  I'd like to know how I'm doing with memory usage.  In other IDEs, there's usually a means to look at your how much memory your program uses.  I can't seem to find anything like this in code composer.  My project is a non-bios.  How can I see my memory stats?  Thanks in advance.

 

Jason

  • Jason,

    The .map file generated when building the project will show you how much memory is being used. This is generated in the Debug/Release folder after building your project. If you look at this folder and it not there, you will need to go to Project -> Build Options -> Linker and specify a filename and directory in the Map Filename option.

    Regards,

    Tim Love

  • Thanks Tim.

    So I'm having trouble interpreting what I'm seeing.  Basically, I want to know how much margin I have for additional variables.  What's not clear to me what percentage of available memory my program is currently using.  Here is the output:

    MEMORY CONFIGURATION

    name origin length used attr fill
    ---------------------- -------- --------- -------- ---- --------
    PAGE 0: ZONE0 00002000 00002000 00000000 RWIX
    ZONE1 00004000 00002000 00000000 RWIX
    RAML0 00008000 00001000 0000001b RWIX
    ZONE2 00080000 00080000 00000000 RWIX
    ZONE6 00100000 00080000 00000000 RWIX
    OTP 003d7800 00000800 00000000 RWIX
    FLASHJ 003d8000 00002000 00000000 RWIX
    FLASHI 003da000 00002000 00000000 RWIX
    FLASHH 003dc000 00004000 00000000 RWIX
    FLASHG 003e0000 00004000 00000000 RWIX
    FLASHF 003e4000 00004000 00000000 RWIX
    FLASHE 003e8000 00004000 00000000 RWIX
    FLASHD 003ec000 00004000 0000001b RWIX
    FLASHC 003f0000 00004000 00000000 RWIX
    FLASHA 003f6000 00001f80 00001d48 RWIX
    CSM_RSVD 003f7f80 00000076 00000000 RWIX
    BEGIN 003f7ff6 00000002 00000002 RWIX
    CSM_PWL 003f7ff8 00000008 00000000 RWIX
    ROM 003ff000 00000fc0 00000000 RWIX
    RESET 003fffc0 00000002 00000000 RWIX
    VECTORS 003fffc2 0000003e 00000000 RWIX

    PAGE 1: RAMM0 00000000 00000400 00000400 RWIX
    RAMM1 00000400 00000400 00000000 RWIX
    DEV_EMU 00000880 00000180 000000d0 RWIX
    FLASH_REGS 00000a80 00000060 00000008 RWIX
    CSM 00000ae0 00000010 00000010 RWIX
    XINTF 00000b20 00000020 00000020 RWIX
    CPU_TIMER0 00000c00 00000008 00000008 RWIX
    PIE_CTRL 00000ce0 00000020 0000001a RWIX
    PIE_VECT 00000d00 00000100 00000100 RWIX
    ECANA 00006000 00000040 00000034 RWIX
    ECANA_LAM 00006040 00000040 00000040 RWIX
    ECANA_MOTS 00006080 00000040 00000040 RWIX
    ECANA_MOTO 000060c0 00000040 00000040 RWIX
    ECANA_MBOX 00006100 00000100 00000100 RWIX
    SYSTEM 00007010 00000020 00000020 RWIX
    SPIA 00007040 00000010 00000010 RWIX
    SCIA 00007050 00000010 00000010 RWIX
    XINTRUPT 00007070 00000010 00000010 RWIX
    GPIOMUX 000070c0 00000020 00000020 RWIX
    GPIODAT 000070e0 00000020 00000020 RWIX
    ADC 00007100 00000020 0000001a RWIX
    EVA 00007400 00000040 00000032 RWIX
    EVB 00007500 00000040 00000032 RWIX
    SCIB 00007750 00000010 00000010 RWIX
    MCBSPA 00007800 00000040 00000025 RWIX
    RAML1 00009000 00001000 00000ea5 RWIX
    FLASHB 003f4000 00002000 00000000 RWIX
    CSM_PWL 003f7ff8 00000008 00000008 RWIX
    RAMH0 003f8000 00002000 00000000 RWIX

    From what I can tell, I'm pretty close to using all of my flash memory in Flash sector A.  But nothing seems to be allocated to the other flash sectors.  Why is this?  I built this project from an example.  I experimented with adding a large dummy array to see if I would get compile errors and I do.  Actually, it didn't take a very large array to get to that point which confirms that Flash A is pretty full.  How do I go about getting the compiler to utilize the other flash sectors?  Any info that could point me in the right direction would be greatly appreciated.

    Thanks,

    Jason

  • Jason,

    You are correct that FLASHA is nearly full. The way this reads is that the 3rd column is the size of the memory area and the 4th column is how much of this memory is used. The reason why nothing is allocated to the other flash sectors is because of the allocation in the .cmd file. You have to allocate your sections manually. This may mean that you need to combine some of your memory configuration to make a larger section. For example, the flash memory is one contiguous memory area so you could remove the allocation for each section and just create a section named FLASH that is the length of all of the sections. For further information on the linker you should check out Chapter 7 of the Assembly Language Tools User's Guide:

    http://focus.ti.com/lit/ug/spru513c/spru513c.pdf

    Regards,

    Tim Love

  • You've been very helpful Tim.  Thanks!