I didn't call rtems_semaphore_release in the Init task, because the initial count of the semaphore is 1. So that was not the case.

I followed the guidelines described in RTEMS C User Documentation Release 4.11.3. Section 12.2 paragraph 2:

"A binary semaphore can be used to control access
to a single resource. In particular, it can
be used to enforce mutual exclusion for a critical
section in user code. In this instance, the
semaphore would be created with an initial
count of one to indicate that no task is executing
the critical section of code..."

Thanks



El 2018-11-28 13:00, [email protected] escribió:
Send users mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.rtems.org/mailman/listinfo/users
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of users digest..."


Today's Topics:

   1. Re: Task sync problems related with binary semaphore and
      cache memories (Sebastian Huber)


----------------------------------------------------------------------

Message: 1
Date: Wed, 28 Nov 2018 11:58:11 +0100
From: Sebastian Huber <[email protected]>
To: Arturo Perez Garcia <[email protected]>
Cc: [email protected]
Subject: Re: Task sync problems related with binary semaphore and
        cache memories
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed

On 28/11/2018 11:52, Arturo Perez Garcia wrote:
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.

Ok, good.


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);

This call creates a binary semaphore without a locking protocol which is
owned by the current task (Init task). If you do not call
rtems_semaphore_release() for this semaphore within the Init task, then
no other task should be able to obtain it.

I would debug the rtems_semaphore_obtain() call if this is actually the
case.

--
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  : [email protected]
PGP     : Public key available on request.

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



------------------------------

Subject: Digest Footer

_______________________________________________
users mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/users

------------------------------

End of users Digest, Vol 146, Issue 25
**************************************

--
Arturo Perez Garcia - [email protected]

Researcher
Center of Industrial Electronics
Universidad Politecnica de Madrid

_______________________________________________
users mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/users

Reply via email to