hi,
i hope my bad writing skill doesn’t bother you.
I studied about Task Notifications using FreeRTOS Tutorial, and I found a sentece.
RAM Footprint Benefits of Task Notifications
Likewise, using a task notification to send an event or data to a task requires significantly less
RAM than using a queue, semaphore or event group to perform an equivalent operation. This
is because each communication object (queue, semaphore or event group) must be created
before it can be used, whereas enabling task notification functionality has a fixed overhead of
just eight bytes of RAM per task
and also i found this on freertos homepage
Setting configUSE_TASK_NOTIFICATIONS to 0 will exclude direct to task notification functionality and its associated API from the build.
Each task consumes 8 additional bytes of RAM when direct to task notifications are included in the build.
both said 8bytes for each Task.
but also I found this on the community tab.
Beginning with FreeRTOS V10.4.0, each task has an array of notifications. Before that, each task had a single notification. Each notification comprises a 32-bit value and a Boolean state, which together consume just 5 bytes of RAM.
so I tried to figure it out through checking by my self.
first, I set " configUSE_TASK_NOTIFICATIONS " 1, and check the memory left, and tried when it’s set 0.
but when it was 0, i can’t build with errors.
error configUSE_TASK-NOTIFICATIONS must be set to 1 to build stream_buffer.c
i know it’s not a critical or major problem.
but still I just wanna know which one is correct.
8bytes? or 5bytes?
I thought this example was for checking ‘task notification can be used like binary semaphore’.
but if I give a notification like, 3times in ISR, then Handler Task will get notification value as 3.
then following the code ulEventsToProcess = ulTaskNotifyTake(pdTRUE, xMaxExpectedBlockTime); it will be ulEventsToProcess = 3.
after then, while(ulEventsToProcess > 0) will run 3times (3 ->2 → 1 ->break).
How it’s meaning Notification is same with Binary Semaphore.
if I am right, in a same context, Using binary semaphore will print 2times only.
I’m just confusing and I think I am thinking wrong way.
if there is something I am missing in this Example, please tell me.