FreeRTOS: TaskStackSize is not size_t #62

Closed
opened 2020-05-01 15:44:35 +02:00 by muellerr · 1 comment
Owner

The task stack size type specified in the PeriodicTask() ctor is size_t.
However, the API function xTaskCreate() does not take size_t (size in bytes),
as an argument type, it takes the number of words (with word being the stack type, for example uint32_t).

Also see in API documentation https://www.freertos.org/a00125.html

If I understand correctly, for a stack depth of long (uint32_t), the actual stack size for a value of 200 would be 800 bytes.

It propably would be a good idea to either calculate the resulting stack value from the specifie size in bytes (by dividing the supplied value by the sizeof(stackType)) or by replacing the TaskStackSize type by configSTACK_DEPTH_TYPE from the config file. I would prefer the first solution to have a generic interface.

The task stack size type specified in the PeriodicTask() ctor is size_t. However, the API function xTaskCreate() does not take size_t (size in bytes), as an argument type, it takes the number of words (with word being the stack type, for example uint32_t). Also see in API documentation https://www.freertos.org/a00125.html If I understand correctly, for a stack depth of long (uint32_t), the actual stack size for a value of 200 would be 800 bytes. It propably would be a good idea to either calculate the resulting stack value from the specifie size in bytes (by dividing the supplied value by the sizeof(stackType)) or by replacing the TaskStackSize type by configSTACK_DEPTH_TYPE from the config file. I would prefer the first solution to have a generic interface.
muellerr added the
feature
label 2020-05-01 15:44:35 +02:00
Author
Owner

on another note, even the test service uses 300 "words" (I guess that is 1200 bytes?) according to a freeRTOS api function at worst. Is that normal?

on another note, even the test service uses 300 "words" (I guess that is 1200 bytes?) according to a freeRTOS api function at worst. Is that normal?
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: fsfw/fsfw#62
No description provided.