Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

AT91SAM7S and RTT interrupt

Posted 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 interrupt

Posted by Denis H on December 11, 2009
anyone :(

RE: AT91SAM7S and RTT interrupt

Posted 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.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner