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.

TMS320F28069F: memory usage from map file

Part Number: TMS320F28069F

Hi All,

I'd like to check memory usage of my code to select chip type of cheaper one.

I've got following statistics from my map file

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

Module code initialized data uninitialized data
  ------     ----     ----------------     ------------------
.\
uartstdio.obj 1103 76 8384
main.obj 6098 400 1008
debug_module.obj 2879 4142 314

......

Heap: 0 0 1024
Stack: 0 0 944
+--+----------------------+-------+------------------+--------------------+
Grand Total: 28707 9084 14773

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

code : 28707

initialized data : 9084

uninitialized data : 14773

flash usage = 28707 + 9084

ram usage = 9084 + 14773

Is it correct ?

  • Hae Ryong,

    I would suggest using the top portion of the map file to make this decision as it contains the memory locations and length.  The info you have given doesn't give enough info.  For example the uninitialized section is most likely the bit field/control registers space which doesn't take up any physical SRAM.  Below is a C/P of data I am talking about for reference.  You can then determine which locations are RAM/Flash/system and then scale the device as needed;

    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
    PAGE 0:
      BEGIN                 00000000   00000002  00000002  00000000  RWIX
      RAMM0                 00000050   000003b0  0000001e  00000392  RWIX
      RAML0_L3              00008000   00002000  000008ca  00001736  RWIX
      FPUTABLES             003fd590   000006a0  00000000  000006a0  RWIX
      IQTABLES              003fdf00   00000b50  00000000  00000b50  RWIX
      IQTABLES2             003fea50   0000008c  00000000  0000008c  RWIX
      IQTABLES3             003feadc   000000aa  00000000  000000aa  RWIX
      BOOTROM               003ff3b0   00000c10  00000000  00000c10  RWIX
      RESET                 003fffc0   00000002  00000000  00000002  RWIX
    
    PAGE 1:
      BOOT_RSVD             00000002   0000004e  00000000  0000004e  RWIX
      RAMM1                 00000400   00000400  00000200  00000200  RWIX
      DEV_EMU               00000880   00000105  00000004  00000101  RWIX
      SYS_PWR_CTL           00000985   00000003  00000003  00000000  RWIX
      FLASH_REGS            00000a80   00000060  00000008  00000058  RWIX
      CSM                   00000ae0   00000020  00000010  00000010  RWIX
      ADC_RESULT            00000b00   00000020  00000010  00000010  RWIX
      CPU_TIMER0            00000c00   00000008  00000008  00000000  RWIX
      CPU_TIMER1            00000c08   00000008  00000008  00000000  RWIX
      CPU_TIMER2            00000c10   00000008  00000008  00000000  RWIX
      PIE_CTRL              00000ce0   00000020  0000001a  00000006  RWIX
      PIE_VECT              00000d00   00000100  00000100  00000000  RWIX
      DMA                   00001000   00000200  000000e0  00000120  RWIX
      CLA1                  00001400   00000080  00000040  00000040  RWIX
      USB0                  00004000   00001000  00000454  00000bac  RWIX
      McBSPA                00005000   00000040  00000024  0000001c  RWIX
      ECANA                 00006000   00000040  00000034  0000000c  RWIX
      ECANA_LAM             00006040   00000040  00000040  00000000  RWIX
      ECANA_MOTS            00006080   00000040  00000040  00000000  RWIX
      ECANA_MOTO            000060c0   00000040  00000040  00000000  RWIX
      ECANA_MBOX            00006100   00000100  00000100  00000000  RWIX
      COMP1                 00006400   00000020  00000014  0000000c  RWIX
      COMP2                 00006420   00000020  00000014  0000000c  RWIX
      COMP3                 00006440   00000020  00000014  0000000c  RWIX
      EPWM1                 00006800   00000040  00000040  00000000  RWIX
      EPWM2                 00006840   00000040  00000040  00000000  RWIX
      EPWM3                 00006880   00000040  00000040  00000000  RWIX
      EPWM4                 000068c0   00000040  00000040  00000000  RWIX
      EPWM5                 00006900   00000040  00000040  00000000  RWIX
      EPWM6                 00006940   00000040  00000040  00000000  RWIX
      EPWM7                 00006980   00000040  00000040  00000000  RWIX
      EPWM8                 000069c0   00000040  00000040  00000000  RWIX
      ECAP1                 00006a00   00000020  00000020  00000000  RWIX
      ECAP2                 00006a20   00000020  00000020  00000000  RWIX
      ECAP3                 00006a40   00000020  00000020  00000000  RWIX
      HRCAP1                00006ac0   00000020  00000020  00000000  RWIX
      HRCAP2                00006ae0   00000020  00000020  00000000  RWIX
      EQEP1                 00006b00   00000040  00000022  0000001e  RWIX
      EQEP2                 00006b40   00000040  00000022  0000001e  RWIX
      HRCAP3                00006c80   00000020  00000020  00000000  RWIX
      HRCAP4                00006ca0   00000020  00000020  00000000  RWIX
      GPIOCTRL              00006f80   00000040  00000040  00000000  RWIX
      GPIODAT               00006fc0   00000020  00000020  00000000  RWIX
      GPIOINT               00006fe0   00000020  00000020  00000000  RWIX
      SYSTEM                00007010   00000030  00000030  00000000  RWIX
      SPIA                  00007040   00000010  00000010  00000000  RWIX
      SCIA                  00007050   00000010  00000010  00000000  RWIX
      NMIINTRUPT            00007060   00000010  00000010  00000000  RWIX
      XINTRUPT              00007070   00000010  00000010  00000000  RWIX
      ADC                   00007100   00000080  00000050  00000030  RWIX
      SPIB                  00007740   00000010  00000010  00000000  RWIX
      SCIB                  00007750   00000010  00000010  00000000  RWIX
      I2CA                  00007900   00000040  00000022  0000001e  RWIX
      RAML4                 0000a000   00002000  00000112  00001eee  RWIX
      RAML5                 0000c000   00002000  00000000  00002000  RWIX
      RAML6                 0000e000   00002000  00000000  00002000  RWIX
      RAML7                 00010000   00002000  00000000  00002000  RWIX
      RAML8                 00012000   00002000  00000000  00002000  RWIX
      USB_RAM               00040000   00000800  00000000  00000800  RWIX
      PARTID                003d7e80   00000001  00000001  00000000  RWIX
      CSM_PWL               003f7ff8   00000008  00000008  00000000  RWIX
    

  • Thanks for your response.

    I totally misunderstand the map file.

    would you please let me know how to calculate flash, RAM usage from map file in detail ?

    my memory configuration is as follows.(chipset is F28069F)

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

    MEMORY CONFIGURATION

    name                   origin       length        used    unused  attr fill
    ---------------------- --------      ---------      --------    --------    ---- --------
    PAGE 0:
     RAML0_1       00008000 00002000 00000bfd 00001403 RWIX
     OTP                003d7800 00000400 00000000 00000400 RWIX
     FLASHH         003d8000 00004000 00000000 00004000 RWIX
     FLASHG        003dc000 00004000 00000000 00004000 RWIX
     FLASHF         003e0000 00004000 00000bfd 00003403 RWIX
     FLASHA_B    003e4000 00013f80 00007374 0000cc0c RWIX
     CSM_RSVD   003f7f80 00000076 00000000 00000076 RWIX
     BEGIN            003f7ff6 00000002 00000002 00000000 RWIX
     CSM_PWL_P0 003f7ff8 00000008 00000000 00000008 RWIX
     FPUTABLES   003fd590 000006a0 00000000 000006a0 RWIX
     IQTABLES      003fdc30 00000b50 00000b50 00000000 RWIX
     IQTABLES2    003fe780 0000008c 00000000 0000008c RWIX
     IQTABLES3    003fe80c 000000aa 00000000 000000aa RWIX
     ROM               003ff3b0 00000c10 00000000 00000c10 RWIX
     RESET           003fffc0 00000002 00000000 00000002 RWIX
     VECTORS      003fffc2 0000003e 00000000 0000003e RWIX

    PAGE 1:
     BOOT_RSVD 00000000 00000050 00000000 00000050 RWIX
     RAMM0          00000050 000003b0 000003b0 00000000 RWIX
     RAMM1          00000400 00000400 00000000 00000400 RWIX
     RAML2_3        0000a000 00006000 000036cc 00002934 RWIX
     RAML7           00010000 00002000 00000000 00002000 RWIX
     RAML8           00012000 00001800 00000000 00001800 RWIX
     USB_RAM      00040000 00000800 00000000 00000800 RWIX

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

    Thanks in advance.

  • would you please clarify how to calculate flash, ram usage from map file ?

    My guess is 

    flash =  FLASHA_B + FLASHF + FLASHG + FLASHH

    RAM = RAML0_1 + RAML2_3 + RAML7 + RAML8 + RAMM0 + RAMM1

    Is it correct ?

  • Hae Ryong,

    This is correct for the map file you have given, you want to look at the "Used" section, in this case only FlashA_B and FlashF have any contents, same for only RAM L0_1, L2_3, M0.  Also note these are only the memories that have been defined in your linker; there are 8 sectors of flash and 3 more arrays of SRAM that have not been used on the device.

    You can find the memory map for the devices here:

    http://www.ti.com/product/TMS320F28069/datasheet/memory-maps-sprs6983012#SPRS6983012

    Best,
    Matthew