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.

Cannot perform the Ipc_start() successfully when I debug the project

Other Parts Discussed in Thread: SYSBIOS




Hi,

When I debug the project ,I make a breakpoint at the statement  which  follows the Ipc_start(), that means  that I cannot get the return value of the Ipc_star(),

In my c file ,I cannot get the value of status.

what are the possible reasons causing the problems, how can I slove the problem?

thank  you

----------------------------------------------------------------------------------------------------------------------------------------------

Int main(Int argc, Char* argv[]) { Int status; /* * Ipc_start() ca+]lls Ipc_attach() to synchronize all remote processors * because 'Ipc.procSync' is set to 'Ipc.ProcSync_ALL' in *.cfg */ #if 1 status = Ipc_start(); printf("%d\n",status); if (status < 0) { System_abort("Ipc_start failed\n"); } #endif BIOS_start(); return (0); } /* * @(#) ti.sdo.ipc.examples.multicore.evm667x; 1, 0, 0, 0,1; 5-22-2012 16:36:06; /db/vtree/library/trees/ipc/ipc-h32/src/ xlibrary */

  • Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com).

    We will get back to you on the above query shortly. Thank you for your patience.

  • Do you this behavior with example project provided by TI or own project? We recommend you to test the TI provided MCSDK examples to start with. Thank you.
  • Able to get expected results if you didn't set breakpoint ?

    What is the value of "status" variable ?

    What example are you using ?

    You would get one of the following MACRO values.

    /*
    * @return Status
    * - #Ipc_S_SUCCESS: operation was successful ( 0 )
    * - #Ipc_S_ALREADYSETUP: already successfully called ( 1 )
    * - #Ipc_E_NOTREADY: shared memory is not ready ( -11 )
    * - #Ipc_E_FAIL: operation failed ( -1 )
    */
  • if I don't set the breakpoint ,I also cannot get the value ,the project is built by me . I want to konw  what possible reasons causing the problem,

  • Hi hui,

    Please give the following details so that we will try to reproduce it from our end and help you out to set break point at the functions appropriately.

    1. Version details of IPC package and the name of the example program of IPC.

    2. On which TI EVM, you experiment this?

    Regards,

    Shankari

  • Hi ShanKari

    when I test the example ,the Ipc_start() function is good, the following is my c file and cfg file,

    can you give me a help?

    thank you

     

     

     

     

    /*
     * Copyright (c) 2012, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     * */
    /*
     *  ======== message_multicore.c ========
     *  Multiprocessor MessageQ example
     *
     *  This is an example program that uses MessageQ to pass a message
     *  from one processor to another.
     *
     *  Each processor creates its own MessageQ first and then will try to open
     *  a remote processor's MessageQ. 
     *
     *  See message_multicore.k file for expected output.
     */

    #include <xdc/std.h>
    #include <string.h>

    /*  -----------------------------------XDC.RUNTIME module Headers    */
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/IHeap.h>

    /*  ----------------------------------- IPC module Headers           */
    #include <ti/ipc/Ipc.h>
    #include <ti/ipc/MessageQ.h>
    #include <ti/ipc/HeapBufMP.h>
    #include <ti/ipc/MultiProc.h>

    /*  ----------------------------------- BIOS6 module Headers         */
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>

    /*  ----------------------------------- To get globals from .cfg Header */
    #include <xdc/cfg/global.h>

    #include <xdc/runtime/Timestamp.h>
    #include <ti/sysbios/knl/Clock.h>
    #include <stdio.h>
    #include <string.h>

    #include "openHevcWrapper.h"
    #include "getopt.h"
    #include "videoDecodeTsk.h"
    #include "../common_lib/libavformat/avformat.h"
    #include "../common_lib/libavcodec/hevc.h"

    #define HEAP_NAME   "myHeapBuf"
    #define HEAPID      0
    #define NUMLOOPS    10

    #if 1
    /* Decoder input */
    uint8_t  InputBuf[1048576];   // 1M
    #pragma DATA_SECTION(InputBuf, ".data_input");
    int32_t InputBuf_Offset = 0;

    uint8_t  OutputBuf[268435456];  //256M
    #pragma DATA_SECTION(OutputBuf, ".data_output");
    int32_t OutputBuf_Offset = 0;

    //#define vps_len sizeof(HEVCVPS)
    #if 0
    AVBufferRef *vps_list[MAX_VPS_COUNT]= {NULL};
    #pragma DATA_SECTION(vps_list, ".shared_vps_mem");
    AVBufferRef *sps_list[MAX_SPS_COUNT] = {NULL};
    #pragma DATA_SECTION(sps_list, ".share_sps_mem");
    AVBufferRef *pps_list[MAX_PPS_COUNT] = {NULL};
    #pragma DATA_SECTION(pps_list, ".shared_pps_mem");
    AVBufferRef *sh_list[MAX_SH_COUNT] = {NULL};
    #pragma DATA_SECTION(sh_list, ".shared_sliceheader_mem");
    #else
    uint8_t vps_buf[MAX_VPS_COUNT][vps_len];
    #pragma DATA_SECTION(vps_buf, ".shared_vps_mem");
    uint8_t sps_buf[MAX_SPS_COUNT][sps_len];
    //AVBufferRef *sps_list[MAX_SPS_COUNT]= {NULL};
    #pragma DATA_SECTION(sps_buf, ".shared_sps_mem");
    uint8_t pps_buf[MAX_PPS_COUNT][pps_len];
    //AVBufferRef *pps_list[MAX_PPS_COUNT] = {NULL};
    #pragma DATA_SECTION(pps_buf, ".shared_pps_mem");
    uint8_t sh_buf[MAX_SH_COUNT][sh_len];
    //AVBufferRef *sh_list[MAX_SH_COUNT] = {NULL};
    #pragma DATA_SECTION(sh_buf, ".shared_sliceheader_mem");
    #endif


    GlobleContext gb_buf[MAX_GB_COUNT] = {NULL};
    #pragma DATA_SECTION(gb_buf, ".shared_gb_mem");
    uint8_t HevcCtx[MAX_WRAPCTXS_COUNT][HevcCtx_len];
    #pragma DATA_SECTION(HevcCtx, ".shared_parser_mem");

    uint8_t CodecCntx[MAX_WRAPCTXS_COUNT][CodecCtx_len];
    #pragma DATA_SECTION(CodecCntx, ".shared_decode_mem");
    uint8_t FrameCntx[MAX_WRAPCTXS_COUNT][Pic_len];
    #pragma DATA_SECTION(FrameCntx, ".shared_filter_mem");

    extern int g_sh_id;
    extern int g_sh_id_used;

    int g_core_id;
    /*
    AVBufferRef  *openHevcParserCtx_buf[2] = {NULL};
    #pragma DATA_SECTION(openHevcParserCtx_buf, ".shared_parser_mem");
    AVBufferRef  *openHevcDecodeCtx_buf[2] = {NULL};
    #pragma DATA_SECTION(openHevcDecodeCtx_buf, ".shared_decode_mem");
    AVBufferRef  *openHevcFilterCtx_buf[2] = {NULL};
    #pragma DATA_SECTION(openHevcFilterCtx_buf, ".shared_filter_mem");
    */
    #endif


    #define MessageQ_setSrcProc(msg, id) ((MessageQ_Msg) (msg))->srcProc = (id)
    #define MessageQ_getSrcProc(msg) (((MessageQ_Msg) (msg))->srcProc)
    #define GET_SLAVE_QUEUE_NAME(str, core_id) sprintf(str,"%s", MultiProc_getName(core_id))
    #define MASTER_QUEUE_NAME "master_queue"

    Char localQueueName[10];
    Char nextQueueName[10];
    UInt16 nextProcId;

    typedef enum
    {
        CORE0 = 0,
        CORE1 = 1,
        CORE2 = 2,
        CORE3 = 3,
        CORE4 = 4,
        CORE5 = 5,
        CORE6 = 6,
        CORE7 = 7
    }CORE_NUM;

    Char localQueueName[10];
    Char masterQueueName[10];
    static char slave_queue_name[8][16];

    int IPC_process_init (int number_of_cores)
    {
        int i;
       
        memset(slave_queue_name, 0, number_of_cores*16);
        for (i = 1; i < number_of_cores; i++) {
            GET_SLAVE_QUEUE_NAME(slave_queue_name[i], i);
        }
        return 0;
    }

    /*
     *  ======== tsk0_func ========
     *  Allocates a message and ping-pongs the message around the processors.
     *  A local message queue is created and a remote message queue is opened.
     *  Messages are sent to the remote message queue and retrieved from the
     *  local MessageQ.
     */
    Void tsk0_func(UArg arg0, UArg arg1)
    {
    #if 1
         MessageQ_Msg     msg[8];   
        MessageQ_Handle  messageQ;
        MessageQ_QueueId queue_id[8];
        int number_of_cores = 0;

        Int              status;
        UInt16           msgId = 0;
        HeapBufMP_Handle              heapHandle;
        HeapBufMP_Params              heapBufParams;
       
        xdc_runtime_Types_FreqHz freq;
        long time_stamp1,time_stamp2;
        double processing_time;
        char filename[100];

       // OpenHevc_Handle openHevcHandle = NULL;
        AVFormatContext *pFormatCtx = NULL;
        int frame_num = 0;
        int i;
        AVCodec *codec;

        g_core_id = MultiProc_self();
       number_of_cores = MultiProc_getNumProcessors();

        //System_sprintf(masterQueueName, "%s",  MultiProc_getName(CORE0));
       // System_sprintf(localQueueName, "%s", MultiProc_getName(MultiProc_self()));
        if (MultiProc_self() == 0) {
            /*
             *  Create the heap that will be used to allocate messages.
             */    
            HeapBufMP_Params_init(&heapBufParams);
            heapBufParams.regionId       = 0;
            heapBufParams.name           = HEAP_NAME;
            heapBufParams.numBlocks      = 8;
            heapBufParams.blockSize      = sizeof(MessageQ_MsgHeader);
            heapHandle = HeapBufMP_create(&heapBufParams);
            if (heapHandle == NULL) {
                System_abort("HeapBufMP_create failed\n" );
            }
        }
        else {
            /* Open the heap created by the other processor. Loop until opened. */
            do {
                status = HeapBufMP_open(HEAP_NAME, &heapHandle);
                /*
                 *  Sleep for 1 clock tick to avoid inundating remote processor
                 *  with interrupts if open failed
                 */
                if (status < 0) {
                    Task_sleep(1);
                }
            } while (status < 0);
        }
       
        /* Register this heap with MessageQ */
        MessageQ_registerHeap((IHeap_Handle)heapHandle, HEAPID);

        IPC_process_init (number_of_cores);
        messageQ = MessageQ_create(localQueueName, NULL);
        if (messageQ == NULL) {
        printf("MessageQ_create failed\n" );
        }

        if(MultiProc_self() == CORE0)
        {
            for (i = 1; i < number_of_cores; i++) {
                do {
                    status = MessageQ_open(slave_queue_name[i], &queue_id[i]);
                } while (status < 0);
            }
        }
        else
        {
            do {
                status = MessageQ_open(MASTER_QUEUE_NAME, &queue_id[CORE0]);
                if (status < 0) {
                    Task_sleep(1);
                }
            } while (status < 0);
        }
        if (MultiProc_self() == CORE0) {
            int first_flag = 1;
            int frame_nb;
            int core_name = CORE1;
            System_printf("Start the main loop\n");
            while (TRUE)
            {
                if(first_flag)
                {
                    first_flag = 0;
                    msg[0] = MessageQ_alloc(HEAPID, sizeof(MessageQ_MsgHeader)); //
                    if (msg[0] == NULL) {
                       System_abort("MessageQ_alloc failed\n" );
                    }
                    MessageQ_setMsgId(msg[0], 0);  //frame_num
                    //MessageQ_setFrameNum(msg[CORE1-1], 0);
                   
                   System_printf("Sending a message #%d to %s\n", 0, slave_queue_name[CORE1]);
                   
                    status = MessageQ_put(queue_id[CORE1], msg[CORE1-1]);
                    if (status < 0) {
                       System_printf("MessageQ_put had a failure/error\n");       
                    }
                }

                for(i=0; i<3; i++)
                {
                    status = MessageQ_get(messageQ, &msg[i], 1000000);
                    if (status >= 0)
                    {
                        frame_nb = MessageQ_getMsgId(msg[i]);  //frame_num
                        core_name = MessageQ_getSrcProc(msg[i]);
                        printf("-------get %d from core%d\n", frame_nb, core_name);
                        MessageQ_free(msg[i]);
                        continue;
                    }
                }
                //printf("----------core_name = %d\n", core_name);
                switch(core_name)
                {
                    case CORE1:
                        msg[1] = MessageQ_alloc(HEAPID, sizeof(MessageQ_MsgHeader)); //
                        if (msg[1] == NULL) {
                        System_abort("MessageQ_alloc failed\n" );
                        }

                        MessageQ_setMsgId(msg[1], frame_nb);  //frame_num
                        MessageQ_setSrcProc(msg[1], CORE0);
                        printf("Sending a message #%d to %s\n", 0, slave_queue_name[CORE2]);
                       
                        status = MessageQ_put(queue_id[CORE2], msg[CORE2-1]);
                        if (status < 0) {
                           System_printf("MessageQ_put had a failure/error\n");       
                        }
                        break;
                    case CORE2:
                        msg[2] = MessageQ_alloc(HEAPID, sizeof(MessageQ_MsgHeader)); //
                        if (msg[2] == NULL) {
                           System_abort("MessageQ_alloc failed\n" );
                        }
                        MessageQ_setMsgId(msg[2], frame_nb);  //frame_num
                       // MessageQ_setSrcProc(msg[CORE3-1], CORE0);
                        printf("Sending a message #%d to %s\n", frame_nb, slave_queue_name[CORE3]);
                       
                        status = MessageQ_put(queue_id[CORE3], msg[2]);
                        if (status < 0) {
                           System_printf("MessageQ_put had a failure/error\n");       
                        }
                        break;
                    case CORE3:
                        printf("-------save done\n");
                        break;
                    default:
                        break;
                }
                //get_message_flag = 0;
                core_name = 0;
            }
        }
        else if (MultiProc_self() == CORE1) {
            int core_name = 0;
            int stop_read = 0;
            int receive_data;
            int frame_nb;
            System_printf("Start the main loop\n");
            init_main(filename);

            printf("filename = %s\n", filename);

            pFormatCtx = avformat_alloc_context();
            video_decode_init(filename, pFormatCtx);

            while (TRUE)
            {
                status = MessageQ_get(messageQ, &msg[0], MessageQ_FOREVER);//1000000
                if (status >= 0) {
                    //core_name = CORE0;
                    frame_nb = MessageQ_getMsgId(msg[0]);
                    MessageQ_free(msg[0]);
                    printf("-------get %d from %s\n", frame_nb, masterQueueName);
                }
                if(frame_nb == 0)
                {
                    while(!stop_read)
                        hevc_decode_parser(pFormatCtx, &frame_num, &stop_read);

                    msg[0] = MessageQ_alloc(HEAPID, sizeof(MessageQ_MsgHeader)); //
                    if (msg[0] == NULL) {
                    System_abort("MessageQ_alloc failed\n" );
                    }
                   
                    MessageQ_setMsgId(msg[0], frame_num);  //frame_num
                    MessageQ_setSrcProc(msg[0], CORE1);
                    printf("Sending a message #%d to %s\n", frame_num, masterQueueName);
                    //printf("frame_num = %d\n", MessageQ_getFrameNum(msg[CORE1]));
                   
                    status = MessageQ_put(queue_id[CORE0], msg[CORE1-1]);
                    if (status < 0) {
                       System_printf("MessageQ_put had a failure/error\n");       
                    }
                    frame_nb = frame_num;
                }
            }
        }
        else if(MultiProc_self() == CORE2) {
            int core_name = CORE2;
            int receive_data = 0;

            /*对CORE1中的解码器进行初始化*/
            HevcDecodeInit();  
            System_printf("Start the main loop\n");
            while (TRUE)
             {
                status = MessageQ_get(messageQ, &msg[1], MessageQ_FOREVER);//1000000
                 if(status >= 0)
                {
                    core_name = CORE0;
                    frame_num = MessageQ_getMsgId(msg[1]);
                    MessageQ_free(msg[1]);
                    printf("-------get %d from %s\n", frame_num, masterQueueName);
                }
                 status = -1;
                 if(frame_num)
                 {
                    for(i=0; i<frame_num; i++)
                    {
                        //解码
                        libOpenHevcDecode(i);
                        //滤波
                        HevcFrameFilter(i);
                    }
                    for(i=0; i<frame_num; i++)
                    {
                        OutputDecodeFrame(i);
                    }
                    msg[1] = MessageQ_alloc(HEAPID, sizeof(MessageQ_MsgHeader)); //
                    if (msg[1] == NULL) {
                    System_abort("MessageQ_alloc failed\n" );
                    }
                    MessageQ_setMsgId(msg[1], frame_num);  //frame_num
                    MessageQ_setSrcProc(msg[1], CORE2);
                   
                   System_printf("Sending a message #%d to %s\n", frame_num, masterQueueName);
                    /* send the message to the remote processor */
                    status = MessageQ_put(queue_id[CORE0], msg[CORE2-1]);
                    if (status < 0) {
                       System_printf("MessageQ_put had a failure/error\n");       
                    }
                }
                 status = -1;
                 frame_num = 0;
            }
        }
        else if(MultiProc_self() == CORE3)
        {
            int core_name = CORE3;
            System_printf("Start the main loop\n");

            while (TRUE)
            {
                status = MessageQ_get(messageQ, &msg[2], MessageQ_FOREVER);//1000000
                if(status >= 0)
                {
                    //core_name = MessageQ_getSrcProc(msg[CORE2]);
                    frame_num = MessageQ_getMsgId(msg[2]);
                    MessageQ_free(msg[2]);
                    printf("-------get %d from core%d\n", frame_num, CORE0);
                }
             
                if(frame_num) //||(g_sate.save_num && g_sate.save_flag)
                {
                   hevc_decode_write(frame_num);

                    msg[2] = MessageQ_alloc(HEAPID, sizeof(MessageQ_MsgHeader)); //
                    if (msg[2] == NULL) {
                    System_abort("MessageQ_alloc failed\n" );
                    }
                    MessageQ_setMsgId(msg[2], frame_num);  //frame_num
                    MessageQ_setSrcProc(msg[2], CORE3);

                    System_printf("Sending a message #%d to %s\n", frame_num, masterQueueName);
                    /* send the message to the remote processor */
                    status = MessageQ_put(queue_id[CORE0], msg[2]);
                    if (status < 0)
                        System_printf("MessageQ_put had a failure/error\n");       
                }
                frame_num = 0;
            }
    }
        else  {
           while(1);
        }
        System_printf("The test is complete\n");
        //BIOS_exit(0);
    #endif
    }

    /*
     *  ======== main ========
     *  Synchronizes all processors (in Ipc_start) and calls BIOS_start
     */
    Int main(Int argc, Char* argv[])
    {
        Int status;
        /* 
         *  Ipc_start() ca+]lls Ipc_attach() to synchronize all remote processors
         *  because 'Ipc.procSync' is set to 'Ipc.ProcSync_ALL' in *.cfg
         */

         #if 1
         status = Ipc_start();
         printf("%d\n",status);
        if (status < 0) {
            System_abort("Ipc_start failed\n");
        }
     #endif
        BIOS_start();

        return (0);
    }
    /*
     *  @(#) ti.sdo.ipc.examples.multicore.evm667x; 1, 0, 0, 0,1; 5-22-2012 16:36:06; /db/vtree/library/trees/ipc/ipc-h32/src/ xlibrary

     */

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

    .

    /*
    * Copyright (c) 2012, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * */

    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
    var Memory = xdc.useModule('xdc.runtime.Memory');

    /*
    * Get the list of names that the build device supports.
    * I.e. ["CORE0", "CORE1", "CORE2" ... ]
    */
    var nameList = MultiProc.getDeviceProcNames();

    /*
    * Since this is a single-image example, we don't (at build-time) which
    * processor we're building for. We therefore supply 'null'
    * as the local procName and allow IPC to set the local procId at runtime.
    */
    MultiProc.setConfig(null, nameList);

    /*
    * The SysStd System provider is a good one to use for debugging
    * but does not have the best performance. Use xdc.runtime.SysMin
    * for better performance.
    */
    var System = xdc.useModule('xdc.runtime.System');
    var SysStd = xdc.useModule('xdc.runtime.SysStd');
    System.SupportProxy = SysStd;

    /* Modules explicitly used in the application */
    var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
    var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
    var HeapBufMP = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');

    /* BIOS/XDC modules */
    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.heapSize = 0x8000000;
    var Task = xdc.useModule('ti.sysbios.knl.Task');

    var tsk0 = Task.create('&tsk0_func');
    tsk0.instance.name = "tsk0";

    /* Synchronize all processors (this will be done in Ipc_start) */
    Ipc.procSync = Ipc.ProcSync_ALL;

    /* Shared Memory base address and length */
    var SHAREDMEM = 0x0C000000;
    var SHAREDMEMSIZE = 0x00200000;

    /*
    * Need to define the shared region. The IPC modules use this
    * to make portable pointers. All processors need to add this
    * call with their base address of the shared memory region.
    * If the processor cannot access the memory, do not add it.
    */
    var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
    SharedRegion.setEntryMeta(0,
    { base: SHAREDMEM,
    len: SHAREDMEMSIZE,
    ownerProcId: 0,
    isValid: true,
    name: "DDR2 RAM",
    });
    /*
    * @(#) ti.sdo.ipc.examples.multicore.evm667x; 1, 0, 0, 0,1; 5-22-2012 16:36:06; /db/vtree/library/trees/ipc/ipc-h32/src/ xlibrary

    */

    Program.stack = 10208;
    BIOS.heapSection = "HEAP_CACHE";
    tsk0.stackSize = 102400;

  • Hi hui,

    Please try to answer my two questions to help you better.

    Regards,
    Shankari
  • 1、the version of the IPC package are ipc_1_23_05_40 and ipc_1_24_03_32, the name of the example program of IPC is C6678:MessageQ(single image for all cores).
    2、TMDXEVM6678LE
  • Hi hui,

    Thanks for sharing the source.

    Could you share the following include and neccessary library files for your project if any.

    #include "openHevcWrapper.h"
    #include "getopt.h"
    #include "videoDecodeTsk.h"
    #include "../common_lib/libavformat/avformat.h"
    #include "../common_lib/libavcodec/hevc.h"

    Regards,
    Shankari
  • Hi Hui zhu57,

    hui zhu57 says said:
    1、 the version of the IPC package are ipc_1_23_05_40 and ipc_1_24_03_32, the name of the example program of IPC is C6678:MessageQ(single image for all cores).
    2、TMDXEVM6678LE

    I tried out the image processing demo example for EVMC6678 with the IPC package version 1_24_03_32 and ipc_1_23_05_40.

    Able to stop with the breakpoint at function, main(). Please refer the screenshot below. Actually your project seems to have some problems in using the ipc packages. I would recommend you to run this demo example and see you are able to stop at main(). If it works, compare the CCS properties of the demo project with your own project.

    I suspect the way you run the program


      /*  
         *  Ipc_start() ca+]lls Ipc_attach() to synchronize all remote processors
         *  because 'Ipc.procSync' is set to 'Ipc.ProcSync_ALL' in *.cfg
         */



    As mentioned in comment, "Ipc_start" would return when all the slave cores get loaded with appropriate binaries (.out).


    MultiProc.setConfig(null, ["CORE0", "CORE1", "CORE2", "CORE3", "CORE4", "CORE5", "CORE6", "CORE7"]);
    /* Synchronize all processors (this will be done in Ipc_start) */
    Ipc.procSync = Ipc.ProcSync_ALL;


    Say, For example, In *.cfg, if you mention that SYNC is required for 7 slave cores then you may have to load the slave's .out into 7 cores.
        
    Please refer to the following TI wiki page to know more about IPC sync.

    http://processors.wiki.ti.com/index.php/IPC_Users_Guide/Ipc_Module#Ipc_Module_Configuration    

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------