Task sync problems related with binary semaphore and cache memories

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Nov 28 10:42:25 UTC 2018


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?

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the users mailing list