Task sync problems related with binary semaphore and cache memories

Arturo Perez Garcia arturo.perez at upm.es
Wed Nov 28 10:52:48 UTC 2018


Yes, I'm checking the return status always. When I create the RTEMS 
objects and when I acquire/release the semaphore. I removed those checks 
from the code I put in the previous message.

Thanks.

El 2018-11-28 11:42, Sebastian Huber escribió:
> On 28/11/2018 11:30, Arturo Perez Garcia wrote:
>> Disabling the caches don't fixe the problem, I was wrong.
>> 
>> Maybe I'm initializing wrongly the RTEMS objects.
>> 
>> In the Init task I create the binary semaphore:
>> 
>>        rtems_semaphore_create(a3_sem_name, 1, 
>> RTEMS_BINARY_SEMAPHORE | RTEMS_FIFO | RTEMS_LOCAL, 0, &a3_sem_id);
>> 
>> Then I create 2 tasks with different priority:
>> 
>>     rtems_task_create(
>>         t_matmul_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2, 
>> RTEMS_PREEMPT,
>>         RTEMS_LOCAL, &t_matmul_id
>>     );
>> 
>>     rtems_task_create(
>>         t_inout_name, 2, RTEMS_MINIMUM_STACK_SIZE * 2, 
>> RTEMS_PREEMPT,
>>         RTEMS_LOCAL, &t_inout_id
>>     );
>> 
>> The tasks must be synchronized through the semaphore, but they are 
>> not. The semaphore is acquired by both tasks consecutively before it 
>> has been released.
>> 
>> I suppose that it is due to an error in my BSP implementation, but I 
>> don't know how to test it.
> 
> Did you test that the returned status code is RTEMS_SUCCESSFUL in all 
> cases?

-- 
Arturo Perez Garcia - arturo.perez at upm.es

Researcher
Center of Industrial Electronics
Universidad Politecnica de Madrid




More information about the users mailing list