Quality RTOS & Embedded Software

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


Loading

xQueueSendToBackFromISR

Posted by Raphael Derosso Pereira on July 31, 2008
Hello,

I'm trying to use this function inside my UART IRQ handler in my ARM7 GNUARM project, but it is producing Data Abort Exception. I raised the IRQ stack to 2048 bytes and verified the pointers using a debugger. All seems to be fine. I really can't find the problem, as it doesn't occur when stepping through the debugger.
The code used is below:

extern volatile struct uart_info **uarts_available;

void uart_0_interrupt_handler(void)
{
unsigned char c;
unsigned int status;
portBASE_TYPE task_woken = 0;

status = U0IIR;

/* Check interrupt source */
switch (status & UART_INT_ID)
{
/* Status received */
case UART_INT_RLS:
/* Not enabled */
break;

/* Data available */
case UART_INT_RLA:

status = U0LSR;
while (status & UART_LSR_RDR)
{
c = U0RBR;
if (!(status & UART_LSR_RXFE))
xQueueSendToBackFromISR(uarts_available[0]->rx_queue, &c, &task_woken);

status = U0LSR;
}
break;

case UART_INT_CTI:
/* Not enabled */
break;

case UART_INT_THRE:
/* Not enabled */
break;
}

VICVectAddr = 0;
if (task_woken)
taskYIELD();
}

RE: xQueueSendToBackFromISR

Posted by Dave on July 31, 2008
Check the UART demo that comes with the port to see how to call yield from within an interrupt. I don't think it is likely that you can simply call taskYIELD(). Which ARM7 port are you using?

Have you followed the example given on the documentation page for your port with regard to how to write an interrupt?

RE: xQueueSendToBackFromISR

Posted by Ricky on July 31, 2008
Perhaps you have an interrupt interrupting your interrupt. When you're in the debugger, interrupts are inhibited so you won't see the data abort happen.

Also, taskYIELD isn't the proper macro to be using in an interrupt. You should do something like this:

portEND_SWITCHING_ISR (task_woken);

RE: xQueueSendToBackFromISR

Posted by Raphael Derosso Pereira on August 1, 2008
Thank you all. I was really doing the thing in the wrong way! Now everything is working fine!

Regards,


[ 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