FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [May 2009 Threads] Long latency times (ARM Cortex-M3/STM32)Posted by Johan on May 19, 2009 I have a semaphore being released from an external interrupt using
void isr(void) { xSemaphoreGiveFromISR( m_handle, &xHigherPriorityTaskWoken ); if( xHigherPriorityTaskWoken == pdTRUE) { portYIELD( ); } }
The thread is waiting for the semaphore: while(1) { if( xSemaphoreTake( m_handle, ticksToWait ) == pdTRUE ) { // Do something } }
However, it takes approx. 400 us before the sleeping thread, which also has the highest priority, is started. How do I reduce this time? 400 us is far too much time.
/johst
RE: Long latency times (ARM Cortex-M3/STM32)Posted by MEdwards on May 19, 2009 Make sure xHigherPriorityTaskWoken is initialized to 0 before it is used.
RE: Long latency times (ARM Cortex-M3/STM32)Posted by Johan on May 19, 2009 I added that now, but it makes no difference.
RE: Long latency times (ARM Cortex-M3/STM32)Posted by Richard on May 19, 2009 If this is the highest priority interrupt AND it is waking the highest priority task AND your application does not have huge sections where the scheduler is suspended then 400us seems improbably long.
I measure 120ns typical interrupt entry, where interrupts are above the max syscall interrupt priority and therefore not effected by critical sections.
How are you taking the timing?
Regards.
RE: Long latency times (ARM Cortex-M3/STM32)Posted by Johan on May 19, 2009 I measured with scope.
This was however not an RTOS problem. The thing was that I called uxTaskGetStackHighWaterMark before I started doing anything.
Placing this somewhere else solved the problem.
Thanks for all the good work you are doing!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|