Quality RTOS & Embedded Software

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


Loading

portEND_SWITCHING_ISR delay

Posted by Jerry Durand on August 25, 2012
V7.2.0, LPC1754 using LPCXpresso

I'm building an application that currently has 4 tasks running
idle with hook, priority 0
two tasks with vTaskDelay in them, priority 1
Communications task with xSemaphoreTake in it, priority 4

In an interrupt at the end of a DMA I execute
xSemaphoreGiveFromISR(DMA_Done, &xHigherPriorityTaskWoken);
set bit on a port
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);

the communications task clears the bit as soon as it gets the semaphore

What I'm seeing is the communications task doesn't run until about the next tick (I haven't checked precisely, but it looks to be right after a tick). I've traced through and xHigherPriorityTaskWoken is true, but when I step out of the interrupt I'm back in the Idle task.


RE: portEND_SWITCHING_ISR delay

Posted by Jerry Durand on August 25, 2012
I forgot, the Idle Hook has a _WFI() in it, if that matters.

RE: portEND_SWITCHING_ISR delay

Posted by Jerry Durand on August 25, 2012
More testing, it seems the semaphore is working fine, but for some reason the timer that triggers the DMA isn't firing at the right time. So, semaphore looks ok, something up with timer/DMA interaction. ???

RE: portEND_SWITCHING_ISR delay

Posted by Richard on August 25, 2012
“something up with timer/DMA interaction”


That would be LPC17xx specific, rather than FreeRTOS specific, so I couldn't comment directly. I would be surprised if there were any issues that were not mentioned in the chip's errata though.

Regards.

RE: portEND_SWITCHING_ISR delay

Posted by Jerry Durand on August 25, 2012
Yes, not a FreeRTOS problem. I keep trying to break it but you did a very good job. :)

In this case I have one timer with three match registers enabled. I set the registers with the timer reset and they give it a GO. Two of the three matches hit dead on time, the third one is almost 1mS late out of 22.9mS (over 4% error!). SystemCoreClock tests dead on.

I may need a LOT more caffeine for this one.


[ 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