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.

ProcMgr_read of Syslink

Other Parts Discussed in Thread: TMS320DM8168

Hi all

- I am using board DM8168 (1GB DDRAM 2)

- I use syslink 02.00.00.67

- I wrote a sample:

  • Load and start core DSP C674 from A8 (linux host) => success
  • Call 'ProcMgr_read" function ==> have error code ProcMgr_E_TRANSLATE

- parameters for 'ProcMgr_read" function: ProcMgr_read(procMgrHandle,0xAB000000, &iNumByte,(Ptr) &value);

- Config memory for board

config ti.platforms.generic.Platform.Instance CPU =
        ti.platforms.generic.Platform.create("CPU", {
            clockRate:      800.0,                                      
            catalogName:    "ti.catalog.c6000",
            deviceName:     "TMS320DM8168",
            externalMemoryMap:
           [         
                ["DDR2",
                     {
                        base: 0xA0000000,                   
                        space: "code/data",
                        name: "DDR2",
                        len: 0x20000000,                   
                        access: "RWX",
                     }
                ],
                ["SR0",
                     {
                        base: 0x90000000,                   
                        space: "data",
                        name: "SR0",
                        len: 0x00100000,                   
                        access: "RWX",
                     }
                ],
                ["SR1",
                     {
                        base: 0x90100000,                   
                        space: "data",
                        name: "SR1",
                        len: 0x00100000,                   
                        access: "RWX",
                     }
                ],
                ["EXT_RAM",
                     {
                        base: 0x80000000,                   
                        space: "code/data",
                        name: "EXT_RAM",
                        len: 0x10000000,                   
                        access: "RWX",
                     }
                ],
           ],
          l1DMode:"32k",
          l1PMode:"32k",
          l2Mode:"32k",

    });

Any advice?  Thanks

 

  • Hi:

         I encountered  the same the problem. Did you solve your problem ?

    David

  • Mark,

    SysLink will not automatically map all the DSP memory regions to A8 Linux user-space. Since the Linux-side does not know about this memory region, translation is failing and it gives the ETRANSLATE error. SysLink does map the required regions it needs for loading the DSP (loadable sections in the DSP executable only), which would lie within the DDR2 memory region you have configured above. It also automatically maps all 'Shared Regions' to Linux kernel as well as user-space. However, if you need some other memory region mapped to Linux A8 user-space so that you can call ProcMgr_read on it, you need to first call ProcMgr_map on that memory region from A8 so that it will map it to Linux user-space. You can take a look at Linux-side SharedRegion sample application to get a reference call to ProcMgr_map.

    Another option is to create a SharedRegion in the memory region that you want to access through ProcMgr_read. This can be done in the DSP-side CFG file. You should specify createHeap option as FALSE since you don't want to create a heap in it. Then this SharedRegion would get automatically mapped on Linux-side on loading and starting the DSP, and you would not need to call ProcMgr_map. One more option is to create a SharedRegion, set createHeap as TRUE, and then on Linux-side, call SharedRegion_getHeap, call Memory_alloc on that heap handle to get a buffer that you can read from in Linux user-space. Example of this usage is also there in the Linux-side SharedRegion sample application.

    Regards,
    Mugdha

  • Mugdha,

           I follow your advice,. Create  shareRegion " SR2" , which I want to access through  ProcMgr_read.  Set  ceateHeap of SR_2  to false;

    When I use ProcMgr_read to access ,  Still got  "ProcMgr_E_TRANSLATE" .  My define is as follows:

    Build.platformTable["ti.platforms.evmOMAPL138:dsp"] = {
        externalMemoryMap: [
            [ SR_0.name, SR_0 ],
            [ SR_1.name, SR_1 ],
            [ SR_2.name, SR_2 ],
            [ "DSP_PROG", {
                name: "DSP_PROG", space: "code/data", access: "RWX",
                base: 0xC3000000, len: 0x800000,
                comment: "DSP Program Memory (8 MB)"
            }]
        ],

    var SR2Mem = Program.cpu.memoryMap["SR_2"];

    SharedRegion.setEntryMeta(2,
        new SharedRegion.Entry({
            name:           "Record data",
            base:           SR2Mem.base,
            len:            SR2Mem.len,
            ownerProcId:    0, //MultiProc.getIdMeta("HOST"),
            cacheEnable:    false,
            isValid:        true,
            createHeap:     false
        })
    );

     

  • Hi,

    At what point did you call ProcMgr_read? Was it after the call to Ipc_control (.. , Ipc_CONTROLCMD_STARTCALLBACK, ...)?

    Can you enable TraceFailure prints and check where the ETRANSLATE error is coming from? http://processors.wiki.ti.com/index.php/SysLink_UserGuide#Trace.2C_debug_and_build_configuration

    Regards,
    Mugdha

  • Mugdhas:

          Enabled  Trace, Error message is as follows:

            *** ProcMgr_translateAddr: Failed to translate address
            Error [0xfffffff3] at Line no: 2069 in file /opt/ti/syslink_2_10_05_26/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslink/procMgr/common/ProcMgr.c
    *** ProcMgr_translateAddr: Failed to translate address!
            Error [0xfffffff3] at Line no: 2086 in file /opt/ti/syslink_2_10_05_26/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslink/procMgr/common/ProcMgr.c
    *** ProcMgr_read: Address is not mapped!
            Error [0xfffffff3] at Line no: 1713 in file /opt/ti/syslink_2_10_05_26/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslink/procMgr/common/ProcMgr.c
    *** ProcMgrDrv_ioctl: Kernel-side ProcMgr_read failed
            Error [0xfffffff3] at Line no: 1346 in file /opt/ti/syslink_2_10_05_26/packages/ti/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslink/procMgr/hlos/knl/Linux/ProcMgrDrv.c

     

  • Yes, it's like I said, the address is not mapped. Did you call ProcMgr_read after the call to Ipc_control (start callback)?

    Regards,
    Mugdha

  •  Mugdha:

    Yesy, I call  ProcMgr_read after  Ipc_control .

     My  Ipc_control is below

     status = Ipc_control(remoteProcId, Ipc_CONTROLCMD_LOADCALLBACK, NULL)

    rgds

     

  • Hi,

    What about start callback?

    status = Ipc_control(remoteProcId, Ipc_CONTROLCMD_STARTCALLBACK, NULL)

    You need to call ProcMgr_read after call to start callback. That's when all the mappings happen.

    Regards,
    Mugdha

  • mugdha,

        The following is my code, I check share region 2 , cheate heap is false. 

    But the error messgage is as before.

        /* invoke the SysLink load callback */
        remoteProcId = MultiProc_getId(Main_remoteProcName);
        status = Ipc_control(remoteProcId, Ipc_CONTROLCMD_LOADCALLBACK, NULL);

        if (status < 0) {
            goto leave;
        }

        /* invoke the SysLink start callback */
        status = Ipc_control(remoteProcId, Ipc_CONTROLCMD_STARTCALLBACK, NULL);

        if (status < 0) {
            goto leave;
        }

        status=SharedRegion_getEntry(0, &entry1);
        status=SharedRegion_getEntry(1, &entry1);
        status=SharedRegion_getEntry(2, &entry1);

     status=ProcMgr_open(&handlePtr,remoteProcId);
        if (status<0)
        printf("ProcMgr_open failure! ");
        else
         printf("ProcMgr_open ok! ");
        var_dspBufAddr=0xc6100000;
     status = ProcMgr_read(handlePtr,var_dspBufAddr,&NumBytes,receiveDSPbuf);
        if (status<0)
        printf("ProcMgr_read failure! ");
        else
         printf("ProcMgr_read ok! ");