# Stack overflow when only Idle task running

**URL:** <https://forums.freertos.org/t/stack-overflow-when-only-idle-task-running/746>\
**Category:** Kernel\
**Created:** [May 4, 2012, 9:31am UTC](https://forums.freertos.org/t/stack-overflow-when-only-idle-task-running/746 "2012-05-04T09:31:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 4, 2012, 9:31am UTC](https://forums.freertos.org/t/stack-overflow-when-only-idle-task-running/746/1 "2012-05-04T09:31:25Z")

</div>

**anonymous** wrote on [Friday, May 04, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/2b12873f/#f4d2):

Hi everyone !

i actually got a “little” problem within my project: even when i don’t use any task (so there shall only be the Idle one running), i got stack overflows after a while; using traceTASK\_SWITCHED\_IN() and uxTaskGetStackHighWaterMark() to print stack usage on UART, it seemed that the stack is continuously growing up to the overflow…

Do you have any idea about where could it come from?  
I guess it’s probably an error in my port (using a TI MSP430F5438 with mspgcc), as there ain’t many people talking about such a thing on the internet.  
TY  
Matt.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [May 4, 2012, 9:37am UTC](https://forums.freertos.org/t/stack-overflow-when-only-idle-task-running/746/2 "2012-05-04T09:37:15Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, May 04, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/2b12873f/#9716):

Where did you get the port from?

If it was from the FreeRTOS distribution - then the FreeRTOS GCC port will only work on the base, rather than extended, MSP430 parts.&nbsp; There are official FreeRTOS ports to that device, but only for IAR and CCS.

FreeRTOS has both an IAR MSP430 and an IAR MSP430X port, so if you want to have GCC running on an X part I would suggest looking at both IAR ports to see the differences, and then copy the differences into your GCC port layer.&nbsp; If you use it unmodified, I would not expect it to work.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 4, 2012, 10:26am UTC](https://forums.freertos.org/t/stack-overflow-when-only-idle-task-running/746/3 "2012-05-04T10:26:22Z")

</div>

**anonymous** wrote on [Friday, May 04, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/2b12873f/#053e):

Wow! the quick reply is quite impressive ! Thanks ! 🙂

The port has been made by a colleague, using the official versions from the demos ( i’m nearly shure that’s from the IAR one).

So I guess i shall have a look at how he made his port.

But there’s something weird : it looks like everything is working fine with some other projects which have the same port :-/

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 4, 2012, 1:23pm UTC](https://forums.freertos.org/t/stack-overflow-when-only-idle-task-running/746/4 "2012-05-04T13:23:25Z")

</div>

**anonymous** wrote on [Friday, May 04, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/2b12873f/#50f8):

Okay, i found the problem: i was using the _traceTASK\_SWITCHED\_IN()_ macro, but i was doing some printf() inside…  
Once i removed them, everything came back to normal 🙂
