- char str_data[5], str_topic[11];
- char flag_topic[11] = {'t','o','d','e','v','/','f','l','a','g','s'};
- char ref_topic[9] = {'t','o','d','e','v','/','r','e','f'};
Please help me with ESP32 Guru meditation error core 0
-
- Posts: 10
- Joined: Mon Mar 18, 2019 5:03 pm
Re: Please help me with ESP32 Guru meditation error core 0
The strings are global variables .
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Please help me with ESP32 Guru meditation error core 0
Just guessing here, as I'm not that familiar with the mqtt code, but are you sure the topic and data are zero-terminated? If not, the strcpy will copy lots of bytes, overwriting lots of static data.
-
- Posts: 10
- Joined: Mon Mar 18, 2019 5:03 pm
Re: Please help me with ESP32 Guru meditation error core 0
It is not zero terminated - or at least the payload is certainly not. When I send the data "todev/flags" from node-red, the esp32 sees it as a char array of length 11. That is why I had to compare it to the string shown in the previous reply, but I've used strncmp for the most part.
Are you saying that I should change the topic and data copy lines from strcpy to strncpy? I could measure the maximum string length in node-red, and use that value for every copy.
Are you saying that I should change the topic and data copy lines from strcpy to strncpy? I could measure the maximum string length in node-red, and use that value for every copy.
-
- Posts: 10
- Joined: Mon Mar 18, 2019 5:03 pm
Re: Please help me with ESP32 Guru meditation error core 0
This was the problem. I've replaced theESP_Sprite wrote: ↑Mon Mar 25, 2019 4:07 amJust guessing here, as I'm not that familiar with the mqtt code, but are you sure the topic and data are zero-terminated? If not, the strcpy will copy lots of bytes, overwriting lots of static data.
- strcpy(str_topic, event->topic);
- strcpy(str_data, event->data);
- strncpy(str_topic, event->topic, event->topic_len);
- strncpy(str_data, event->data, event->data_len);
Thank you so much for these invaluable responses. I've learnt a lot in these few days.
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Please help me with ESP32 Guru meditation error core 0
Nice. Note that if you use strncpy, str_topic and str_data themselves also won't be null-terminated, so if your later code assumes they are, you'll have the same issues all over again. Perhaps it's an idea to null-terminate them yourself so you'll at least not have that trap to fall down in.
-
- Posts: 1
- Joined: Wed Apr 10, 2019 2:58 pm
Re: Please help me with ESP32 Guru meditation error core 0
I have the same issue, while using simple "Hello World" example from platformIO. This is part of the LOG I get from console:
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400d2c40: 775f2289 dd55d557 57f7d755
Core 0 register dump:
PC : 0x400d2c47 PS : 0x00060130 A0 : 0x800d2cb5 A1 : 0x3ffe3930
A2 : 0x3ffe3970 A3 : 0x3ffc0000 A4 : 0x3ffc3050 A5 : 0x3ffe3970
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x0000002c A9 : 0x3ffe3bb0
A10 : 0x0000000a A11 : 0x00000000 A12 : 0x00000000 A13 : 0x00002000
A14 : 0x3ffe3ba7 A15 : 0x00000200 SAR : 0x00000005 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000
As, you can see PC is located in 0x400d2c47
Looking into my .map file, I see the code is happening inside the .pioenvs\esp32dev\libheap.a(heap_caps_init.o)
This data is persistent if I use the HelloWorld, or my application. Both fail with Ilegal instruction at the Lebheap library.
This problem is not happened in the ESP32-WROOM-32, but happens with ESP32-WROOM-32D, which is supposed to be the same.
I continue my debug. I´ll keep you posted in my findings.
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400d2c40: 775f2289 dd55d557 57f7d755
Core 0 register dump:
PC : 0x400d2c47 PS : 0x00060130 A0 : 0x800d2cb5 A1 : 0x3ffe3930
A2 : 0x3ffe3970 A3 : 0x3ffc0000 A4 : 0x3ffc3050 A5 : 0x3ffe3970
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x0000002c A9 : 0x3ffe3bb0
A10 : 0x0000000a A11 : 0x00000000 A12 : 0x00000000 A13 : 0x00002000
A14 : 0x3ffe3ba7 A15 : 0x00000200 SAR : 0x00000005 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000
As, you can see PC is located in 0x400d2c47
Looking into my .map file, I see the code is happening inside the .pioenvs\esp32dev\libheap.a(heap_caps_init.o)
This data is persistent if I use the HelloWorld, or my application. Both fail with Ilegal instruction at the Lebheap library.
This problem is not happened in the ESP32-WROOM-32, but happens with ESP32-WROOM-32D, which is supposed to be the same.
I continue my debug. I´ll keep you posted in my findings.
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Please help me with ESP32 Guru meditation error core 0
You may want to investigate your power supply; sometimes these errors originate in a brownout.
Re: Please help me with ESP32 Guru meditation error core 0
Hi,ESP_Sprite wrote: ↑Thu Apr 11, 2019 5:33 amYou may want to investigate your power supply; sometimes these errors originate in a brownout.
We are also recomanding to use at least 5V 1 Amp into our device in which we have used ESP32 Module.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: stdenits and 300 guests