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.

Mapping SRIO doorbell interrupt to a HWI

Other Parts Discussed in Thread: SYSBIOS

hello guys,

I am using a evm6474 which contain 2 C64x+ DSPs.

i am trying to create a hwi where i'll put an ISR that execute after receiving a SRIO doorbell interrupt from the other DSP (using SYS/BIOS 6.3).

after doing some research, i found that i can bind the hwi to the peripheral eventID called GEM event with the function HWI_eventMap (hwiNumber, eventID). But i can't find the corresponding eventID for SRIO doorbell interrupt.

what is the document containing the corresponding GEM event numbers for each peripheral ?

and if possible provide me with a hwi example program cuz i can't find any.

thanks in advance.

 

  • Mohammed,

    Please refer the section 7.6.1 of the document to get the interrupt events for peripheral in C6474.

    Thanks and Regards,

    Sandeep K

  • thanks  for your help,

    i have now another problem and i thought it would be better to put it on the same post.

    i successfully binded the SRIO doorbell interrupt (event number 72) to a HWI (number 4) and the ISR executed successfully.

    i implemented a loop in the program which sends 10 doorbells with a nearly 1 second of delay between every one of them, but the ISR execute only once with the first doorbell. I concluded that the interrupt isn't properly cleared so i used Hwi_clearInterrupt(4) but that doesn't change anything (i put a breakpoint and watched the content of the doorbell interrupt clear register and it does not change).

    After that i forced manually the clear register so i got:

    after that i sended a new doorbell from the source and actually it change the status register:

    but even with the interrupt arriving, the ISR does not execute.

    so to sum up my problem:

    1) why the Hwi_clearInterrupt(4) does not clear the interrupt ?

    2) why after clearing manually the interrupt, the ISR does not execute with a new interrupt arriving ?

    oh! i forgot to mention that i have the masksetting parameter set to "MaskingOption_NONE" so i think there's no mask that prevent the ISR from running.

    regards.

  • Mohammed,

    How are you registering the ISR?

    Could you please share the ISR?

    Thanks and Regards,

    Sandeep K

  • sorry Sandeep for the late response,

    i don't understand well your question, but i used the following code to create the HWI:

    var ti_sysbios_family_c64p_Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');

    var instti_sysbios_family_c64p_Hwi0Params0 = new ti_sysbios_family_c64p_Hwi.Params();
    instti_sysbios_family_c64p_Hwi0Params0.maskSetting = xdc.module("ti.sysbios.interfaces.IHwi").MaskingOption_NONE;
    instti_sysbios_family_c64p_Hwi0Params0.eventId = 72; 
    Program.global.srioHwi = ti_sysbios_family_c64p_Hwi.create(4, "&SRIO_InterruptHandler", instti_sysbios_family_c64p_Hwi0Params0);


    "SRIO_InterruptHandler" highlighted in red above is the ISR. here's it's code:

    void SRIO_InterruptHandler ()
    {
        Cnt++;   
        Hwi_clearInterrupt(4);
    }

    after execution of the program, the global variable Cnt remains at 1 (knowing that i send 10 interrupts and Cnt is initialized at 0).

    A suspection of what's happening is the necessity of clearing some of the core's registers.

    Let me know if that's not your request.

    regards.

     

     

  • Mohammed,

    It is a good practice to initialize the Hwi_params once you create it, by using Hwi_Params_init(). [Refer SYS/BIOS documents]

    Once you initialize it, along with your configuration, it is better to configure the hwi_param as follows:

    instti_sysbios_family_c64p_Hwi0Params0.enableInt = true;
    instti_sysbios_family_c64p_Hwi0Params0..priority = 0;

    Inside the SRIO ISR "SRIO_InterruptHandler()", you need to do peripheral specific acknowledgement for every interrupt by clearing the status register (please refer the peripheral specific manual).

    With these modifcation, please let me know the result.

    Thanks and Regards,

    Sandeep K

  • Sandeep,

    i managed to get my program working with the following modifications:

    1) now i clear the interrupt manually (i write directly to the clear register) since Hwi_clearInterrupt() does not work for me

    2) i had to write after every interrupt to the INDST_RATE_CNTL register even if it contains already the same value.

    after these changes my ISR looks like the following:

    void SRIO_InterruptHandler ()
    {
        Cnt++;   
            // clear doorbell interrupt
        *((volatile unsigned int*)DOORBELL_CLEAR_addr) = 0x00000001;   

           // Program Rate control register
        *((volatile unsigned int*)INTDST_RATE_addr) = 0x0;
       
    }

    thanks Sandeep and i hope this post helps other people.