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.

OMAP-L137 DSPLink PROC_start halts Linux

Other Parts Discussed in Thread: SYSBIOS, DA8XX, OMAP-L137, OMAPL138

I am using the DA830 EVM with the TI SDK 03.20.00.14 kernel on the arm side and BIOS 5.33.05 on the DSP side in conjunction with DSPLink 1.65.00.03.  I have tried running a modified version of the Message sample as well as the unmodified original version of the sample.  In either case, the kernel seems to halt after PROC_start attempts to start the DSP.  I do not know if the DSP is running or not.

...

Leaving PROC_load ()     status [0x8000]
Entered PROC_start ()
    procId    [0x0]
Entered _SYNC_USR_enterCS ()
    csObj    [0x29168]
Leaving _SYNC_USR_enterCS ()     status [0x8000]
Entered DRV_Invoke ()
    drvObj    [0x29150]
    cmdId    [0xc018e013]
    arg1    [0xbea86c9c]
    arg2    [0x0]

**** sample stops outputting here ****

Based on what I've read searching on these forums as well as the wiki, my assumption was that there was a timer conflict between the DSP and the ARM.

http://processors.wiki.ti.com/index.php/Troubleshooting_DSPLink_configuration_issues#Problem:_I_see_a_crash_as_soon_as_I_run_a_DSPLink_sample

"Possible cause: There is an overlap in the configuration of timers on Linux and DSP/BIOS. This problem has commonly been seen on OMAPL137 and DA830 where the timer 0 is used by DSP/BIOS and Linux. In that case: Update the sample to change the BIOS timer to use a different timer. See a sample configuration to change to timer 1."

The example that followed appears to be SYSBIOS 6 specific.  I believe DSPBIOS 5 must have its system clock configured differently.

Another assumption I'm making is that DSPBIOS is already using Timer1 which I originally thought was conflicting with the Watchdog used in Linux.  This is based on the following lines in my bios_6747.tci file.

    prog.module("ISRC").instance("Timer_0").iIntrSelectNum = 4;
    prog.module("ISRC").instance("Timer_1").iIntrSelectNum = 40;
    prog.module("HWI").instance("HWI_INT14").interruptSelectNumber = 4;
    prog.module("CLK").TIMER0BASE = 0x01c20000;
    prog.module("CLK").TIMER1BASE = 0x01c21000;
    prog.module("CLK").TIMERSELECT = "Timer 1";

I also believe that Linux is using the lower half of Timer0 as its system clock based on the code in arch/arm/mach-davinci/da830.c:

static struct davinci_timer_instance da830_timer_instance[2] = {
    {
        .base        = IO_ADDRESS(DA8XX_TIMER64P0_BASE),
        .bottom_irq    = IRQ_DA8XX_TINT12_0,
        .top_irq    = IRQ_DA8XX_TINT34_0,
        .cmp_off    = DA830_CMP12_0,
        .cmp_irq    = IRQ_DA830_T12CMPINT0_0,
    },
    {
        .base        = IO_ADDRESS(DA8XX_TIMER64P1_BASE),
        .bottom_irq    = IRQ_DA8XX_TINT12_1,
        .top_irq    = IRQ_DA8XX_TINT34_1,
        .cmp_off    = DA830_CMP12_0,
        .cmp_irq    = IRQ_DA830_T12CMPINT0_1,
    },
};

/*
 * T0_BOT: Timer 0, bottom        : Used for clock_event & clocksource
 * T0_TOP: Timer 0, top            : Used by DSP
 * T1_BOT, T1_TOP: Timer 1, bottom & top: Used for watchdog timer
 */
static struct davinci_timer_info da830_timer_info = {
    .timers        = da830_timer_instance,
    .clockevent_id    = T0_BOT,
    .clocksource_id    = T0_BOT,
};

So, I disabled the watchdog timer in my kernel configuration, which resulted in the same halting output.  I've read this page in the wiki on disabling the watchdog timer in the kernel to prevent timer conflicts with the DSP, but it appears to be based on the MontaVista kernel only.

http://processors.wiki.ti.com/index.php/OMAP-L137_Audio_Drivers_in_the_DSP_%2B_Linux#Disabling_Timer1

So I'm not entirely sure that this is a timer conflict.  If it is, I'm not particularly happy about not being able to use the watchdog.  Ideally, I'd like to be able to use the lower half of T0 for Linux, the upper half of T0 for BIOS and T1 for the watchdog.  However, I am relatively clueless as to how I would go about accomplishing this.  Most important on my list at the moment though is just to get the examples to run.

 

  • Not a solution but some additional info. I am midst of testing out DSPLink.

    My platform:
    OMAP-L137 EVM
    linux-03.21.00.04 aka linux-2.6.37
    Arago FS 2009.11 base
    dsplink 1.65.00.03
    bios 5.41.10.36
    TI CGT 6.1.12
    XDC 3.22.0.21

    DSPLink config:
    perl config/bin/dsplinkcfg.pl
     --platform=OMAPL1XX
     --nodsp=1
     --dspcfg_0=OMAPL1XXGEMSHMEM
     --dspos_0=DSPBIOS5XX
     --gppos=ARM
     --comps=ponslrms

    With my platform, the sample "message" appears to execute to completion.

    root@da830-omapl137-evm:~# ./messagegpp message.out 1000
    ========== Sample Application : MESSAGE ==========
    Entered MESSAGE_Create ()
    Leaving MESSAGE_Create ()
    Entered MESSAGE_Execute ()
    Transferring 1000 iterations took 0 seconds 320885 microseconds.
    RoundTrip Time for 1 message is 320 microseconds.
    Leaving MESSAGE_Execute ()
    Entered MESSAGE_Delete ()
    Leaving MESSAGE_Delete ()
    ====================================================

    DSPLink can kill my kernel or at least my console. If I give the wrong address values to the "readwrite" sample, the console will hang on "PROC_stop" after a "PROC_write" failure.

    Not really happy that DSPLink is capable of hanging. I'll be depending on it in my production code.

     

  • As it turns out, I was able to get the sample application to run. I had bumped the RAM allocation for Linux up to 64M in my bootargs because I hadn't needed to run the DSP until now.  With that, the sample message application ran to completion with no issues.  However I'm still having the same lockup for my custom application.  It's basically just a stripped down version of the sample message application, so I should be able to make incremental changes to figure out where my issue lies.

  • I have Linux at 32MB for now. Good information to know.

     

  • I enabled more traces to help me find the source of my problem.

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

    It turns out that PROC_start (api/proc.c) eventually leads to the call of LDRV_PROC_start, which calls DSP_start, which actually starts the DSP.  My traces revealing that I was returning successfully from DSP_start but I did not return to LDRV_PROC_start.   After LDRV_PROC_start calls DSP_start, it begins a handshake process with the DSP.  This processes confirms that the handshake value on the GPP matches that of the DSP.  The value is comprised of a base value of 0xBABA0000 and various switches in the lower 2 bytes depending on which DSPLink components you have enabled.  The DSP will populate its end of the handshake value when DSPLINK_init is called.  

    In my case the value that the GPP expects to be received from the DSP is 0xBABA01FF (which corresponds to all components enabled). This value is calculated in SHMDRV_handshake() in ldrv/DRV/shm_drv.c.  I added some extra trace comments and discovered that the GPP was stuck in a loop because the GPP side of the handshake value (dspHandshake)  didn't match what the DSP side put into the L2 memory (ctrlPtr->handshakeDsp).  In this case the DSP value was 0xBABA01BF rather than 0xBABA01FF.  The missing bit indicates that the CHNL_COMPONENT was not defined.

    I believe this value is defined when dsplinkcfg.pl is run, which generates config/BUILD/CURRENTCFG.MK.

    In my generated CURRENTCFG.MK I have the line:

    export  TI_DSPLINK_DSP_COMMON_DEFINES := TRACE_ENABLE MAX_DSPS=1 MAX_PROCESSORS=2 ID_GPP=1 OMAPL1XX PROC_COMPONENT POOL_COMPONENT NOTIFY_COMPONENT MPCS_COMPONENT RINGIO_COMPONENT MPLIST_COMPONENT MSGQ_COMPONENT MSGQ_ZCPY_LINK CHNL_COMPONENT CHNL_ZCPY_LINK ZCPY_LINK

    ...which seems to inidicate that CHNL_COMPONENT is indeed defined.  So I'm still at a loss.  

    Since the provided message application works without any issues, it would seem that the problem lies withing the application only and not within dsplink.ko.  In fact, when I trace the stock message application, I never even enter the loop because the values between the GPP and DSP match as soon as the call is made.  My application certain is running DSPLINK_init() because I am at least getting a return value of 0xBABA01BF.

    When I look at dsp/src/base/drv/dsplink.c, the only other thing that would seem to stop dspHandshake from toggling that bit is for ctrl->dataDspInitDone to be wrong. How could this be caused by my application?

  • I commented out the dataDspInitDone check in DSPLINK_init, and now my application runs without any issues.  Where is this structure initialized?

    dsp/src/base/drv/dsplink.c

    DSPLINK_init() {

    ....

    #if defined (CHNL_COMPONENT)

        //if (ctrlPtr->dataDspInitDone == COMP_UNINITIALIZED) {

            ctrlPtr->dataDspInitDone = (Uint32) SYS_OK ;

            dspHandshake |= DRV_HANDSHAKE_DATA ;

        //}

    #endif /* if defined (CHNL_COMPONENT) */

    ...}

     

  • This does if fact confirm that there is a mis-match in the DSPLink configuration.  Make sure that your GPP-side and DSP-side libraries that your application is linking against are built using the same configuration.

    They'll both use the CURRENTCFG.MK file located in the dsplink/config/BUILD directory when building the libraries.  Were the GPP libraries somehow re-build but not the DSP (or vice versa)?

    As a side note:  There is a DSPLink configuration troubleshooting page on  TI's wiki 

    http://processors.wiki.ti.com/index.php/Troubleshooting_DSPLink_configuration_issues#Problem:_PROC_start_failed_with_configuration_mismatch.2Ffailure

    You can also find various DSPLink info/help on the TI's wiki under the DSPLink category:

    http://processors.wiki.ti.com/index.php/Category:DSPLink

     

  • Something MUST have been wrong in one of the libraries.  I deleted everything in my export folders, ran dsplinkcfg.pl again and rebuilt DSPLINK and the applications on both sides.  Now everything magically works.

  • Hi,

    I am having an issue that’s nearly identical to this one in symptoms, except that the solution here doesn’t work for me.  I am running on a custom OMAPL138 board.  The same code and build environment worked before on the LogicPD OMAPL138 EVM.  U-boot and linux both appear to run fine on this board.

    I have completely wiped out the dsp/export, dsp/BUILD, gpp/export and gpp/BUILD directories prior to completely rebuilding both DSPLINK and my app.  I still get the same error as the OP.  I added in similar debug messages and determined that I’m reading back from the DSP exactly the same 0xBABA01BF value as the OP.  I’ve also changed the value that the DSP code writes into that memory location to prefix it with 0x5A5A…. instead of 0xBABA….  by changing the value of the DSP_HANDSHAKE #define and I see the changes reflected on the linux side so I know the DSP is getting started, has code loaded, etc.

    However, if I simply replicate the commented-out code in the previous post in an effort to force dataDspInitDone to SYS_OK as follows:

    #if defined (CHNL_COMPONENT)

        //if (ctrlPtr->dataDspInitDone == COMP_UNINITIALIZED) {

            ctrlPtr->dataDspInitDone = (Uint32) SYS_OK ;

            dspHandshake |= DRV_HANDSHAKE_DATA ;

        //}

    #endif /* if defined (CHNL_COMPONENT) */

    I still get the same error from DSPLINK:

    calling PROC_start

    DSP-side configuration mismatch/failure

    0              -> success

    Positive value -> DSP-side failure code.

    (Uint32) -1    -> DSP-side component was not initialized.

     

        ProcId received : 0, Expected : 0

        DRV configuration status    [0x0]

        IPS configuration status    [0x0]

        POOL configuration status   [0x0]

        MPCS configuration status   [0x0]

        MPLIST configuration status [0x0]

        MQT configuration status    [0x0]

        DATA configuration status   [0xffffffff]

        RINGIO configuration status [0x0]

    PROC_start () failed. Status = [0x8052]

     

    This leads me to believe that it’s not a configuration mismatch, but a DATA component initialization failure or a memory issue that’s leading to the problem.

    I changed the code for SHMDRV_handshake to the following and I do not read back the value I write.  Instead I read back 0x00000000.  This leads me to think it’s a memory issue of some variety, but I’ve run u-boot’s mtest util for awhile on the board with no errors.

    Void

    SHMDRV_handshake  (IN Uint32 procId, IN Uint16 dspHandshake)

    {

        (Void) procId ; /* To avoid compiler warning. */

     

        /* Read the value of token that GPP writes as part of synchronization */

        do {

            HAL_cacheInv ((Void *) SHMDRV_ctrlPtr, sizeof (SHMDRV_Ctrl)) ;

        }

        while (SHMDRV_ctrlPtr->handshakeGpp != GPP_HANDSHAKE) ;

     

        /* Write the value on which GPP is waiting as part of synchronization

         * procedure.

         */

        //SHMDRV_ctrlPtr->handshakeDsp |= (DSP_HANDSHAKE | dspHandshake) ;

        SHMDRV_ctrlPtr->handshakeDsp = 0xAAAAAAAA;

        HAL_cacheWbInv ((Void *) SHMDRV_ctrlPtr, sizeof (SHMDRV_Ctrl)) ;

    }

     

    Any help would be much appreciated.  Thanks!

  • I'm just starting out with the helloDSP example. Slowly deciphering it. I'm wondering how you get all the DSPLink defines into your code. DSPLink does not use a "config.h" like U-Boot and Linux. All config defines are passed in on the compiler command line...for every source file that includes DSPLink header files. The helloDSP example is fatally flawed in that it hard codes it's defines in it's own makefile. Those hard-coded values may not match the values actually used in the built DSPLink library. I've resorted to compiler options @API_defines.txt and -@=DRV_defines.txt.

     

  • IIRC, I started with the audio (McASP) example.  It uses something like this in the Makefile to read in the includes and defines:

     

    # Set defines required by DSP/BIOS Link, leveraging file created by Link's build

    DSPLINK_DEFINES = $(shell cat $(LINK_INSTALL_DIR)/dsplink/dsp/export/BIN/DspBios/OMAPL138/OMAPL138GEM_0/DEBUG/IPS_defines.txt)

    # Set include paths required by DSP/BIOS Link, leveraging file in Link's build

    DSPLINK_INCLUDES = $(shell cat $(LINK_INSTALL_DIR)/dsplink/dsp/export/BIN/DspBios/OMAPL138/OMAPL138GEM_0/DEBUG/IPS_includes.txt)

     

    I have a higher level Makefile that knows where dsplink is installed and it exports LINK_INSTALL_DIR to the lower level Makefiles.