_timer_start_oneshot_after kills my application

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

_timer_start_oneshot_after kills my application

ソリューションへジャンプ
2,649件の閲覧回数
MQXuser
Contributor III

I would like to know the reason the following code results in INTERRUPT STACK OVERFLOW.

 

The function is an Edge Triggered Interrupt and problem comes when I try to start a one shot timer.

Timer component is created before with priority 3 and 2000 stack. I have a periodic timer running and 4 interrupts (Edge Triggered Interrupts) can start another timer each. Therefore, I can have 5 timers running at the same time. Problem comes when trying to create the first timer within an interrupt.

 

static void CleanWiegandDoor1(_timer_id timer_id,pointer event_ptr,uint_32 seconds,uint_32 milliseconds){
     Door1Counter = 0;
}

void DMA_T0_ISR(pointer dummy_param){   if(!Door2Counter){
    _timer_start_oneshot_after( CleanWiegandDoor2, 0 , TIMER_KERNEL_TIME_MODE, 50 );   }   Door2Counter++;   if(Door2Counter >= WiegandBitQty){       Door2Counter = 0;      FifoInsertDataID(codeReadD2, 2); //Codigo y La Puerta      codeReadD2 = 0;   }   DTIM_clr_flag(0);   return;}

 

 Regards

 

0 件の賞賛
返信
1 解決策
996件の閲覧回数
EAI
Contributor IV

You can't start a timer from an ISR. The timer component uses a semaphore internally -  _time_start waits on the semaphore. You can't wait on a semaphore from an ISR, so therefore you can't call _timer_start from an ISR.

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
996件の閲覧回数
MQXuser
Contributor III

Okay, I will reorder my question.

 

How can I start a timer from an interrupt?

0 件の賞賛
返信
996件の閲覧回数
MQXuser
Contributor III
I am at the point where I need to solve this problem. How to start a timer from an interrupt?. Are there logical reasons that prevent my application to use the instruction mentioned into a ISR that I have created?
0 件の賞賛
返信
997件の閲覧回数
EAI
Contributor IV

You can't start a timer from an ISR. The timer component uses a semaphore internally -  _time_start waits on the semaphore. You can't wait on a semaphore from an ISR, so therefore you can't call _timer_start from an ISR.

 

 

0 件の賞賛
返信
996件の閲覧回数
MQXuser
Contributor III

I though I could call that function since it is not specifically mentioned in the list of

"3.10.3.2 Functions That ISRs Should Not Call "

 

Thank you,

0 件の賞賛
返信
996件の閲覧回数
EAI
Contributor IV

Yes, it should also be documented under traits, but is not. 

It has been reported to the development team.

 

Message Edited by EAI on 2009-10-09 11:58 PM
0 件の賞賛
返信