[SOLVED] List all directory and file with levels using sdfat.h

When I take less it works. I did that for testing.

I will make a physical ram if I cann't get engough files. Thank's for the tip.

To be clear, I don't have a memorie issue. It's an overflow. I am thinking now I need to fill all empty title array with '\0'. That could be it I think. But still I doubt it because I don't access them.

Ok. Sorry about that. I have addaped it.

I ask again, what board does this run on?

char buffer[ 256 ]; // by default, all of the chars start as 0

I run on MCU node.

Soo the empty ones are not case. Is that what you are saying?

I have to correct myself. I was looking for a malloc error in the decode. But I use fix arrays that are not using any malloc. The stack in the loop is very limited.

char Title[TitleIndex][MaxTitleLength];

Here is a shetch to test it.

//Memory issues... look at the warnings with this shetch. try it to move the varaibles on top. 
//void setup() {
//void loop(){
//char replyHTML[9000];
//char setupForm[5000];
//char sslCert[3000];
//this for pointer
//char* replyHTML = (char*)malloc(sizeof(char) * 9000);
//char* setupForm = (char*)malloc(sizeof(char) * 5000);
//char* sslCert = (char*)malloc(sizeof(char) * 3000);

The stack in the loop can be found in the main.cpp and is 8192 that was not enough. Changing it will give you a little more, but by moving de declarations out of the loop I could go up to 100K.

This is ridiculous. I'm out.

Stack size on ESP is indeed limited and hardcoded in arduino’s environment.

Malloc allocates memory in the heap and Global or static variable are allocated by the compiler outside the stack so you don’t have the restrictions

That’s what you see

And by define the local variable as static or start my own FreeRtos Task, I can specify my stack size.

If you make a local variable static, you loose re-entrance for your function. It’s not equivalent to having the variable on the stack

What I did is created a task and defined the stack, one for making my playlist and when it's complete it runs my program. All memorie is located in the task and is free to use after completing the first task. Mission complete!!

Yes that’s a possibility