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] [March 2009 Threads] Please Help!Posted by Timothy Bean on March 4, 2009 The OS and everything completely crashes and stops running. Here is the scenario: Task A uses the SPI bus. Task B also uses the SPI bus. Again with Task C. Task A can take the semaphore, no problems. Always works. If Task B or Task C tries to take the semaphore, the whole OS crashes. Every time, even is Task A is not doing anything at the moment.
RE: Please Help!Posted by Prithwee on March 4, 2009 Make sure that you have released the semaphore in Task-A. xSemaphoreGive( xSemaphore );
Have a look @ user documnetaion in www.freertos.org
Example usage:
xSemaphoreHandle xSemaphore = NULL;
void vATask( void * pvParameters ) { // Create the semaphore to guard a shared resource. As we are using // the semaphore for mutual exclusion we create a mutex semaphore // rather than a binary semaphore. xSemaphore = xSemaphoreCreateMutex();
if( xSemaphore != NULL ) { if( xSemaphoreGive( xSemaphore ) != pdTRUE ) { // We would expect this call to fail because we cannot give // a semaphore without first "taking" it! } // Obtain the semaphore - don't block if the semaphore is not // immediately available. if( xSemaphoreTake( xSemaphore, ( portTickType ) 0 ) ) { // We now have the semaphore and can access the shared resource. // ... // We have finished accessing the shared resource so can free the // semaphore. if( xSemaphoreGive( xSemaphore ) != pdTRUE ) { // We would not expect this call to fail because we must have // obtained the semaphore to get here. } } } }
Regards, Prithwee
RE: Please Help!Posted by Timothy Bean on March 6, 2009 I will put the code in to check, but I do give it back in all instances.
Any idea why the whole OS crashes though?
RE: Please Help!Posted by Prithwee on March 6, 2009 Did you locked your SPI Read/Write properly?
Post your sample code here.... It may help you!!!
RE: Please Help!Posted by Timothy Bean on March 7, 2009 I will put the code in to check, but I do give it back in all instances.
Any idea why the whole OS crashes though?
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|