Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

H8 port: increase task stack size

Posted by Nobody/Anonymous on December 21, 2006
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.

RE: H8 port: increase task stack size

Posted by Richard on December 21, 2006
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.

RE: H8 port: increase task stack size

Posted by Nobody/Anonymous on December 21, 2006
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

RE: H8 port: increase task stack size

Posted by Nobody/Anonymous on December 21, 2006
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 FreeRTOS\Source\portable\GCC\H8S2329\portmacro.h, change the #define for portSHORT to be another type (integer?).

RE: H8 port: increase task stack size

Posted by Nobody/Anonymous on December 21, 2006
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.

RE: H8 port: increase task stack size

Posted by Nobody/Anonymous on December 21, 2006
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???

RE: H8 port: increase task stack size

Posted by Nobody/Anonymous on December 21, 2006
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.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists