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.

LAUNCHXL-F28379D: How to get a suitable TI device with a good RAM size (PAGE = 0) and a high-speed CPU? and what is the difference between RAM and flash memory in terms of the model speed?

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Hi guys,
I am using LAUNCH-F28379D via Matlab Simulink with External mode.
After I have added my code inside the "MATLAB function" block, I got a RAM problem (I can't run my code on the RAM (without choosing "boot from flash") but I still can run the code using "Boot from flash"  where the RAM size is very small compared to flash memory.
My questions are
Question 1: is there a difference between running the code on RAM or flash memory in terms of the speed of the whole model?

Question 2: Actually, my model running with 600 microseconds (duty cycle for the model) using "Boot from flash" but I need to run it with around 200-400 microseconds. Is there a way to do that?

Question 3: Am I able to extend RAM size to work with flash memory (for example adding FLASHA_N to RAM, (PAGE = 0 #ifdef CPU1 .text : >>RAMM0 | RAMD0 | RAMLS_PROG | RAMGS_PROG | FLASHA_N ))?

Question 4: If I changed the TI device (from LAUNCH-F28379D) to another device. Is this will solve the problem? any suggestion for a good device with big RAM memory (PAGE = 0) and a high-speed CPU (to read the code fast)?

Any help is appreciated

Thank you in advance

  • Ashraf,

    The Flash runs at 3 WaitStatesat 200MHz, so it is slower in principle than the SRAM(0WS at 200MHz).  However, for linear code there is a prefetch buffer that typically nets 80-90% of the RAM performance, so it is not as big of a hit as the raw numbers indicate.

    The boot from option shouldn't really impact the timings you are seeing, this is just telling the device which source(flash/SPI/SCI/EMIF, etc) it should start with to boot.  For already defined code, boot to flash is the correct setting.  In the case where you are connected to a debugger(like CCS or MW) you can load code directly to the SRAM and run from there without booting.

    The critical item as you have mentioned is where the program code resides, can you comment on how much over in size your program is from the linker output?  This device is one of the largest in terms of memory footprint we offer, with 256KW of flash and 128KW of RAM per core.  The F28379S(Single core variant) does give the full 512KW and 256KW to one core, at the expense of not being dual core MIPs.

    You can certainly assign some or all of the program to flash, but you would need to define another section so that it can be programmed and linked separately.

    In terms of the absolute speed of the code, I would make sure that you have enabled the PLL and are clocking the device at its full 200MHz speed.  Much like the RAM comment, this device has our highest CPU clock frequency of 200MHz with embedded flash.  

    Keep in mind that there is a full 2nd core on this device, with the same amount of SRAM and Flash as the main core.  You could consider splitting the code between the 2 cores for both size a speed reasons.

    Best,

    Matthew

  • Hi Dear MatthewPate
    Thank you very much for this nice explanation
    Based on what have you said, I think I should be able to run my program on the RAM.
    When I run my program on the "Flash", the flash size used is (("7cec" hex = 31980 bit) of 3fffe), while when I run my program on the "RAM", I am getting a memory error with the required memory as ("placement with alignment/blocking fails for section ".text" size 0x71c6 page 0. " &"placement with alignment/blocking fails for section ".cinit" size 0x395 page 0."). Based on my calculation, the RAM size on CPU1 is 27358 bit (RAMM0+RAMLs_Prog+RAMD0+RAMGS_Prog)(=2de+9000+b000+14000)). So, I still need around 4622 bit (=31980-27358). I think 4622 bit is not so much.

    **Yes, I have enabled the PLL with 200MHz (system PLL multiplier=40, CPU=200MHz, OSCCLK=10MHz)

    Below is the memory description from the ".map" file when I use "Flash" and "RAM".

    Using Flash:

    MEMORY CONFIGURATION

    name                      origin         length            used          unused       attr           fill
    ----------------------     --------          ---------        --------          --------         ----        --------
    PAGE 0:
    BEGIN                 00000000    00000002    00000000    00000002    RWIX
    RAMM0               00000122    000002de    00000000    000002de    RWIX
    RAMLS_PROG   00009000    00002000    000000d7    00001f29     RWIX
    RAMD0                0000b000    00000800   00000000    00000800    RWIX
    RAMGS_PROG   00017000    00001000   00000000    00001000    RWIX
    BEGIN_FLASH    00080000    00000002   00000002    00000000    RWIX
    FLASHA_N          00080002    0003fffe       00007cec    00038312    RWIX
    RESET                003fffc0       00000002     00000000    00000002    RWIX

     

    Using RAM (with error comment):

    MEMORY CONFIGURATION

    name                       origin           length            used          unused       attr        fill
    ----------------------     --------           ---------          --------           --------        ----      --------
    PAGE 0:
    BEGIN                  00000000     00000002    00000002   00000000    RWIX
    RAMM0                00000122     000002de    000002de   00000000    RWIX
    RAMLS_PROG    00009000     00002000    00001fff      00000001    RWIX
    RAMD0                0000b000     00000800    00000800   00000000    RWIX
    RAMGS_PROG   00014000     00004000    00003ffb     00000005    RWIX
    BEGIN_FLASH    00080000     00000002    00000000   00000002    RWIX
    FLASHA_N          00080002     0003fffe       00000000    0003fffe      RWIX
    RESET                 003fffc0        00000002    00000000    00000002    RWIX

     

  • Actually, my program is simple. I use
    A) 7 ADC pins.
    B) 2 SPI (API_A with 4 GPIO && SPI_C).
    C) My code (the algorithm) (using the MATLAB Function Block).


    Based on your comment below,
    "Keep in mind that there is a full 2nd core on this device, with the same amount of SRAM and Flash as the main core. You could consider splitting the code between the 2 cores for both size a speed reasons."

    A) Could you please tell me how I can do that?
    B) Can I run "SPI" on CPU2 while the rest on CPU1 using one MATLAB model? If yes, how can I do it?
    C) How can I link both RAMs from CPU1&CPU2 together?. In the ".cmd" file, I know how to link the RAM parts and Flash MEMORY together (But they are all on the same CPU) (for example adding FLASHA_N to RAM in .cmd file, (PAGE = 0 #ifdef CPU1 .text : >>RAMM0 | RAMD0 | RAMLS_PROG | RAMGS_PROG | FLASHA_N )).
    D) How can I use RAM from another CPU? The ".cmd" file is attached.

    #ifdef CLA_BLOCK_INCLUDED
    // Define a size for the CLA scratchpad area that will be used
    // by the CLA compiler for local symbols and temps
    // Also force references to the special symbols that mark the
    // scratchpad are. 
    CLA_SCRATCHPAD_SIZE = 0x100;
    --undef_sym=__cla_scratchpad_end
    --undef_sym=__cla_scratchpad_start
    #endif //CLA_BLOCK_INCLUDED
    MEMORY
    {
    PAGE 0 :
       /* BEGIN is used for the "boot to SARAM" bootloader mode   */
       BEGIN           	: origin = 0x000000, length = 0x000002
       BEGIN_FLASH     	: origin = 0x080000, length = 0x000002
       #ifdef CPU1
           RAMM0           	: origin = 0x000122, length = 0x0002DE
       #else
           RAMM0           	: origin = 0x000080, length = 0x000380
       #endif
       RAMD0           	: origin = 0x00B000, length = 0x000800
       #ifdef CLA_BLOCK_INCLUDED
            RAMLS_PROG      	: origin = 0x00A000, length = 0x000800
            RAMLS_CLA_PROG      : origin = 0x00A800, length = 0x000800
       #else
            RAMLS_PROG      	: origin = 0x009000, length = 0x002000
       #endif //CLA_BLOCK_INCLUDED
       #ifdef CPU1       
           #if BOOT_FROM_FLASH
                RAMGS_PROG       : origin = 0x017000, length = 0x001000
           #else
                RAMGS_PROG       : origin = 0x014000, length = 0x004000
           #endif
       #endif
    
       RESET           	: origin = 0x3FFFC0, length = 0x000002
       /* Flash sectors */
       FLASHA_N           : origin = 0x080002, length = 0x03FFFE	/* on-chip Flash */ 
    
    PAGE 1 :
       #ifdef CPU1
           BOOT_RSVD       : origin = 0x000002, length = 0x000120     /* Part of M0, BOOT rom will use this for stack */
       #else
           BOOT_RSVD       : origin = 0x000002, length = 0x00007E     /* Part of M0, BOOT rom will use this for stack */
       #endif
       RAMM1           : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
       RAMD1           : origin = 0x00B800, length = 0x000800
       #ifdef CLA_BLOCK_INCLUDED
            RAMLS_CLA_DATA      : origin = 0x008000, length = 0x001000
            RAMLS_DATA          : origin = 0x009000, length = 0x001000
       #else
            RAMLS_DATA          : origin = 0x008000, length = 0x001000
       #endif //CLA_BLOCK_INCLUDED
       #ifdef CPU1       
           #if BOOT_FROM_FLASH
                RAMGS_DATA       : origin = 0x00C000, length = 0x00B000
           #else
                RAMGS_DATA       : origin = 0x00C000, length = 0x008000
           #endif
       #endif
       CLA1_MSGRAMLOW   : origin = 0x001480, length = 0x000080
       CLA1_MSGRAMHIGH  : origin = 0x001500, length = 0x000080
    
       CPU2TOCPU1RAM   : origin = 0x03F800, length = 0x000400
       CPU1TOCPU2RAM   : origin = 0x03FC00, length = 0x000400
    }
    
    
    SECTIONS
    {
    #if BOOT_FROM_FLASH
       /* Allocate program areas: */
       .cinit              : > FLASHA_N      PAGE = 0, ALIGN(4)
       .pinit              : > FLASHA_N,     PAGE = 0, ALIGN(4)
       .text               : > FLASHA_N      PAGE = 0, ALIGN(4)
       codestart           : > BEGIN_FLASH       PAGE = 0, ALIGN(4)
       ramfuncs            : LOAD = FLASHA_N,
                             RUN = RAMLS_PROG,
                             LOAD_START(_RamfuncsLoadStart),
                             LOAD_SIZE(_RamfuncsLoadSize),
                             LOAD_END(_RamfuncsLoadEnd),
                             RUN_START(_RamfuncsRunStart),
                             RUN_SIZE(_RamfuncsRunSize),
                             RUN_END(_RamfuncsRunEnd),
                             PAGE = 0, ALIGN(4)
       /* Initalized sections go in Flash */
       .econst             : > FLASHA_N      PAGE = 0, ALIGN(4)
       .switch             : > FLASHA_N      PAGE = 0, ALIGN(4)
       /* Allocate IQmath areas: */
       IQmath			: > FLASHA_N, PAGE = 0, ALIGN(4)            /* Math Code */
       IQmathTables		: > FLASHA_N, PAGE = 0, ALIGN(4)
       
       #ifdef CLA_BLOCK_INCLUDED
           /* CLA specific sections */
           Cla1Prog         : LOAD = FLASHA_N,
                              RUN = RAMLS_CLA_PROG,
                              LOAD_START(_Cla1funcsLoadStart),
                              LOAD_END(_Cla1funcsLoadEnd),
                              RUN_START(_Cla1funcsRunStart),
                              LOAD_SIZE(_Cla1funcsLoadSize),
                              PAGE = 0, ALIGN(4)
       #endif //CLA_BLOCK_INCLUDED
    #else
       codestart        : > BEGIN,     PAGE = 0
       ramfuncs         : > RAMM0      PAGE = 0
       #ifdef CPU1
           .text            : >>RAMM0 | RAMD0 | RAMLS_PROG | RAMGS_PROG,   PAGE = 0
       #else
           .text            : >>RAMM0 | RAMD0 | RAMLS_PROG,   PAGE = 0
       #endif
       .cinit           : > RAMM0 | RAMD0 | RAMLS_PROG,   PAGE = 0
       .pinit           : > RAMM0,     PAGE = 0
       .switch          : > RAMM0,     PAGE = 0
       .econst          : > RAMLS_DATA,    PAGE = 1
       /* Allocate IQ math areas: */
       IQmath			: > RAMLS_PROG,     PAGE = 0            /* Math Code */
       IQmathTables		: > RAMLS_PROG, PAGE = 0
    
       #ifdef CLA_BLOCK_INCLUDED
           /* CLA specific sections */
           Cla1Prog         : > RAMLS_CLA_PROG, PAGE=0
       #endif //CLA_BLOCK_INCLUDED
    #endif
       .stack           : > RAMM1,     PAGE = 1
       #ifdef CPU1
           .ebss            : >> RAMLS_DATA| RAMD1 | RAMGS_DATA ,    PAGE = 1
       #else
           .ebss            : >> RAMLS_DATA| RAMD1,    PAGE = 1
       #endif
       .reset           : > RESET,     PAGE = 0, TYPE = DSECT /* not used, */
       .esysmem         : > RAMLS_DATA,    PAGE = 1
       
       #ifdef CLA_BLOCK_INCLUDED
           /* CLA C compiler sections */
           //
           // Must be allocated to memory the CLA has write access to
           //
           Cla1DataRam0		: > RAMLS_CLA_DATA, PAGE=1
    
           Cla1ToCpuMsgRAM  : > CLA1_MSGRAMLOW,   PAGE = 1
           CpuToCla1MsgRAM  : > CLA1_MSGRAMHIGH,  PAGE = 1
           CLAscratch       :
                             { *.obj(CLAscratch)
                             . += CLA_SCRATCHPAD_SIZE;
                             *.obj(CLAscratch_end) } >  RAMLS_CLA_DATA,  PAGE = 1
    
           .scratchpad      : > RAMLS_CLA_DATA,       PAGE = 1
           .bss_cla		    : > RAMLS_CLA_DATA,       PAGE = 1
           .const_cla	    :  LOAD = FLASHA_N,
                               RUN = RAMLS_CLA_DATA,
                               RUN_START(_Cla1ConstRunStart),
                               LOAD_START(_Cla1ConstLoadStart),
                               LOAD_SIZE(_Cla1ConstLoadSize),
                               PAGE = 1
       #endif //CLA_BLOCK_INCLUDED
       #ifdef CPU1  
           /* The following section definitions are required when using the IPC API Drivers */ 
            GROUP : > CPU1TOCPU2RAM, PAGE = 1 
            {
                PUTBUFFER 
                PUTWRITEIDX 
                GETREADIDX 
            }
            GROUP : > CPU2TOCPU1RAM, PAGE = 1
            {
                GETBUFFER :    TYPE = DSECT
                GETWRITEIDX :  TYPE = DSECT
                PUTREADIDX :   TYPE = DSECT
            }
       #else
           /* The following section definitions are required when using the IPC API Drivers */ 
            GROUP : > CPU2TOCPU1RAM, PAGE = 1 
            {
                PUTBUFFER 
                PUTWRITEIDX 
                GETREADIDX 
            }
            GROUP : > CPU1TOCPU2RAM, PAGE = 1
            {
                GETBUFFER :    TYPE = DSECT
                GETWRITEIDX :  TYPE = DSECT
                PUTREADIDX :   TYPE = DSECT
            }
       #endif 
    }
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    

  • Asraf,

    I'm inline a portion of one of our linker command files in C2000Ware below to show the RAMs and their sizes.  From the MW output it looks like they have lumped several of these together in the LS and GS PROGs.  However, the GS RAM has much more addressable space than what is listed.  Enough that I think you should be able to fit your whole program in that space if you modify the MW example to reflect this.

    Take a look a the below and see if you can modify the example to get you the extra memory you need for you program to fit.  

    If we need to use CPU2 for either memory or bandwidth reasons, you would create a separate project (at least in Code Composer) that is built and loaded directly to CPU2.  I assume the MW implementation is similar, i.e. you would have a different block and that there is somewhere to specify the target as CPU2 vs CPU1.

    MEMORY
    {
    PAGE 0 :
       /* BEGIN is used for the "boot to SARAM" bootloader mode   */
    
       BEGIN            : origin = 0x000000, length = 0x000002
       RAMM0            : origin = 0x000123, length = 0x0002DD
       RAMD0            : origin = 0x00B000, length = 0x000800
       RAMLS0           : origin = 0x008000, length = 0x000800
       RAMLS1           : origin = 0x008800, length = 0x000800
       RAMLS2           : origin = 0x009000, length = 0x000800
       RAMLS3           : origin = 0x009800, length = 0x000800
       RAMLS4           : origin = 0x00A000, length = 0x000800
       RESET            : origin = 0x3FFFC0, length = 0x000002
    
    PAGE 1 :
    
       BOOT_RSVD       : origin = 0x000002, length = 0x000121     /* Part of M0, BOOT rom will use this for stack */
       RAMM1           : origin = 0x000400, length = 0x0003F8     /* on-chip RAM block M1 */
    //   RAMM1_RSVD      : origin = 0x0007F8, length = 0x000008     /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
       RAMD1           : origin = 0x00B800, length = 0x000800
    
       RAMLS5      : origin = 0x00A800, length = 0x000800
    
       RAMGS0      : origin = 0x00C000, length = 0x001000
       RAMGS1      : origin = 0x00D000, length = 0x001000
       RAMGS2      : origin = 0x00E000, length = 0x001000
       RAMGS3      : origin = 0x00F000, length = 0x001000
       RAMGS4      : origin = 0x010000, length = 0x001000
       RAMGS5      : origin = 0x011000, length = 0x001000
       RAMGS6      : origin = 0x012000, length = 0x001000
       RAMGS7      : origin = 0x013000, length = 0x001000
       RAMGS8      : origin = 0x014000, length = 0x001000
       RAMGS9      : origin = 0x015000, length = 0x001000
       RAMGS10     : origin = 0x016000, length = 0x001000
    
    //   RAMGS11     : origin = 0x017000, length = 0x000FF8   /* Uncomment for F28374D, F28376D devices */
    
    //   RAMGS11_RSVD : origin = 0x017FF8, length = 0x000008    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
       RAMGS11     : origin = 0x017000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       RAMGS12     : origin = 0x018000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       RAMGS13     : origin = 0x019000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       RAMGS14     : origin = 0x01A000, length = 0x001000     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       RAMGS15     : origin = 0x01B000, length = 0x000FF8     /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
       
    //   RAMGS15_RSVD : origin = 0x01BFF8, length = 0x000008    /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
                                                                /* Only on F28379D, F28377D, F28375D devices. Remove line on other devices. */
    
       CPU2TOCPU1RAM   : origin = 0x03F800, length = 0x000400
       CPU1TOCPU2RAM   : origin = 0x03FC00, length = 0x000400
    
       CANA_MSG_RAM     : origin = 0x049000, length = 0x000800
       CANB_MSG_RAM     : origin = 0x04B000, length = 0x000800
    }

    Best,
    Matthew