FreeRTOS: TaskStackSize is not size_t #62
Labels
No Label
API Change
Breaking API Change
bug
build
cosmetics
Documentation
duplicate
feature
help wanted
hotfix
invalid
question
Refactor
Tests
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: fsfw/fsfw#62
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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?