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


Stack overflow while using max stack depth

Posted by nateslager93 on October 21, 2016

I have a task that is created with max stack depth 256kb (max value for data type short = 65535) . But it is still overflowing. I cannot alter the task to use less ram. Is there a way to increase stack depth beyond this for freertos v.8.2.3 (only version supported by Xilinx)? Note that xTaskCreateStatic (which takes in 32 bit stack depth field, instead of 16) isn't availabe before freertos v9.0.0.

Stack overflow while using max stack depth

Posted by rtel on October 21, 2016

The data type dates back a number of years, and for backward compatibility can't be changed - although as you point out the newer function doesn't have the same issue. You will not encounter any problems if you simply edit the code to make it a uint32_t though. Don't forget to edit the prototype in task.h too.

It won't help you know, but I will change this so the data type is instead a macro that defaults to uint16_t for backward compatibility, but can be overridden by defining the macro in the FreeRTOSConfig.h file.

I suppose another option would be to find the path in your code that is using so much stack, and see if you can instead allocate the memory from the heap (remembering to give it back again at the end of the function, of course).

Stack overflow while using max stack depth

Posted by nateslager93 on October 27, 2016

Thank you! This worked!

[ 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