embedded - How to get stack width on FreeRTOS? -
i developing embedded platform using sdk based on freertos. need create task xtaskcreate
, don't understand usstackdepth
parameter. freertos documentation says:
the size of task stack specified number of variables stack can hold - not number of bytes. example, if stack 16 bits wide , usstackdepth defined 100, 200 bytes allocated stack storage. stack depth multiplied stack width must not exceed maximum value can contained in variable of type size_t.
so, how stack width? platform-dependent? targeting 32-bit risc processor xtensa lx106
the freertos task stack width port dependent. in portmacro.h , should find definition portstack_type
.
if dig further tasks.c (remember have access freertos source code), you'll find stack allocated size of ( ( size_t ) usstackdepth ) * sizeof( stacktype_t)
. , in portmacro.h you'll find stacktype_t
typedef'd same portstack_type
.
Comments
Post a Comment