denish0 wrote on Thursday, December 10, 2009:
Hi,
I want to use the Real time Unit as 1s time interrupt and I have some problems with that.
I know that RTT and PIT (for tick generating) are sharing the same interrupt vector in AIC(System Controler), FreeRTOS uses the PIT interrupt. I modified port.c file, where is the ISR function of System Controler is:
static __arm __irq void vPortNonPreemptiveTick( void );
static __arm __irq void vPortNonPreemptiveTick( void )
{
unsigned portLONG ulDummy;
unsigned int isr_pit;
unsigned int isr_rtt;
isr_pit=AT91C_BASE_PITC->PITC_PISR;
if (isr_pit & AT91C_PITC_PITS)
{
/* Increment the tick count - which may wake some tasks but as the
preemptive scheduler is not being used any woken task is not given
processor time no matter what its priority. */
vTaskIncrementTick();
/* Clear the PIT interrupt. */
ulDummy = AT91C_BASE_PITC->PITC_PIVR;
AT91C_BASE_AIC->AIC_EOICR = ulDummy;
}
else
{
isr_rtt=AT91C_BASE_RTTC->RTTC_RTSR;
if (isr_rtt & AT91C_RTTC_RTTINC)
{
ulDummy=AT91C_BASE_RTTC->RTTC_RTVR;
//vRTTCISREntry();
rttc_isr();
}
}
/* End the interrupt in the AIC. */
//AT91C_BASE_AIC->AIC_EOICR = ulDummy;
}
Whit this code rttc_isr() must executing on every 1s. (RTTC_MR=0x8000), but not, As soom as i start running the code undefined instrunction execption hapens, and R14(LR) shows that undefined instruction executed from rttc_isr(), I also try whit context save and restore before, and after that function
-Here are my questions:
1. Is the any conseptions to use system controler interupts like DBGU,WDT, …. from FreeRTOS.
2. Where i do wrong whit this code.
thx guys.
Best regards.