FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [December 2009 Threads] AT91SAM7S and RTT interruptPosted by Denis H on 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.
RE: AT91SAM7S and RTT interruptPosted by Denis H on December 11, 2009 anyone :(
RE: AT91SAM7S and RTT interruptPosted by incrediball on December 22, 2009 I don't have an answer for your question but why do you want to use the RTT anyway? I have never understood the sense of this peripheral: it generates an inaccurate 1 second tick, so how is that useful?
Why not just use the tick hook routine and a counter, i.e. if you use a 1ms tick then count to 1000, then execute your code and reset the counter.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|