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.

MCU-PLUS-SDK-AM263X: Reconciling SysConfig, Linker Script (“linker.cmd”) and FAQ

Part Number: MCU-PLUS-SDK-AM263X
Other Parts Discussed in Thread: SYSCONFIG

This thread is related to thread:

  MCU-PLUS-SDK-AM263X: SDK Example using TCM - edma_multimem_transfer_am263x-cc_r5fss0-0_nortos_ti-arm-clang

and the FAQ:

  [FAQ] MCU-PLUS-SDK-AM263X: How to add code into TCM using linker.cmd file - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

The FAQ state that the way to define memory regions for adding code and data to TCM memory is "To create section in TCM edit the linker.cmd".

However, when I import an SDK example it seems like the Build (make) is what creates "linker.cmd".

Also, I see in SysConfig Memory Configurator memory regions as seen here:

These seem to corelate to the memory regions in "linker.cmd" seen here:

MEMORY
{
    R5F_VECS   : ORIGIN = 0x0 , LENGTH = 0x40 
    R5F_TCMA   : ORIGIN = 0x40 , LENGTH = 0x7FC0 
    R5F_TCMB   : ORIGIN = 0x80000 , LENGTH = 0x8000 
    SBL   : ORIGIN = 0x70000000 , LENGTH = 0x40000 
    OCRAM   : ORIGIN = 0x70040000 , LENGTH = 0x40000 
    USER_SHM_MEM   : ORIGIN = 0x701D0000 , LENGTH = 0x4000 
    LOG_SHM_MEM   : ORIGIN = 0x701D4000 , LENGTH = 0x4000 
    FLASH   : ORIGIN = 0x60100000 , LENGTH = 0x80000 
    RTOS_NORTOS_IPC_SHM_MEM   : ORIGIN = 0x72000000 , LENGTH = 0x3E80 
    MAILBOX_HSM   : ORIGIN = 0x44000000 , LENGTH = 0x3CE 
    MAILBOX_R5F   : ORIGIN = 0x44000400 , LENGTH = 0x3CE 

    /* For memory Regions not defined in this core but shared by other cores with the current core */


}

Is the FAQ still current, of should the TCM section be added through the SysConfig Memory Configurator?

  • Hi,

    The TCM Section should now be added through through the SysConfig Memory Configurator,
    to do so:

    Let's use a basic example where - We want to put a variable called 'counter' in TCM.

    1. Open example.syscfg -> Go to Memory Configurator -> Section


    2. Add a new section and select Load Memory and Run Memory as TCMA


    3. Add an Output Section in TCM Variables


    4. Now let's define the variable in our created .tcmVarSection
       
      uint32_t counter  __attribute__ ((__section__(".tcmVarSection")));


    5. Rest of the code
      void main(void *args)
      {
          /* Open drivers to open the UART driver for console */
          Drivers_open();
          Board_driversOpen();
      
          counter = 0;
      
          while(1)
          {   
      
              DebugP_log("counter: %u \r\n", counter);
              ClockP_sleep(1); /* Some delay added to compensate for TCM's fast memory access */
              counter++;
              if(counter == 10)
                  break;
          }
      
          DebugP_log("All tests have passed!!\r\n");
      
          Board_driversClose();
          Drivers_close();
      }


    6. Our section is added in the linker


    7. Map File
      MEMORY CONFIGURATION
      
               name            origin    length      used     unused   attr    fill
      ----------------------  --------  ---------  --------  --------  ----  --------
        R5F_VECS              00000000   00000040  00000040  00000000  RWIX
        R5F_TCMA              00000040   00007fc0  00000008  00007fb8  RWIX
        R5F_TCMB              00080000   00008000  00000000  00008000  RWIX
        MAILBOX_HSM           44000000   000003ce  00000000  000003ce  RWIX
        MAILBOX_R5F           44000400   000003ce  00000000  000003ce  RWIX
        FLASH                 60100000   00080000  00000000  00080000  RWIX
        SBL                   70000000   00040000  00000000  00040000  RWIX
        OCRAM                 70040000   00040000  00016068  00029f98  RWIX
        USER_SHM_MEM          701d0000   00004000  00000000  00004000  RWIX
        LOG_SHM_MEM           701d4000   00004000  00000000  00004000  RWIX
        RTOS_NORTOS_IPC_SHM_M 72000000   00003e80  00000000  00003e80  RWIX
      
      
      SEGMENT ALLOCATION MAP
      
      run origin  load origin   length   init length attrs members
      ----------  ----------- ---------- ----------- ----- -------
      00000000    00000000    00000040   00000040    r-x
        00000000    00000000    00000040   00000040    r-x .vectors
      00000040    00000040    00000008   00000000    rw-
        00000040    00000040    00000008   00000000    rw- .tcmVarSection

    To put other sections in TCM

    • In example.syscfg -> Go to Memory Configurator -> Section -> Select Multiple Memory Regions


    • Select the memory regions


    • Build
      • Linker


    Regards,
    Akshit