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.

Hwi ISR can only be entered once

Other Parts Discussed in Thread: SYSBIOS

Hi all,

   I have encountered a strange thing that My hwi ISR can only be entered once.

My code is below, when first intrrupt occured, I can get the correct result. But after

that, that ISR can never be entered again even after I do CPU reset and run again.

The bios I use here is bios_6_31_00_18 and the platform I run is C6678.

With the help of debugger, I can see that the MSI0_IRQ_SET registers can not be cleared

by the function Hwi_clearInterrupt. So what's wrong with my code?

 

#include <ti/sysbios/family/c66/Cache.h>

#include <ti/sysbios/BIOS.h>

#include <xdc/runtime/Error.h>

#include <ti/sysbios/hal/Hwi.h>

 

volatile dataval = 0;

static void My_ISR (int arg)

{

    dataval = 1;

    Hwi_clearInterrupt(4);

}

void main(void)

{

   Hwi_Handle hwi0;

   Hwi_Params hwiParams;

   Error_Block eb;

   Error_init(&eb);

   Hwi_Params_init(&hwiParams);

   hwiParams.arg = 17;

   hwiParams.eventId = 17;

   hwi0 = Hwi_create(4, MY_ISR, &hwiParams, &eb);

   if(hwi0 == NULL)

      System_abort("Hwi create error");

   /* Call BIOS_start() */

   BIOS_start(); }

B.R.

Sunzhao

  • Sunzhao,

    You should not be calling Hwi_clearInterrupt(4).  When you get into your ISR, the hardware should have already cleared your interrupt for you.
    If you call Hwi_clearInterrrupt(4).  You will lose an interrupt for Hwi 4 that may have occured while you were in your ISR.

    Judah