Stream buffer and task notification
Hi,
Can I use task notification when stream buffer are being used by the same task?
I notice in the stream buffer there code like the one shown below. If this is the case this will complete remove all the bits set.
I am asking because I am running into problems where one my task is missing events and it’s because the task notification bits are cleared before I get a chance to read it.
xTaskNotifyWait( ( uint32t ) 0, UINT32MAX, NULL, xTicksToWait );
Edit:
I can confirm that this is the reason why my task is not get the task notification. The stream buffer is clearing the events. If I stop using stream buffer everything is fine.
I am not sure if this is a bug or a documentaton doesn’t correctly indicate this.
Stream buffer and task notification
If I remember right, there is a hook macro to allow you to define how the stream buffer use notifications to wake the awaiting task. You could provide an implementaton that uses one particular bit instead of the whole event word.
Stream buffer and task notification
Can you point me in the right direction. I don’t see any hook macro?
Stream buffer and task notification
In the streambuffer.h file, there are mentions to macros like sbSENDCOMPLETED which look to provide some hook for this sort of action. I don’t see a macro hook for the other side, so maybe this functionality is incomplete.
Stream buffer and task notification
It looks like the hooks are called in some places but not in others places. May I suggest in new release to update the documentation just to indicate that when stream buffer are used task notification cannot be used.
Might help the next developer running into problems
Cheers
Stream buffer and task notification
Not read this whole thread, but just on the point of documentation, see
the fourth paragraph down here:
https://www.freertos.org/RTOS-stream-buffer-example.html
Stream buffer and task notification
The code was changed recently so the notification being sent within the
stream buffer code didn’t change the notification value, but it still
does set the notification pending. I’m not sure if that update is in
V10.0.1, which is released, or just in the public SVN repo at this time.
Stream buffer and task notification
Also at the bottom of this page:
https://www.freertos.org/RTOS-stream-buffer-example.html#macros