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.

dsplink config

Other Parts Discussed in Thread: OMAPL138

I am fairly new to interfacing with DSP. I am trying to use DSPLink_1_65_1_5 for downloading a non-TI DSP Image(coff) on OMAPL138 DSP. I will also like to use DSPLInk to reset the DSP.

This is what the map file of the DSP Image looks like:-

MEMORY CONFIGURATION

         name            origin    length      used     unused   attr    fill
----------------------  --------  ---------  --------  --------  ----  --------
  HW_VECTS              11800000   00000200  00000200  00000000  RWIX
  IRAM                  11800200   0002fe00  0002f184  00000c7c  RWIX
  L3_RAM            80000000   00020000  0001ca48  000035b8  RWIX
  NonCached             c2000000   01000000  000bb702  00f448fe  RWIX
  EXT                   c3000000   01000000  00075cee  00f8a312  RWIX

My problem is that I am not able to do a mapping between the coff DSP file and the CFG_OMAPL138GEMSHM_SHMEM.c/.tci file. I have tried to put my problem in form of these questions:

1. There is no reset-ctrl section in the dsp image that i got. Do I need to write one small dsp program that I download to RESETCTRL address to reset the DSP?

2. Shall I mention the whole address range (11800000 - c40000000 ) in DSPLink DATA section(CFG_xxx.c)?

or , can i remove all the existing sections in the CFG_##.c file, and introduce these 5 sections?

3. Is there a DSPLink document explaining what these existing sections in CFG_XXXX.c and .tci file means?

Will appreciate some references/ example.

Regards,

  • sandeep kalra said:

    1. There is no reset-ctrl section in the dsp image that i got. Do I need to write one small dsp program that I download to RESETCTRL address to reset the DSP?

    You don't necessarily need a section named RESETCTRL, but you do need some section for it.  This section would be uninitialized, and DSPLink will use it to write a special "reset vector" stub that is used as the program starting point after the DSP is released from reset.  This vector will simply branch to the program's entry point (typically _c_int00).  This vector is separate from your regular runtime vector table.

    So, once you carve out the 0x80 bytes needed for this usage, you point to it by setting RESETCTRLADDR (in your CFG_*.c file) to the base value of this section.

    sandeep kalra said:

    2. Shall I mention the whole address range (11800000 - c40000000 ) in DSPLink DATA section(CFG_xxx.c)?

    or , can i remove all the existing sections in the CFG_##.c file, and introduce these 5 sections?

    No, one big address range would surely eat up all the virtual space in Linux.

    You should remove existing sections and put in your own.

    sandeep kalra said:

    3. Is there a DSPLink document explaining what these existing sections in CFG_XXXX.c and .tci file means?

    http://processors.wiki.ti.com/index.php/Changing_DSPLink_Memory_Map

    Regards,

    - Rob

  • Hi Rob,

    Thanks for the suggestion.

    I have made changes in the CFG and .tci files as per your suggestion , and to some extend the problems are resolved, but i still see runtime error related to pool initialization. I am attaching all the config files and also the error log. If possible, kindly suggest me areas where I need to change further.

    Regards,

    Sandeep

    dspdir.tar.gz
  • Hi Sandeep,

    Maybe your POOL entry Id is off.  You can take a look at this:

    http://processors.wiki.ti.com/index.php/DSPLink_POOL_FAQs

    Best regards,

        Janet

  • Thanks Janet, it was off, and my u-boot hole was smaller than what was required for the application.

    I am now able to PROC_setup, PROC_attach and POOL_open.

    Now I am stuck with PROC_load. It fails with error DSP_EFAIL,

  • Hi Sandeep,

    Good to see you found the POOL problem.  To figure out why PROC_load() is failing, you can enable DSPLink trace.  Here is a wiki article on how to do that:

    http://processors.wiki.ti.com/index.php/Enabling_trace_in_DSPLink

    Best regards,

        Janet

  • Here is what I am seeing after I enabled the tracing in DSPLink. 

    Failure status [0x80008008] File [0x200] line [909]

    As suggested, I looked at the entry Ids, but could not see any obvious mistake. I am new to DSP work, and DSPLink.. so I must be doing something wrong...Is it possible to do a double check at your end?

    I am attaching a zip with detail error_logs, the coff_executable_image.map file, the dsplink kernel .tci file, and also CFG_ files that I modified.

    Also, my u boot parameters looks like this:

    setenv bootargs console=ttys2,115200n8 noinitrd rw mem=32M@0xc0000000 mem=32M@0xc6000000 root=/dev/nfs nfsroot=${serverip}:/rfs,nolock ip=dhcp


    Regards\

    Sandeep

    dsp_error.zip
  • Sandeep,

    I'm not sure why PROC_load() is failing, because the trace is only showing messages from the User side.  I think you should enable trace on the Kernel side too.  You can look at the DSPLink User's Guide, chapter 30 "Debugging Applications" for all the details, but basically:

    1. Re-run the dsplinkcfg script with the --trace=1 option, for example:

    perl dsplinkcfg.pl --platform=OMAPL138 --nodsp=1 --dspcfg_0=OMAPL138GEMSHMEM --dspos_0=DSPBIOS6XX --gppos=ARM --comps=ponslrmc --trace=1

    2.  In the file dsplink/gpp/src/pmgr/Linux/2.6.18/drv_pmgr.c, enable PROC trace by uncommenting lines:

                TRC_ENABLE (ID_LDRV_PROC)       ;

                TRC_SET_SEVERITY (TRC_ENTER) ;

    3.  Rebuild your dsplink.ko, dsplink.a, and app.

    If you don't get enough information, you can try uncommenting more lines in drv_pmgr.c, but I think PROC trace is a good start.

    Best regards,

        Janet

  • attached is the new err file.

  • Hi Sandeep,

    I still don't see any kernel trace in your log.  Did you insmod the new dsplink.ko?  Also, when you ran the dsplinkcfg step with --trace=1, did you copy the line I had posted?  That was just meant to be an example that I pulled from the Install guide.  Your trace is now showing RingIO that was not in your previous trace.  Was that intentional?  If not, please check your dpslinkcfg --comps option.  Your DSP and Arm apps must both be built with the same components, otherwise PROC_start() could fail.

    Best regards,

        Janet

  • I am sorry, I will do another build and give you the traces  soon.

  • Status: 8000
    Leaving DRV_Invoke ()   status [0x8000]
    Leaving _IDM_USR_acquireId ()   status [0x8000]
    Leaving _SYNC_USR_createCS ()   status [0x8000]
    Leaving _MPCS_OS_open ()        status [0x8000]
    Leaving MPCS_open ()    status [0x8000]
    Leaving _MPLIST_init ()         status [0x8000]
    Entered _SYNC_USR_leaveCS ()
            csObj   [0x14c020]
    Leaving _SYNC_USR_leaveCS ()    status [0x8000]
    Leaving PROC_attach ()  status [0x8000]
    PROC_ATTACH SUCCESS
    Entered POOL_open ()
            poolId  [0x0]
            params  [0x50308]
    Entered _SYNC_USR_enterCS ()
            csObj   [0x14c020]
    Leaving _SYNC_USR_enterCS ()    status [0x8000]
    Entered DRV_Invoke ()
            drvObj  [0x14c008]
            cmdId   [0xc018e03f]
            arg1    [0xbeb0fc40]
            arg2    [0x0]
    Status: 8000
    Leaving DRV_Invoke ()   status [0x8000]
    Entered _SYNC_USR_leaveCS ()
            csObj   [0x14c020]
    Leaving _SYNC_USR_leaveCS ()    status [0x8000]
    Leaving POOL_open ()    status [0x8000]
    Pool_Open SUCCESS.
    Entered PROC_load ()
            procId  [0x0]
            imagePath       [0x38e90]
            argc    [0x0]
            argv    [0x0]
    Entered _SYNC_USR_enterCS ()
            csObj   [0x14c020]
    Leaving _SYNC_USR_enterCS ()    status [0x8000]
    Entered DRV_Invoke ()
            drvObj  [0x14c008]
            cmdId   [0xc018e015]
            arg1    [0xbeb0fc44]
            arg2    [0x0]
    Status: 80008008
    Leaving DRV_Invoke ()   status [0x80008008]

    Failure: Status:[0x80008008] File:[0x200] Line:[909]
    Entered _SYNC_USR_leaveCS ()
            csObj   [0x14c020]
    Leaving _SYNC_USR_leaveCS ()    status [0x8000]
    Leaving PROC_load ()    status [0x80008008]
    ProcLoad Failed. Status = 0x80008008


    Looking at the code, it looks like driver fails to get semaphore in PROC_load()------->_SYNC_USR_enterCS()---->waits for semaphore (else EFAIL)

  • One more thing I wanted to add here. I have followed all steps to enable kernel logs as in chapter-30, but the above logs are all I am getting.

    There are my steps:

    perl ./dsplinkcfg.pl --platform=OMAPL138 --nodsp=1 --dspcfg_0=OMAPL138GEMSHMEM --dspos_0=DSPBIOS5XX --gppos=ARM --comps=poc --trace=1

    modified drv_pmgr.c (DRV_InitializeModule()) to enable _PROCs, set severity to LEVEL6.

    I even upgraded from DSPLink1.65.01.05_eng, to DSPLink1.65.02.09 to see if that helps, but there was no change in behavior.

  • Hi Sandeep,

    Could you try adding a printk() to one of the dsplink kernel source files (eg, drv_pmgr.c), and see if you at least get that?  Kernel prints go out the serial port, so you need to have a serial port connection to view them.

    Thanks,

        Janet

  • Hi Janet,

    Thanks for the quick tip.. here is the exact place where the driver is failing

    in function:PMGR_PROC_load()


    1005                     loaderObj.objCtx = PMGR_ProcObj [procId].objCtx ;
    1006                     loaderObj.endian = (Endianism) dspObj->endian ;
    1007                     loaderObj.maduSize      = dspObj->maduSize ;
    1008                     loaderObj.fnWriteDspMem = &LDRV_PROC_write ;
    1009                     loaderObj.fnAddrConvert = &LDRV_PROC_addrConvert ;
    1010
    1011                     status = (*(loaderIntf->load)) (
    1012                                           procId,
    1013                                           &loaderObj,
    1014                                           argc,
    1015                                           argv,
    1016                                           &(PMGR_ProcObj [procId].entryPoint)) ;

    1017                     if (DSP_FAILED (status)) {
    1018                         SET_FAILURE_REASON ;
    1019                         if (status == DSP_ERANGE) {
    1020                             PRINT_Printf (
    1021                                      "Error: DSP-side memory map does not "
    1022                                      "match configuration.\n"
    1023                                      "Compare DSP-side TCF/MAP file with "
    1024                                      "/dsplink/config/all/CFG_<PLATFORM>.c\n") ;

    Do I need to mention any entry point in any CFG_XX.c file?

    Regards

    Sandeep

  • Hi Sandeep,

    I'm glad you were able to get the kernel trace now.  It looks like your memory map on the DSP is not matching the Arm side.  Here are some links you may find useful:

    http://processors.wiki.ti.com/index.php/Troubleshooting_DSPLink_configuration_issues

    http://processors.wiki.ti.com/index.php/Changing_DSPLink_Memory_Map

    You must have made changes to CFG_OMAPL138GEM_SHMEM.c and not updated dsplink-omapl138gem-base.tci.

    Best regards,

        Janet

  • Janet,

    I have already uploaded all the files(CFG and .tci, and also memory map) in zip format(in earlier messages) . I am not very good in understanding map files to fill CFG_<platform>.c and .tci, and i am suspecting that there is some problem in them..

    Is there a possibility that you can take a look at them ?

    Regards

    Sandeep

  • Sandeep,

    It looks like "DSPLINKMEM1" (SHAREDMEMORYADDR1) in the Arm config is where you have the POOL config on the DSP.  Maybe that is the problem?

    Best regards,

        Janet

  • For the record, when using DSPLink to just load, start and reset the processor, you just need the PROC module. You can run the dsplinkcfg step as:

    perl ./dsplinkcfg.pl --platform=OMAPL138 --nodsp=1 --dspcfg_0=OMAPL138GEMSHMEM --dspos_0=DSPBIOS5XX --gppos=ARM --comps=ps

    This will just bring in the PROC and MPCS (critical section support) modules.

    The DSP program must also have a "RESETCTRL" section, as mentioned earlier in this thread, where DSPLink can write instructions to branch to the DSP program's starting point (eg, a branch to _cinit_00).

    Then there shouldn't be any problems of memory configuration mismatch between the Arm and the DSP.

  • Additional note:  We found a bug in one of the DSPLink 1.65.02.09 SOURCES files that results in a compile error when building the dsplinkk.ko module, with --comps=p.

    If you just want to use DSPLink to load and start the DSP (ie, only using the PROC module and no other DSPLink APIs), then you would want to run the dsplinkcfg with --comps=p.  This prevents any handshaking between the Arm and the DSP.  However, when we ran:

    perl ./dsplinkcfg.pl --platform=OMAPL138 --nodsp=1 --dspcfg_0=OMAPL138GEMSHMEM --dspos_0=DSPBIOS5XX --gppos=ARM --comps=p

    and then tried to build the DSPLink gpp side, we got this error:

    Building kernel side code using kbuild
    In file included from /db/vtree/jeh/docs/support/dsplink/dsplink_linux_1_65_02_09/
    dsplink/gpp/src/ldrv/MPCS/ldrv_mpcs_os.h:31,
                     from /db/vtree/jeh/docs/support/dsplink/dsplink_linux_1_65_02_09/
    dsplink/gpp/src/../../gpp/src/ldrv/Linux/ldrv_mpcs_os.c:37:
    /db/vtree/jeh/docs/support/dsplink/dsplink_linux_1_65_02_09/dsplink/gpp/inc/usr/mpcsdefs.h:196: error: 'MPCSOBJ_PROC_PADDING' undeclared here (not in a function)

    We fixed this by changing the code in $DSPLINK/gpp/src/ldrv/Linux/SOURCES to the following:

    ifeq ($(TI_DSPLINK_USE_MPCS), 1)
    SOURCES      := ldrv_os.c \
                    ldrv_mpcs_os.c
    else
    SOURCES      := ldrv_os.c
    endif