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.

DM816x Problem Attaching to [DSP] and others..

Hello:

We can run the DVR_RDK 1.09 example code with the standard OSD algorithm.

When we add some DSP code and run again we cannot attach to the DSP and Video M3 in the system_ipc.c -> System_ipcAttach() function.  It returns Ipc_E_NOTREADY (-11).

What could prevent the attach?  We have only made minor DSP side algorithm changes.  The DSP algorithm itself isn't started this early.

Regards,

-- b

[c6xdsp ]  5: SYSTEM: Attaching to [HOST] ...
[m3vpss ]  3087: SYSTEM: Attaching to [DSP] ...
[m3video]  3432: SYSTEM: Attaching to [DSP] ...


  • Hello:

    Here are some more details about the problem. 

    We are using cgt6x_7_3_1

    The standard build used rts6740_elf.lib and it worked okay.

    We now replaced this library with rts6740_elf_eh.lib for our C++ DSP algorithm.  This was needed because we are using exceptions.

    When we use the exceptions library we are getting stuck in system_ipc_msgq.c  function System_ipcMsgQHeapCreate() at the call to HeapMemMP_open()

    Are there more things we need to do to pull in this library.  Otherwise, why are we getting stuck here?

           /* open heap */
            retryCount = 10;
            while (retryCount)
            {
                Vps_printf(" %d: SYSTEM: Opening MsgQ Heap [%s] ...\n",
                           Utils_getCurTimeInMsec(), SYSTEM_IPC_MSGQ_HEAP_NAME);

                status =
                    HeapMemMP_open(SYSTEM_IPC_MSGQ_HEAP_NAME,
                                   &gSystem_ipcObj.msgQHeapHndl);
                if (status == HeapMemMP_E_NOTFOUND)
                {
                    /* Sleep for a while before trying again. */
                    Task_sleep(1000);
                }
                else if (status == HeapMemMP_S_SUCCESS)
                {
                    break;
                }
                retryCount--;
                if (retryCount <= 0)
                    UTILS_assert(0);
            }

  • It appears that the source of this problem is that the linker assigns some on chip memory to the rts6740_elf_eh.lib library AND this memory overlaps the memory assigned to the M3 Video.  

    I have fixed this problem by creating some new variables in config_1G_256Linux.bld and using them to give the DSP a starting offset in OCM0 after the known size of the memory allocated to the M3 Video. 

    Is this the expected way to handle this problem?  Is there a way to configure the system so that the Linker recognizes that two processors are sharing a memory region and have it allocate properly?  Or do we manually have to program this step as I have done? 

    Regards,

    -- B

  •  First of all, please post all DVR RDK releated query on DM816x forum.

    To understand the inner workings of McFW, please go through DVR_RDK_McFW_UserGuide.pdf inside dvr_rdk/docs folder.

    Is there a shared memory between the Linux and DSP processors so that we can we just pass a pointer from Linux Memory space to the DSP.  If so, what shared memory space is appropriate (SR3?), is there a heap, how do we malloc in that space, and free it?  Or, do we create a large message and pass via which API?

    SR0 is syslink shared region. A8 can allocate memory from this pool using Vsys_allocBuf() API. Look for defination of this module inside dvr_rdk\mcfw\src_linux\mcfw_api\ti_vsys.c file. This memory pointer can be passed from A8 to DSP using System_linkControl() API. If you are creating new link on DSP side, this buffer pointer can be part of create or dynamic param structure of the algorithm inside *.h file that should be placed inside dvr_rdk\mcfw\interfaces\link_api. If you are just enhancing current algLink on DSP, then enhance the structure inside dvr_rdk\mcfw\interfaces\link_api\algLink.h

    If you need to increase the DSP code/data memory, you can modify file dvr_rdk\mcfw\src_bios6\cfg\ti816x\*.bld and remap the memory follwoing the guidelines in chapter 5.2 of DVR_RDK_McFW_UserGuide.pdf.

    Regards,

    Manisha

  • We also noticed that we can explicitly assign a section to a desired memory segment in BIOS_c6xdsp.cfg.

  •  

    Yes, you can assign a section to a desired memory segment in BIOS_c6xdsp.cfg. You can also change DSP heap memory size inside FC_RMAN_IRES_c6xdsp.cfg

  • Hi, Bandeg, 

    May I ask how did you find the overlap? By check the memory map of dsp, then then compare that with the overall map (including M3)? 

    Any input is appreciated. 

    Best,

    Yuanwei