cancel
Showing results for 
Search instead for 
Did you mean: 

Stack memory ?

antonius
Senior
Posted on April 17, 2017 at 07:51

Everyone,

Are these variables taking a lot of memory space on the stack ?

FRESULT fr;    //move to global        /* FatFs return code */

FILINFO fno; //move to global

DIR dir;     //move to global

?

Thanks

#space #memory #freertos #stack
4 REPLIES 4
Posted on April 17, 2017 at 09:43

To be frank, I just say NO.

Those variables are usually taken on BSS region.

Posted on April 17, 2017 at 10:16

So what's the cause ?

The first task, the files can be played correctly but the next task,

it's only reading the file name and never played.

I don't understand why ??? variable memory allocation ? stack overflow ?

If I played without RTOS, it's working with all the directories and files.

Posted on April 17, 2017 at 10:47

Not being a specialist of RTOS, I guess RTOS tasks have their own individual pseudo stack size (properly sized up) or mecanics for variable visibility. 

Posted on April 17, 2017 at 17:53

Doesn't it depend on where you allocate them and the scope?

If you don't want multiple threads treading on each other's data they should be local/auto

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..