Soft Interrupt

hi,

  I want to use BF706 to generate a software interrupt;such as bwlow:

    ref:exception.h ->    int raise_interrupt(interrupt_kind _kind, int _which,int _cmd, int _arg1, int _arg2);

   code:

void Timer1Handler(void *pCBParam, uint32_t Event, void *pArg)
{
switch(Event)
{
case ADI_TMR_EVENT_DATA_INT:
printf("INT1 coming.\n",idx1++);
raise_interrupt(num_interrupt_kind,1,0,0,0);
break;
default:
break;
}
return;
}


void Set_Timer1(void)
{
if( (eTmrResult = adi_tmr_Open (0, Timer1Memory, ADI_TMR_MEMORY,
Timer1Handler, NULL, &hTimer1)) == ADI_TMR_SUCCESS){
eTmrResult = adi_tmr_SetMode(hTimer1, ADI_TMR_MODE_CONTINUOUS_PWMOUT);
eTmrResult = adi_tmr_SetIRQMode(hTimer1, ADI_TMR_IRQMODE_WIDTH_DELAY);
eTmrResult = adi_tmr_SetPeriod(hTimer1, 6000);
eTmrResult = adi_tmr_SetWidth(hTimer1, 100);
eTmrResult = adi_tmr_SetDelay(hTimer1, 100);
eTmrResult = adi_tmr_Enable(hTimer1, true);
}
}


void test_raise()
{
printf("raise ENTER .\n");
}

int main(int argc, char *argv[])
{

adi_initComponents();
Set_Timer1();
register_handler(num_interrupt_kind, test_raise);
while(1);

//return 0;
}

     it does not work!

      who can tell me how can i use the function raise_interrupt,Please.

Top Replies

  • 0
    •  Analog Employees 
    on Feb 28, 2020 12:46 PM

    Hi,

    From your code we noted that you are using register_handler() to install interrupt handler.Please note that, the register_handler() is not a valid function for registering interrupt handler for peripherals for( BF706) Processors with the SEC. The intent of the SEC is that all peripherals interrupts can have individual priorities and when an interrupt occurs the Source ID is returned along with the IVG11 interrupt, allowing for faster identification of interrupt sources.

    You may have to use adi_int_InstallHandler API can to install an interrupt handler for a given processor interrupt. It is a valid API for system interrupts, core interrupts, NMI, and hardware exceptions.

    The System Event Controller chapter in the ADSP-BF70x HRM contains all the SEC documentation, and similar information is in the CCES Help Contents. You may look through the adi_sec.c and adi_sec.h to learn more about the API sources, but with CCES, we highly recommend using the APIs for the SEC.

    For more details please refer "Servicing System Interrupts " section in below linked manual:
    www.analog.com/.../ADSP-BF70x_Blackfin_Programming_Reference.pdf

    You can also refer "Peripheral Interrupt Request Events" section in the hardware reference manual below:
    www.analog.com/.../BF70x_BlackfinProcessorHardwareReference.pdf

    Also, you can refer the below CCES help for more information about the above API.
    Help > Contents > System Run-Time Documentation > Interrupt Support > Interrupt Handler Header File and Functions

    Regards,
    Santha kumari.K