Array for memory allocation in FreeRtos
Posted: Wed Sep 10, 2025 6:34 pm
I am new in this and I want to start to use FreeRtos. I seen that statically memory allocation is done by an array and depth is in bytes and not words. But array is of type StackType_t
Example says:
#define STACK_SIZE 200
...
// Buffer that the task being created will use as its stack. Note this is
// an array of StackType_t variables. The size of StackType_t is dependent on
// the RTOS port.
StackType_t xStack[ STACK_SIZE ];
So depends on port in this case Esp32.
Index of the array and depth are both in bytes. I am asking if it have to be
ARRAY_INDEX = STACK SIZE / sizeof(* StackType_t)
Or if size Stacktype_t = 1 byte.
Many thanks in advance for your comments.
Example says:
#define STACK_SIZE 200
...
// Buffer that the task being created will use as its stack. Note this is
// an array of StackType_t variables. The size of StackType_t is dependent on
// the RTOS port.
StackType_t xStack[ STACK_SIZE ];
So depends on port in this case Esp32.
Index of the array and depth are both in bytes. I am asking if it have to be
ARRAY_INDEX = STACK SIZE / sizeof(* StackType_t)
Or if size Stacktype_t = 1 byte.
Many thanks in advance for your comments.