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] [July 2012 Threads] FreeRTOS Critical Section issue on OR1200 Posted by avamsi on July 19, 2012 Hi, We are running freeRTOSV6.1.1 on Openrisc1200. There is a problem with the critical section execution. Actually, we created three tasks with same prority(same time slice). In the task functionality, we called some print functions that internally calls portENTERCRITICAL & portEXITCRITICAL to protect the data to send on uart(console prints). The tasks executed for some time(printed the text on console). Later only one task is running fine. We are unable to find the control of the other tasks(even did not hit break point). Some times that task is also not running, control jumping to unknown location.With out this critical section part in the tasks, we are sure that tasks are running fine all the time. The same issue raised in the ISR execution also. When ever we used this critical section part, control did not return form ISR to task. Can some one explain how to make use of this critical sections with out effecting the task.
Thanks, A.Vamsi
RE: FreeRTOS Critical Section issue on OR1200 Posted by Richard on July 19, 2012 I have absolutely no idea about the OpenRISC architecture, or the port you are using, so I'm afraid I cannot give an authoritative answer, but from experience check to ensure your print functions are not themselves manipulating the interrupt state through any means other than calls to taskENTER_CRITICAL() and taskEXIT_CRITICAL() - assuming your implementation of these functions takes care of critical section nesting, any other interrupt manipulation will break the nesting count.
You can also consider using a simple mutex() to access the print function, ensuring the buffers a flushed before the mutex is returned, or using scheduler locking (vTaskSuspendAll() and xTaskResumeAll()) in place of a critical section.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|