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] [October 2013 Threads] portENTER_CRITICAL and SysTickPosted by mbr4 on October 14, 2013 I have a question related to Cortex-M3 port of portENTER_CRITICAL() function. It disables interrupts, but should it also disable SysTick interrupt?
portENTER_CRITICAL and SysTickPosted by davedoors on October 14, 2013 If you are looking at official FreeRTOS code then portENTER_CRITICAL() does not disable interrupts, it only masks interrupts up to a user settable priority level. The systick is the lowest priority interrupt so will always be masked inside a critical section.
portENTER_CRITICAL and SysTickPosted by mbr4 on October 14, 2013 So it means that SysTick won't be counted during critical section?
portENTER_CRITICAL and SysTickPosted by richardbarry on October 14, 2013 If a SysTick occurs inside a critical section it will be held pending by the hardware until the critical section was exited.
Typically an application will configure the tick to occur ever 10 or 100ms. Critical sections should always be kept very short, and should never be anywhere near as long as one tick period.
If you need a longer critical section then consider using scheduler locking instead (vTaskSuspendAll() and xTaskResumeAll()). Tick interrupts that occur while the scheduler is suspended are help pending in software so more than one can be pended. When the scheduler is unlocked (resumed) any pending tick interrupts are 'unwound' so you don't get any time slippage.
Regards.
portENTER_CRITICAL and SysTickPosted by mbr4 on October 14, 2013 Thanks for clarification!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|