AnsweredAssumed Answered

STR91x + Keil = living hell

Question asked by prosinger.istvan on Jan 3, 2013
Latest reply on Jan 21, 2013 by prosinger.istvan

I use the Keil startup wizard to configure the processor initially, then I use the ST91x software library to configure the GPIO port 7, VIC and TIM3 to blink 0xAA on Port7 in the TIM3 ISR, but I'm stucked there forever (so is my program).
I bought the this Keil's MCBSTR9 to advance to ARM architecture over a year ago, and I'm an advanced TI MSP prorgrammer - this shouldn't be happening.... :( What am I missing here? I keep stucking in every interrupt....

---

#include <91x_lib.h>

unsigned short int gout = 0xAA;

int main()
{
 #ifdef DEBUG
 debug();
 #endif
 
 GPIO_InitTypeDef GPIO_InitStruct;
 TIM_InitTypeDef TIM_InitStructure;
 
 GPIO_DeInit(GPIO7);
  GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput;
  GPIO_InitStruct.GPIO_Pin = GPIO_Pin_All;
  GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull ;
 GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt1;
  GPIO_Init (GPIO7, &GPIO_InitStruct);
 
  TIM_DeInit(TIM3);  /* TIM1 Deinitialization */
  TIM_InitStructure.TIM_Mode = TIM_OCM_CHANNEL_2;                          
  TIM_InitStructure.TIM_OC2_Modes = TIM_TIMING;              
  TIM_InitStructure.TIM_Clock_Source = TIM_CLK_APB;        
  TIM_InitStructure.TIM_Clock_Edge = TIM_CLK_EDGE_FALLING; 
  TIM_InitStructure.TIM_Prescaler = 0xFF;                 
  TIM_InitStructure.TIM_Pulse_Length_1 = 0x100;         
 
 TIM_Init (TIM3, &TIM_InitStructure);
 TIM_ITConfig(TIM3, TIM_IT_OC2, ENABLE);
 TIM_CounterCmd(TIM3, TIM_CLEAR);
 TIM_CounterCmd(TIM3, TIM_START);

 

 VIC_ITCmd(TIM3_ITLine, ENABLE);
 VIC_Config(TIM3_ITLine, VIC_IRQ,7);

 while(1);
}

__irq void TIM3_IRQHandler(void)
{
  TIM_ClearFlag(TIM3, TIM_FLAG_OC1);
  TIM_CounterCmd(TIM3, TIM_CLEAR);
  TIM_CounterCmd(TIM3, TIM_STOP);
  gout ^=0xAA;
  GPIO_Write(GPIO7, gout);
 VIC0->VAR =0;
 VIC1->VAR =0;

}

 ---

  I even stopped the timer to se if it's causing the issue, but it's not...

Outcomes