need to use taskENTER_CRITICAL();

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

need to use taskENTER_CRITICAL();

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?

need to use taskENTER_CRITICAL();

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

need to use taskENTER_CRITICAL();

It could be as simple as a stack overflow issue.  Try giving your tasks more stack space.