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.

Generate a Host Interrupt

Hi

 

I use DM6437 EVM.and I want to generate a Interrupt to Host via PCI.

I already enable PCI_HINTSET register by host like this:

data = 0x08000000;
PCI64_RegWrite32(MyPci,PCI_HINTSET,1,&data);

then I load the coff file.

-----------------------------------------------------------------------------------------------------

and I wrote a simple DSP code like this:

#define TRIGGER_DSPINT_MASK            (0x08000000u)

void main( void )
{
    // Write magic number so pci_host.out can check to see if the code ran
    EVMDM6437_init( );
    while(1){               
        _waitusec(1000000);   
        generateHostInterrupt();
    }
}

void generateHostInterrupt()
{
    Uint32 interruptStatus = 0;

    interruptStatus = PCI_STATSET;
    interruptStatus = interruptStatus | TRIGGER_DSPINT_MASK;
    PCI_STATSET = interruptStatus;
}

----------------------------------------------------------------------------------------------------------------

But it did't work.

Did I do something wrong??

  • What is the host here? When you say it doesn't work, do you mean you don't see a pulse on the Oscope?

  • Paul.Yin said:

    What is the host here?

    sorry i didn't metion that.The host is PCI.

    Paul.Yin said:

    When you say it doesn't work, do you mean you don't see a pulse on the Oscope?

    I think ,when I enable the SOFT_INTn of the PCISTATSET register by DSP,It will generate a interrupt to host.

    Then the interrupt callback function works.but it didn't.

     

     

     

  • Dennis,

    The host is the PCI of what device? How are you connecting to our device?

    You need to probe the PCI interrupt pin and make sure you can capture the physical interrupt signal after setting SOFT_INTn bit first.

    If you see the signal, then you can go to your host and make sure you are able to detect that interrupt signal.

    Then, go check whether ISR is registered properly.

  • Paul.Yin said:

    Dennis,

    The host is the PCI of what device? How are you connecting to our device?

    Paul,

    I don't understand what you mean.

    But I can tell you:

    I'm using the TMS320DM6437 DVDP evaluation board and I'm trying to make that the DSP generates a PCI interrupt for the host.

     

     

  • Oh OK.

    You are connecting the DM6437 board to a PCI backplane? and I believe your host is the PC.

    Regardless, you can start by making sure you see a interrupt signal coming out of DM6437, then make sure this signal gets detected by the host.

  • Paul,

    thanks for your replying.

    As you say,my setting method above is ok.(I mean enable SOFT_INTn of PCIHINTSET register by Host,and enable SOFT_INTn of PCISTATSET register by DSP).

    Or what did I miss??Do I need to notice something??

  • Your method is correct.

    I would suggest 2 things:

    1. Before DSP writes to PCISTATSET register, clear any older interrupts by writing to PCISTATCLR .

    2. As Paul suggests, please probe the interrupt line on the EVM.

    Hope this helps.

     

  • Hi Guys:

    Now I can see the physical interrupt signal,but the interrupt callback function still doesn't work.

    I use the Windows PCI host driver from http://c6000.spectrumdigital.com/evmdm6437/reve/files/evmdm6437_v2.zip,and it also include some API  as follow.

    PCI64_GetCallbackEvent() for get the handle used for callback events.

    PCI64_SetupCallbackEvent() for setup a callback function to respond to PCI interrupts.

     

    callback function of type is

    DWORD WINAPI Callback(LPVOID dummy)

    ------------------------------------------------------------------------------------------------------------------------------------------------

    my callback function as follow:

    DWORD WINAPI Callback(LPVOID dummy)
    {   
        if( hCallbackEvent == NULL )
            return(-1);
       
        while(1)
        {           
            if(WaitForSingleObject(hCallbackEvent, INFINITE))//
                printf
                (
                    "\nWaiting for interrupt on Event 0x%x\n",
                    hCallbackEvent
                );       
            else
                printf("\nInterrupt # %d has been generated\n", ++gIntsSeen);
        }
       
        return 0;
    }

    --------------------------------------------------------------------------------------------------------------------------------------------

    What did I miss?? or What did I suppose to do ??

     

    thank you!!

     

     

  • Paul.Yin said:

    If you see the signal, then you can go to your host and make sure you are able to detect that interrupt signal.

    Then, go check whether ISR is registered properly.

    Hi Paul:

     

    I can see the signal but the host (PC)  still doesn't work.

    I use the API and the interrupt callback doesn't work.

    Do you have any suggestion??

     

    thank you.

  • If you are able to see the signal, that shows our device PCI is programmed correctly. You need to do some research and figure out which register in your PC is used to reflect the status of this incoming interrupt, and you need to make sure that bit is set when this interrupt is coming.

    If that bit is set and the PC host doesn't do anything, I will not be able help anymore. Maybe try the forum of that PC OS forum (Linux, I assume?)

  • Paul:.

    My OS is Windows and I'll find the answer.

    thanks a lot..