/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / ??IRQ Priority..

Username:     
Password:     
             

Forum

# 1   2009-06-19 21:59:50 ??IRQ Priority..

repzak
Member
Registered: 2008-03-05
Posts: 170

??IRQ Priority..

Hello,

I have a problem in my application i can't se the logic in sad

When i enter my application i setup a timer with lowest priority (3,3), and change the systick to a higher because i want it to interupt my timer interupt...
(when i exit my application i set the same priority as the circle os)

if i set the systick priority to (1,1) then everythings work the first time i enter my application, the systick interupts my timer smile, but if i exit the application and start it again it seems the timer and systick both has priority (3,3) since systick does not interupt my timer anymore.

If i change the priority of systick to (2,2) it is reversed, not working first time, but second time i go to the application it is ok and after that.

Here is my code in the INI function:

Code:

    /* Saves the old TIM4 irw handler */
    old_tim4_irq = (tHandler)UTIL_GetIrqHandler  ( 184   );
    /* Sets the new TIM4 irw handler */
    UTIL_SetIrqHandler  ( 184, (tHandler)TIM4_irq);

    /* Change the systemhandler priority to higher, so TIM4 can get a lower Priority */
    NVIC_SystemHandlerPriorityConfig( SystemHandler_SysTick, 2, 2 );
  
    /* Enable TIM Clock */
    RCC_APB1PeriphClockCmd( RCC_APB1Periph_TIM4, ENABLE );  

    /* TIM4 configuration */
    TIM_TimeBaseStructure.TIM_Period          = 1;
    TIM_TimeBaseStructure.TIM_Prescaler       = 0x0;
    TIM_TimeBaseStructure.TIM_ClockDivision   = 0x0;
    TIM_TimeBaseStructure.TIM_CounterMode     = TIM_CounterMode_Up;
    TIM_TimeBaseInit( TIM4, &TIM_TimeBaseStructure );
    /* TIM4 enable counter */
    TIM_Cmd( TIM4, ENABLE );

    /* Clear TIM4 update pending flag */
    TIM_ClearFlag( TIM4, TIM_FLAG_Update );

    /* Enable the TIM4 Interrupt */
    NVIC_InitStructure.NVIC_IRQChannel                    = TIM4_IRQChannel;
    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority  = 3; 
    NVIC_InitStructure.NVIC_IRQChannelSubPriority         = 3;
    NVIC_InitStructure.NVIC_IRQChannelCmd                 = ENABLE;
    NVIC_Init( &NVIC_InitStructure );

and for exit:

Code:

            TIM_ITConfig( TIM4, TIM_IT_Update, DISABLE );
            RCC_APB1PeriphClockCmd( RCC_APB1Periph_TIM4, DISABLE );          
            UTIL_SetPll (Old_Pll);
            NVIC_SystemHandlerPriorityConfig( SystemHandler_SysTick, 3, 3 );

I hope someone can help me

Kasper

Offline

 

# 2   2009-06-21 18:10:42 ??IRQ Priority..

repzak
Member
Registered: 2008-03-05
Posts: 170

Re: ??IRQ Priority..

Hello,

Problem solved...

Did not see the priority group was changes in the FS.C, so after first run the priority group is changed when i start the application again...

I think it must be solved to only use on priority group in circle os later on...

Kasper

Offline

 

# 3   2009-06-23 10:15:53 ??IRQ Priority..

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: ??IRQ Priority..

IRQ setting should be cleaned up. But after the contest...

Offline

 

Board footer