IDF version 3.4 release
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.
thanks
Cjson print problem
-
- Posts: 195
- Joined: Sat Apr 01, 2017 1:21 am
- Contact:
Re: Cjson print problem
Postby AgentSmithers » Tue Jan 18, 2022 11:12 pm
I'm here, would you mind posting the Debug Crash data. I am not big on the ESP32IDF but I have alot of play time with the 8266. Post the feedback here and I'll take a look and see what I can find out for you. I do have a install of ESP32 here laying around I can copy your code on my end this week and see if I can reproduce the issue as well.
Who is online
Users browsing this forum: No registered users and 186 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.