ISSUE : using cJSON_AddNumberToObject crashes the ESP8266 during cJSON_Print command. The same piece of code executed correctly on ESP32.
void json_task(void *para)
{
int stackmem = uxTaskGetStackHighWaterMark(NULL);
ESP_LOGI("TAG", "stack space = %d", stackmem);
cJSON *root = cJSON_CreateObject();
bool res=cJSON_AddNumberToObject(root,"meta",212);
//cJSON_AddStringToObject(root,"meta","stringval");
char *out=cJSON_Print(root);
//cJSON_PrintPreallocated(root,resp,1500,true);
ESP_LOGI("TAG","\n%s\n",out);
while(1){vTaskDelay(100);}
}
the issue seems to be only with AddNumeberToObject, cJSON_AddStringToObject works fine.
Please help me debug the issue.
thanksStatistics: Posted by toxicjv — Mon Dec 13, 2021 7:59 pm
]]>