Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


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 ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists