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] [March 2010 Threads] fromISR function assumptions and Cortex-M3Posted by c77er on March 3, 2010 For the fromISR functions, is it assumed that the code in them is not be interrupted? For some other architectures it's a safe assumption since interrupts are automatically disabled upon entry of ISR and enabled upon exit.
However, for Cortex-M3, it's not true right? So wouldn't critical sections be a necessity here?
My explanation probably would be that the task swapping only happens in PendSV handlers, which won't be triggered until all interrupts are clear, so no critical sections are necessary? Does this explanation make sense?
Even with this explanation I'm still puzzled - well, even without task swapping, if no critical sections are used, there is still a possibility that the xxxFromISR function could still be interrupted, and the higher priority interrupt can still mess with data structures such as ready list, event list, etc. which makes this code unsafe.
Thanks in advance!
RE: fromISR function assumptions and Cortex-M3Posted by Richard on March 4, 2010 The FromISR functions do have critical sections where necessary. This is especially important for the interrupt nesting. Inside the functions you will see macros something like portSET_INTERRUPT_PRIORITY_FROM_ISR and portCLEAR_INTERRUPT_PRIORITY_FROM_ISR. The implementation of these macros is different to that for the standard critical section macros.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|