AnsweredAssumed Answered

UCOS-III Eventflaggroup vs task vs ISR

Question asked by Raghupathi_Kokkarakonda on May 6, 2016

Hi,

I am using the blackfin 537 DSP processor, I want to use the event flag to indicate that a hardware interrupt is triggered to a task.

I am using the OS ucos-III. The question is, can event flag post is called in the hardware ISR() routine.

 

I gave a a try to create a task which will pend for the event flag and flag will be posted in harware ISR thats SPORT ISR(), it is plain ISR()

code follow goes as :

The event flag group and task will be get created the main(), In task is created, event is pend, and the interrupt will be enabled and execution control reaches the ISR and post the event flag, the pend task is placed in the ready queue. But the task is not getting the CPU execution control.

By the way there are two ISR routines for SPORT TX and RX. The execution control is in any of the one ISR, whenever I paused the debugging. Please let me know solution for this. Thanks a lot well in advance.

 

EX_INTERRUPT_HANDLER(SPORT1_DMA_RX_ISR)

{

  OS_ERR  err;

  while(!(*pDMA5_IRQ_STATUS & DMA_DONE));

  *pDMA5_IRQ_STATUS &= ~DMA_DONE ;

  ssync();

 

  OSFlagPost(&MyEventFlagGrp,

  FPGA_DATA_RECEIVED,

            (OS_OPT)OS_OPT_POST_FLAG_SET | OS_OPT_POST_NO_SCHED,

            &err);

  //OSIntExit();

}

void sc_performScheduler(void *p_arg)

{

OS_ERR  err;

  CPU_TS  ts;

  while(1)

  {

  MyEventFlagGrp.Flags &= ~FPGA_DATA_RECEIVED;

  OSFlagPend(&MyEventFlagGrp,

  FPGA_DATA_RECEIVED,

  (OS_TICK )0,

  (OS_OPT)(OS_OPT_PEND_FLAG_SET_ANY),// + OS_OPT_PEND_FLAG_CONSUME + OS_OPT_PEND_BLOCKING),

  &ts,

  &err);

  if(err == OS_ERR_NONE)

  {

  /*Call a function*/

  }

  }

}

Attachments

Outcomes