Quality RTOS & Embedded Software

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




Loading

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.


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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