Quality RTOS & Embedded Software

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


need to use taskENTER_CRITICAL();

Posted by Victor on June 4, 2007
I am setting up a project with AVR with ISO7816 port (Smartcard) and FreeRTOS.
ISO7816 protocol have very important timings.

I have a simple project that works ok without FreeRTOS.
Received and send commands over the ISO7816 port.

Now, with FreeRTOS, it seems that the change of contexts is affecting the iso7816 communication.

I have find out, that putting: taskENTER_CRITICAL();
right at the begging of my task is works ok.

Any ideas or sample i can look around?

Thanks in advance

RE: need to use taskENTER_CRITICAL();

Posted by sotd on June 4, 2007
Why do you think the critical section helps? Is it that the scheduler is screwing with the port timing. Or have you got more than one task that is accessing the port at the same time?

RE: need to use taskENTER_CRITICAL();

Posted by Victor on June 4, 2007
Thanks for answering.
I have the main task with access the iso port, and 5 test simple tasks, that just updates an array of 5 counters.

When using taskENTER_CRITICAL, there is no context switch, and so there is only the main task executing, no other tasks are executing.

But when there is any context swtiching, the main task is not executing well. Probably is what you say: the scheduler is screwing with the port timing; or, I need to improve my context save/restore functions.
Although my test application with only the test tasks works well, they update their counter.


RE: need to use taskENTER_CRITICAL();

Posted by Dave on June 4, 2007
It could be as simple as a stack overflow issue. Try giving your tasks more stack space.

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





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