FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [June 2009 Threads] Idle task stack overflowPosted by Tom Pycke on June 13, 2009 Hi,
To make sure everything is OK during development, I use the stack overflow hook. However, my Idle task stack is overflowing.
Code: void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName ) { uart1_puts("Stack overflow! "); uart1_puts(pcTaskName); uart1_puts("\n\r"); }
Result: 06/13/2009 21:38:52.078 --> Stack overflow! IDLE 06/13/2009 21:38:52.093 --> Stack overflow! IDLE 06/13/2009 21:38:52.093 --> Stack overflow! IDLE 06/13/2009 21:38:52.093 --> Stack overflow! IDLE 06/13/2009 21:38:52.125 --> Stack overflow! IDLE 06/13/2009 21:38:52.125 --> Stack overflow! IDLE 06/13/2009 21:38:52.125 --> Stack overflow! IDLE 06/13/2009 21:38:52.125 --> Stack overflow! IDLE 06/13/2009 21:38:52.125 --> Stack overflow! IDLE 06/13/2009 21:38:52.125 --> Stack overflow! IDLE 06/13/2009 21:38:52.140 --> Stack overflow! IDLE 06/13/2009 21:38:52.140 --> Stack overflow! IDLE ....
(doesn't seem to affect the normalo operation)
Anybody any idea why that is?
Thanks,
Tom
RE: Idle task stack overflowPosted by Richard Damon on June 13, 2009 It could be that you need to give the IDLE task a bit more stack (perhaps an interrupt function is using more than the demos planed for), or that something else is corrupting the task stack, either through a bad pointer, or some other task declairs a large buffer it doesn;t use all of in a function that corrupts it. My first guess is the interrupt function.
RE: Idle task stack overflowPosted by Tom Pycke on June 13, 2009 Thanks, Do the Idle task and the interrupts share the same stack? How do I make it larger? Yes, I do use a lot of interrupt handling on top of freertos.
RE: Idle task stack overflowPosted by Richard Damon on June 13, 2009 Unless the processor has a dedicated stack for interrupt routines (ARM processors do, many others don't), then all interrupts will use the stack of whatever task is currently running. In FreeRTOSConfig.h is a define for configMINIMAL_STACK_SIZE which sets the size of the idle task (and most other tasks should set their size based on this plus what additional space they need).
RE: Idle task stack overflowPosted by Richard on December 31, 2010 On the LPC2000, interrupts use a separate stack (I think most if not all the 32bit FreeRTOS ports use a separate stack for interrupts). It could be that you interrupt stack is too small and that overflowing is corrupting something else to give you this symptom. The interrupt stack size (ARM7 IRQ mode stack in this case) is normally set in the C start up code.
Are you using an idle task hook function? If so, then is that using a lot of stack?
Regards.
RE: Idle task stack overflowPosted by ARMinator on December 31, 2010 I am getting a similar issue. I haven't tried the suggested solution yet that consists of increasing configMINIMAL_STACK_SIZE.
Before reading this post, my understanding was too that the interrupts use a different stack, which is set in the startup code. When I saw this issue yesterday I did increase the interrupt stack size, from the default 256 bytes to 512. It didn't fix the issue though so I ruled out that the ISR is running our of stack.
I do not use a hook on the idle task.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|