H8 port: increase task stack size

is it possible to increase the task’s stack size – more than specified in freertosconfig.h? i know that it depends on sizeof(size_t). 255 bytes stack is not enough.

H8 port: increase task stack size

The size of the stack allocated to a task is passed in as a parameter to the xTaskCreate() function.  You can set it to any value you like (within the limits of the RAM available to you). FreeRTOSConfig.h contains a definition configMINIMAL_STACK_SIZE – the only place this is used in the scheduler code is to size the stack allocated to the idle task. The demo applications also use configMINIMAL_STACK_SIZE when the demo tasks are created but this is just that – a demo – and not part of the scheduler code per se. Regards.

H8 port: increase task stack size

thanks for the fast repsonse! the problem is that xtaskcreate only supports a stack depth of maximal 255. see the function header: signed portBASE_TYPE xTaskCreate( pdTASK_CODE pvTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask ) stackdepth is of size short (one byte). best regards, johannes

H8 port: increase task stack size

Are you sure short is one byte?  I would assume it is two bytes.  Maybe this is a compiler switch you can set.  Alternatively, in FreeRTOSSourceportableGCCH8S2329portmacro.h, change the #define for portSHORT to be another type (integer?).

H8 port: increase task stack size

yes you are right – short is 2 bytes long. but i can’t increase the stack depth more than 255. that’s why i thought it’s one byte.

H8 port: increase task stack size

there is no compiler warning/error when i want to increase the stack size but the board will crash because the calculated top of stacks are far beyond the RAM addresses. even if i use 256 instead of 255 for the stack size. what could be the problem???

H8 port: increase task stack size

Try changing portBASE_TYPE to short instead of char, assuming it is char that is.  If chars are used to calculate the top of stack then maybe there is an overflow occurring and the larger data type would prevent it.