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.

TimerIntClear faultISR

I'm using LM4F120H5QR  launchpad. I'm using three timers in following configurations

       SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);
       SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);
       SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
       
       TimerConfigure(TIMER2_BASE,TIMER_CFG_32_BIT_PER);
       int cycle=4*16000000;
       TimerLoadSet(TIMER2_BASE,TIMER_A,cycle);
       TimerIntClear(TIMER2_BASE, TIMER_TIMA_TIMEOUT);

       
       TimerConfigure(TIMER1_BASE, (TIMER_CFG_16_BIT_PAIR+TIMER_CFG_A_PERIODIC));
       TimerLoadSet(TIMER1_BASE,TIMER_A,0x0640);
       TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
       
       TimerConfigure(TIMER0_BASE,TIMER_CFG_32_BIT_PER);
       TimerLoadSet(TIMER0_BASE,TIMER_A,0xA2C2A);
       TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
       IntMasterEnable();
      // TimerIntEnable(TIMER0_BASE,TIMER_TIMA_TIMEOUT);
       TimerIntEnable(TIMER2_BASE,TIMER_TIMA_TIMEOUT);
       TimerIntEnable(TIMER1_BASE,TIMER_TIMA_TIMEOUT);
    //   IntEnable(INT_TIMER0A);
       IntEnable(INT_TIMER1A);
       IntEnable(INT_TIMER2A);
     //  TimerEnable(TIMER0_BASE,TIMER_A);
       TimerEnable(TIMER2_BASE,TIMER_A);
       TimerEnable(TIMER1_BASE,TIMER_A);

 TimerIntEnable(TIMER0_BASE,TIMER_TIMA_TIMEOUT);
TimerIntEnable(TIMER2_BASE,TIMER_TIMA_TIMEOUT);
TimerIntEnable(TIMER1_BASE,TIMER_TIMA_TIMEOUT);
// IntEnable(INT_TIMER0A);
IntEnable(INT_TIMER1A);
IntEnable(INT_TIMER2A);
// TimerEnable(TIMER0_BASE,TIMER_A);
TimerEnable(TIMER2_BASE,TIMER_A);
TimerEnable(TIMER1_BASE,TIMER_A);

However when the control reaches the ISR of Timer1A, control moves to the Fault ISR after executing TimerIntClear instruction.

Can someone tell me why is the fault occurring?

  • Hi,

     

    Anuja Sathe said:
    TimerConfigure(TIMER2_BASE,TIMER_CFG_32_BIT_PER);

    Anuja Sathe said:
    TimerConfigure(TIMER1_BASE, (TIMER_CFG_16_BIT_PAIR+TIMER_CFG_A_PERIODIC));

     

         Both, TIMER_CFG_32_BIT_PER and TIMER_CFG_16_BIT_PAIR defines are mentioned as deprecated at timer.h. It is possible that these parameter settings is the cause of that FaultISR. Refer, to the Peripheral Drivers Library User Guide for appropriate TimerConfigure() parameters.

    -kel

  • I have changed the TimerConfigure() as per the Peripheral Drivers Library. However, the code now enters the Fault ISR from a function which is called in the ISR (update()). Another message that I get is: "no source available for 0xFFFFFFE0". The value held by the LR is 0xFFFFFFE1. Exception number 11 is raised in this case. What does this Fault mean ? 

  • Hi,

       I will get back to you after this weekend. Post, the rest of your code so others can review it. Try to diagnose that faultisr using the document from the link below.

       http://www.ti.com/lit/an/spma043/spma043.pdf

    -kel

  • I have found that the cause for the fault (from Debugger) is a Bus fault. However the cause for bus fault keeps varying with different executions of the programs. Some of the causes were : Instruction Bus fault, Precise Data bus error,Bus fault address register valid. Bus fault address is :0xE000EDF8 (mapped to the Private Peripheral Bus address space- Cortex-M4F Peripherals (SysTick, NVIC,MPU, FPU and SCB)) or to the reserved address space. Further there is no register mapped to the 0xDF8 offset in the 0xE000E address space, therefore I'm unable to figure out a cause for this fault.

  • Can you post your code so we can see the ISR or even run it? Preferably a complete app, but without anything not related to the timer problem.

  • Hi,

    The register at 0xE000EDF8 is named NVIC_DBG_DATA and is to be found in hw_nvic.h file. It would be interesting to go to that register and see its content.

    Also, the "precise" error fault can be a good indication: did  you placed the right timer interrupt vector in startup_xxx.c file? did you enabled global interrupts?

    Petrei