Quality RTOS & Embedded Software

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


Loading

portENTER_CRITICAL and SysTick

Posted 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 SysTick

Posted 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 SysTick

Posted by mbr4 on October 14, 2013

So it means that SysTick won't be counted during critical section?


portENTER_CRITICAL and SysTick

Posted 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 SysTick

Posted by mbr4 on October 14, 2013

Thanks for clarification!


[ 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