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.

Timer Interrupt does not occur



Hello. I took timer project example as reference and wanted to integrate a portion into my project that uses RTOS environment. Now my main file look like this:

void main()
{
	// Board Initialization
	BoardInit();

	// Configure the pinmux settings for the peripherals exercised
	PinMuxConfig();

	// Setup the Leds
	GPIO_IF_LedConfigure(LED1|LED2|LED3);
        GPIO_IF_LedOff(MCU_ALL_LED_IND);

    Timer_IF_Init(PRCM_TIMERA0, g_ulBase, TIMER_CFG_PERIODIC, TIMER_A, 0);
    Timer_IF_IntSetup(g_ulBase, TIMER_A, TimerBaseIntHandler);
    Timer_IF_Start(g_ulBase, TIMER_A, 2000);

	while ( !g_bChoise )
	{
		// Loop here until the ISR occurs
	}
    
    //other code...


}

and the timer interrupt handler is this

void TimerBaseIntHandler(void)
{
    // Clear the timer interrupt.
    Timer_IF_InterruptClear(g_ulBase);

    g_bChoise = TRUE;

    GPIO_IF_LedToggle(MCU_GREEN_LED_GPIO);
}

As you can see i haven't changed anything from the timer example program. My program is simply waiting for the interrupt to occur in main function, and when it does occur it will go beyond that loop. But the problem is the interrupt does not occur. If i go to the other example project it runs just fine, so i suspect that the only possible cause is something with me using OS environment. When i run the program i see the HWI instance of the timer ISR generated in ROV and it says "dispatched", but i also saw it once saying "enabled, pending". But obviously it never triggers. I can't figure out what to do to overcome this issue. Any help will be very appreciated. Thanks in advance.

  • Now i have this code after the osi_start function and now it works. Too bad, because what i was trying to do is choose the tasks i want to create prior to starting the scheduler (and the tasks). When tasks are in the inactive state consume any memory, or bother the CPU at all?

    So my question is if i can enable some interrupts to occur prior to launching the tasks and the osi_Start. Maybe if i initialize the interrupt vector table?

    Thanks,
    Nick.

  • I found an indirect solution to my problem. The thing is though that no tasks or interrupts can be triggered before we start the scheduler/SYS/BIOS kernel. Also all interrupts and tasks must be registered and enabled prior to calling osi_start(); / BIOS_start(); One more thing is that the function that once osi_start(); / BIOS_start(); has been called only interrupts and tasks will do the work from then onwards. The function that calls osi_start(); / BIOS_start(); (usually main() )should call all these in the end. Maybe this will help someone.
    Nick