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.

RTOS/TMS320C6678: IPC concept

Part Number: TMS320C6678

Tool/software: TI-RTOS

Hi

My tools:

CCS: v7

Board: EVM

OS: Win7

I want to communicate between two cores(core0 and core1) such that core 0 write data in an arbitrary memory(it's own L2 SRAM, MSMC or DDR3) and next notify and send data to core1.

so I studied" sprugo6e.pdf " (IPC user guide) and decided to use MessageQ.

I ran " C:\ti\ipc_1_24_03_32\packages\ti\sdo\ipc\examples\multicore " and I have some questions now.

Q 1: 

Is it possible send data from L2SRAM of one core to an other L2SRAM core via MessageQ?

Q 2:

How can I set the memory address of my data in MessageQ?

or Where I should set the memory address of my data in the code?

Best Regards

  • Hi Dariush,

    I've forwarded this to the software experts. Their feedback should be posted here.

    BR
    Tsvetolin Shulev
  • Daruish,

    I think you are using a fairly old version of IPC, please download the latest Processor SDK RTOS for this device and locate the IPC example under

    \ipc_3_44_xx_xx\examples.

    MessageQ typically uses shared memory regions like MSMC and DDR so L2 should not be preferred as you can see from Rob`s response here:

    e2e.ti.com/.../1592214

    You can pass a pointer to a buffer in L2 using global address using MessageQ instead using  L2 memory for MessageQ heap or Shared memory.

    Specifically for messageQ, I would recommend that you look at the setup of the image processing demo that uses the MessageQ protocol to communicate between master core0 and slave cores. That example setups up the Shared memory in MSMC memory for the device using the following configuration:

    var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
    /* Shared Memory base address and length */
    var SHAREDMEM           = 0x0c200000;
    var SHAREDMEMSIZE       = 0x00200000;
    
    SharedRegion.setEntryMeta(0,
        { base: SHAREDMEM, 
          len:  SHAREDMEMSIZE,
          ownerProcId: 0,
          isValid: true,
          name: "MSMCSRAM_IPC",
        });
    
    var HeapBuf   = xdc.useModule('ti.sysbios.heaps.HeapBuf');
    var HeapMem   = xdc.useModule('ti.sysbios.heaps.HeapMem');
    
    /* Create a Heap. */
    var heapMemParams = new HeapMem.Params();
    heapMemParams.size = 0x8000000;
    heapMemParams.sectionName = "systemHeapMaster";
    Program.global.heap0 = HeapMem.create(heapMemParams);
    Memory.defaultHeapInstance = Program.global.heap0;

    For checking providing data pointer using messageQ, refer to the function mc_process_init, this is where the application allocates memory for the messages using the heap and each message is in form of a structure "process_message_t" 

    typedef struct process_message {
        MessageQ_MsgHeader  header;
        int                 core_id;
        processing_info_t   info;
    } process_message_t;
    
    typedef struct processing_info {
        processing_type_e processing_type;
        uint8_t *         rgb_in;
        color_table_t   * p_color_table;
        uint16_t          bitspp;
        uint32_t          width; 
        uint32_t          height;
        uint8_t *         out;
        uint8_t *         scratch_buf[NUMBER_OF_SCRATCH_BUF];
        uint32_t          scratch_buf_len[NUMBER_OF_SCRATCH_BUF];
        int               flag;
    } processing_info_t;

    You can modify the Processing info structure based on your application requirement and use one of the pointers variables to pass the data that you have defined in L2RAM or any memory on the SOC. Note: For L2 you will need to provide global address not the DSP local address.

    Hope this helps.

    Regards,

    Rahul

    PS: useful resources for MessageQ 

    processors.wiki.ti.com/.../MessageQ_Module

    processors.wiki.ti.com/.../IPC_3.x

  • Hi Rahul

    Thank you so much, I investigate " image_proc_IPC " and I have some questions.

    I used MCDSK version 2.1.2.6 and it is the last version in the 2.x.x.x release. I thought MCDSK V2 is used for KEYSTONE I and MCDSK V3 is used for  KEYSTONE II, according to my DSP(C6678 keystone I) I used MCDSK version 2.1.2.6.

    Q 1: 

    Am I I thinking right? Is it possible to use MCDSK V3 for KEYSTONE I?

    In many cases the users want to use the cores as a " Pipeline " model. Core0 received the data and send it to next core and finally the last core send back the final result to Core0 for transmit.

    Q 2:

    Is there any example for Pipeline Model?

    In using IPC we should declare heap and shared region.

    Q 3:

    What is the relation between heap and shared region? What is the difference between heap and shared region in application?

    BR

  • Please,answer me.

  • Hi dariush,

    To send data from L2SRAM of one core to an other L2SRAM core via MessageQ, you need to create a message queue which is allocated from heap, part of share region from DDR or MSMC, then copy your local L2SRM data to the queue and specify the fields defined your message structure which includes MsgHeader, then call MessageQ_put() API. The MessageQ details see processors.wiki.ti.com/.../MessageQ_Module

    If you look into ipc_3_44_00_00/examples/C6678_bios_elf/ex11_ping, you basically need to copy the data in local L2SRAM to the char buf[32] (Messages in a message queue can be of variable length. The only requirement is that the first field in the definition of a message must be a MsgHeader structure) in the structure SvrMsg_Msg in ex11_ping/shared/, then fill the msg like in AppCore0_run in ex11_ping/core0.

    /* fill and send message */
    Module.msg->cmd = SvrMsg_Cmd_START;
    Module.msg->svrProcId = MultiProc_INVALIDID;
    MessageQ_put(Module.svrQue[procId], (MessageQ_Msg)Module.msg);

    Basically part of the SharedRegion is used for IPC handshake and the rest is a Shared memory heap that can be used between the cores, see e2e.ti.com/.../236938.

    More details on healp and shared region: processors.wiki.ti.com/.../HeapMP_Modules, processors.wiki.ti.com/.../SharedRegion_Module.
    L2 is local memory of each core, not shared, so can not be defined as shared region.

    Regards,
    Garrett