LoadProhibited on core 0 when concatenating with sprintf
Posted: Sun Jun 04, 2017 5:51 pm
Hello, I need to send as a GET parameter ESP32 IP address to my web server. The problem is that, when I want to concatenate the strings with the URL, the IP and the rest of the request, it gives me the following error:
My code is the following:
At the beginning:
In the event handler (copied from your example):
In the http_get_task (also copied):
Code: Select all
Guru Meditation Error of type LoadProhibited occurred on core 0. Exception was unhandled.
Register dump:
PC : 0x400014fd PS : 0x00060930 A0 : 0x800d884c A1 : 0x3ffc6530
A2 : 0x00000000 A3 : 0xfffffffc A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x3ffc64f0
A10 : 0x00000000 A11 : 0xffffffff A12 : 0x00000004 A13 : 0x00000001
A14 : 0x400dbc18 A15 : 0x3ffc47fc SAR : 0x00000000 EXCCAUSE: 0x0000001c
0x400dbc18: http_get_task at /Users/my_user/esp/project/main/./main.c:71 (discriminator 1)
EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff
Backtrace: 0x400014fd:0x3ffc6530 0x400d884c:0x3ffc6540 0x4010d52c:0x3ffc6850 0x400dbc3c:0x3ffc68a0
0x4010f538: _svfprintf_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/vfprintf.c:1529
0x4010d69c: sprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/sprintf.c:646
0x400dbc48: http_get_task at /Users/my_user/esp/project/main/./main.c:71 (discriminator 1)
At the beginning:
Code: Select all
char* ip;
Code: Select all
case SYSTEM_EVENT_STA_GOT_IP:
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
ip = inet_ntoa(event->event_info.got_ip.ip_info.ip);
break;
Code: Select all
char WEB_URL1[128];
sprintf(WEB_URL1, "http://192.168.0.1/grbinventions/grbalarm/regip.php?ip=%s", ip);
char REQUEST[512];
sprintf(REQUEST, "GET %s HTTP/1.1\r\n%s", WEB_URL1, REQUEST_TEXT);