Quality RTOS & Embedded Software

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


Loading

Interrupt with avr32 port

Posted by Jesper Vestergaard on August 5, 2009
I'm using the avr32 port for ap7000 and have made a interrupt that turns a led on and off.
Here's the code:

void isr_test(void)
{
portENTER_SWITCHING_ISR1();

volatile struct avr32_pio_t *pioa = &AVR32_PIOA;
int status;

status = pioa->pdsr;
status = pioa->isr;

if(status & 0x00000400)
{

controlLED(1, LED_ON);
}
else
{
controlLED(1, LED_OFF);
}

portEXIT_SWITCHING_ISR1();
}


I activate interrupts with:

INTC_register_interrupt( &isr_test, AVR32_PIOA_IRQ, AVR32_INTC_INT1);
gpio_set(&AVR32_PIOA, 10, GPIO_INTERRUPT, GPIO_ON);
gpio_set(&AVR32_PIOA, 11, GPIO_INTERRUPT, GPIO_ON);


The interrupt works fine and the led turns on and off. But if I press the buttons repeatedly the I suddenly get and unrecoverable exception. I have even tried that the watchdog expires and the debuger quits. Here's the output from gdb after a unrecoverable exception:

0x00013400 in _handle_Unrecoverable_Exception ()
(gdb) bt
#0 0x00013400 in _handle_Unrecoverable_Exception ()
#1 0x48c10230 in ?? ()
(gdb) regs
pc: 00013400 lr: 48c10230 sp: 00000044 r12: c0623002
r11: 3003a122 r10: 0230cfe3 r9: 489f0000 r8: 24007ff0
r7: 00000008 r6: 48ed48f0 r5: e3b00001 r4: d553fece
r3: fffa48df r2: 48d048e1 r1: 0230c062 r0: 48d2a505

Is there something wrong with my interrupt function or is there something else that could be causing the problem?

RE: Interrupt with avr32 port

Posted by Jesper Vestergaard on August 10, 2009
Can someone please comment on my use of portENTER_SWITCHING_ISR. Is it correct to use the macro in an interrupt?


[ 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