Page 1 of 1

ESP-IDF and printf() function

Posted: Thu Jan 20, 2022 5:24 pm
by elnino_cs
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

Re: ESP-IDF and printf() function

Posted: Sun Jan 23, 2022 2:16 am
by mikemoy
Did you allocate enough stack ?