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

SAM7 driver interrupts

Posted by Dustin Stahlback on September 8, 2008
I am using the following:

Current freeRTOS (5.0.3)
GCC 4.2.1
Followed the Rowling/GCC AT91SAM7X demo

I currently create all interrupt code in ARM - naked and wrap the calls with portSAVE_CONTEXT and portRESTORE_CONTEXT. The SAM7 has an AIC and my dilema I only wish to disable/mask certain parts of an interrupt. The example being is that I have a uartISR and a spiISR. When I am dealing with something critical with the UART, I would only like to to mask the UART ISR, not the FIQ and nIQ which in turn disables all interrupts. When I need to disable IRQ's, I am under the impression that I must only use ENTER_CRITICAL and EXIT_CRITICAL in my code and not try and mask individual interrupt flags (my code breaks if I try this). Am I doing this incorrectly or is that how the demo was created. Does anyone have any idea or can point out other forum postings that deal with this?

Thanks,

Dustin

RE: SAM7 driver interrupts

Posted by Dave on September 9, 2008
One of the problems with the ARM7 is that each has a different interrupt controller so there is no single generic solution (the Cortex ports don't have this problem).

Take a look at http://www.freertos.org/a00110.html#kernel_priority . You can basically copy this scheme by selecting which interrupts to disable and enable. If your ISR never calls an API function then you need never disable its interrupt as far as I know.

One easy thing you can do is change portENTER_CRITICAL() and portEXIT_CRITICAL() so they disable IRQ only and leave FIQ enabled. This is very common.

RE: SAM7 driver interrupts

Posted by Dustin Stahlback on September 9, 2008
If none of my ISRs have to interact with the RTOS, do I even need make them naked? My ISRs basically handle peripheral functions (UART, SPI). I try to disable interrupts so I can modify/check pointers and then re-enable.

RE: SAM7 driver interrupts

Posted by David Farrell on September 9, 2008
Most of what your describing is handled entirely by interrupt priorities or the masking of the AIC. Also note that the RTOS is a lower priority than your ISRs, the only thing you should have to save is the registers used, interrupt type, I don't know about naked. Search this forum there are recent threads about the kernel priority. In the recent threads I think Richard comments about empty and fill pointers, done right you may not need to disable interrupts at all to modify them.


[ 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