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] [June 2007 Threads] need to use taskENTER_CRITICAL();Posted by Victor on June 4, 2007 Hello, 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 Hi, 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.
Thanks
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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|