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.

Problems with Hwi_create

Hi All...

 

I am running on the DM8168 DaVinci chip and working on a DSP application for the C674x core.  On the A8 we have a Linux driver using DMA to read/write data to/from the McASP.  When the transfer is finished, the McASP driver will raise an interrupt (EDMAINT, interrupt 20) to indicate to the DSP that it is ready for the DMA data to be read.

I am using Hwi_create to create an Hwi instance for the EDMAINT interrupt, but I am running into lots of problems.  Here's my call to Hwi_create:

    Hwi_Params_init(&hwiParams);

    hwiParams.arg = 0;

    Error_init(&eb);

    hwi0 = Hwi_create(20, EurekaISR, &hwiParams, &eb);

    if (hwi0 == NULL)

    {

        LOGINFO(__MGR__, "ERROR: Could not create Eureka interrupt handler\n");

        if (Error_check(&eb)) {

            String mystring;

            UInt16 errcode;

            mystring = Error_getMsg(&eb);

            errcode = Error_getCode(&eb);

            printf("Got error from HWI_CREATE: code: %d string:%s!!!!!!!!!!!!!!!!!!\n",errcode,mystring);

        }

    }

    else {

        printf("HWI_CREATE completed: %d\n", hwi0);

    }

***************************************************************************
When I run this, I get this output:
DEBUG dsp[0] #:00030 T:00000001|96dddd97 S:INFO  ti[1]: AudioHWMgr: ERROR: Could not create Eureka interrupt handler
DEBUG dsp[0] #:00031 T:00000001|96de16e1 S:Got error from HWI_CREATE: code: 0 string:E_alreadyDefined: Hwi already defined: intr# %d!!!!!!!!!!!!!!!!!!
So it is telling me that this Hwi is already instantiated but I don't that is correct, since this is all brand new code and I am the only one calling Hwi_create on the DSP.  I've tried putting some different interrupt #'s into the call and got the same results.  It also seems strange that the error code I am getting is 0 - still looking for what that code means.
Another interesting side note was that originally I was using a NULL value for Error_Block since the eb is an optional value.  With this parameter, Hwi_create on the DSP would hang!  I could tell since I have a task constantly dumping out messages which suddenly stopped.  When I passed in an eb the hang went away but I end up with the error above.  If you have any ideas please let me know!
Thanks,
Bob