Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

PIT interrupt on SAM7

Posted by Nobody/Anonymous on December 22, 2006
I have been playing with the RTOS for a while using the AT91SAM7X256 and the atmel evaluation kit. However I got stuck and I hope you can give me a little help.

The problem is as follows:

The PIT is used for the vPortPreemptiveTick and the vPortNonPreemptiveTick functions. This Interruption is not only for the PIT but also for a couple of others peripherals (all using Interrupt source 1). What I want to do is to distinguish when is a PIT interrupt and when not. I think the modification should be in portasm.s79. In the entry point of the function vPortNonPreemptiveTick() we should ask what cause the interruption and then if wasn’t the PIT I call “do_something_is_noPIT()”. I try that with this following lines:

.

.

……

vPortPreemptiveTick:



LDR R0, =auxiliar ; Atiende las interrupciones para el caso de que la interrupción sea diferente a la del PIT

mov lr, pc ; de ser diferente a la del PIT, subo una variable global y evito que se ejecuten las siguientes funciones

BX R0



portSAVE_CONTEXT ; Save the context of the current task.



LDR R0, =vTaskIncrementTick ; Increment the tick count - this may wake a task.

…..



auxiliar() is a function defined in port.c and will distinguish if it was PIT or other kind of interruption.

However it didn’t work! I try a couple of others things and neither they work.

I don’t know what else to try.

Thank you Very Much.

(Sorry for my English, I’m not a native English Speaker, I don’t even live in the US).


RE: PIT interrupt on SAM7

Posted by Richard on December 22, 2006
Not sure I follow the code exactly but it looks like you might be altering the registers BEFORE saving the context. The context must be saved before you look for the interrupt source, otherwise you will clobber the task state. It might be easier to do this from C code - so you have one interrupt entry point.

Take a look at the following threads on the same subject:

http://sourceforge.net/forum/message.php?msg_id=3786127
http://sourceforge.net/forum/message.php?msg_id=3828288
http://sourceforge.net/forum/message.php?msg_id=3339560
http://sourceforge.net/forum/message.php?msg_id=3318887

Regards.

RE: PIT interrupt on SAM7

Posted by Nobody/Anonymous on January 9, 2007
I want and really would like to use C code. But I think IAR compiler does requires the tick to use an asm wrapper, so any changes should be made in the portasm.s79, Am I right?
Thank you,
Juan Baez

RE: PIT interrupt on SAM7

Posted by Nobody/Anonymous on January 9, 2007
I think the asm can remain the same. You need to look at prvSetupTimerInterrupt in port.c.


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists