ESP-IDF and printf() function

elnino_cs
Posts: 3
Joined: Tue Oct 27, 2020 5:21 pm

ESP-IDF and printf() function

Postby elnino_cs » Thu Jan 20, 2022 5:24 pm

Hi, a strange thing happens to me.
I created a sketch where I use bluetooth to communicate with external apps and it happens in some cases that the execution of the sketch stops if I insert the printf () function;

Faccio un esempio:

Code: Select all

if(param->write.value[2] == 8){
valore0 = param->write.value[0];
valore1 = param->write.value[1];
printf("value1= %d\n",param->write.value[1]);
}
in this case the function works fine.

If instead I insert the second printf () function:

Code: Select all

if(param->write.value[2] == 8){
value0 = param->write.value[0];
printf("value0= %d\n",param->write.value[0]);
value1 = param->write.value[1];
printf("value1= %d\n",param->write.value[1]);
}
In this case the execution of the sketch stops at the first printf() function of "value0" and does not proceed with the assignment of "value1" as it does not print the second printf ()

I hope I was clear.
Thank you

mikemoy
Posts: 599
Joined: Fri Jan 12, 2018 9:10 pm

Re: ESP-IDF and printf() function

Postby mikemoy » Sun Jan 23, 2022 2:16 am

Did you allocate enough stack ?

Who is online

Users browsing this forum: No registered users and 102 guests