guru meditation error

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

guru meditation error

Postby burkulesomesh43 » Wed Dec 26, 2018 10:08 am

Hi all,
I am getting this error-->>
Guru Meditation Error: Core 0 panic'ed (LoadProhibited)
. Exception was unhandled.
Core 0 register dump:
PC : 0x4008fb06 PS : 0x00060533 A0 : 0x40091aef A1 : 0x3ffd83b0
A2 : 0x00050523 A3 : 0x00000000 A4 : 0x3ffc5148 A5 : 0x3ffc5148
A6 : 0x60033c68 A7 : 0x3ffd3588 A8 : 0x00000018 A9 : 0x00000000
A10 : 0x3ffc1100 A11 : 0x00000000 A12 : 0x3ffc5330 A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000001c EXCCAUSE: 0x0000001c
EXCVADDR: 0x0000000c LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

Backtrace: 0x4008fb06:0x3ffd83b0 0x40091aec:0x3ffd83d0 0x40091aa2:0x00000000

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5800
load:0x40078000,len:0
ho 12 tail 0 room 4
load:0x40078000,len:15000
entry 0x40078630

Not getting what is the reason.
please help me out for this.
--
Somesh Burkule

fivdiAtESP32
Posts: 47
Joined: Thu Dec 20, 2018 9:47 am

Re: guru meditation error

Postby fivdiAtESP32 » Wed Dec 26, 2018 11:57 pm

Did you run the program with "make monitor"?
If not, give it a try. With a bit of luck it will display a trace log showing where the error occurred.

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: guru meditation error

Postby burkulesomesh43 » Thu Dec 27, 2018 5:21 am

fivdiAtESP32 wrote:
Wed Dec 26, 2018 11:57 pm
Did you run the program with "make monitor"?
If not, give it a try. With a bit of luck it will display a trace log showing where the error occurred.
showing following error by make monitor-->>>

0x4008fb06: vTaskSwitchContext at C:/esp32/esp-idf/components/freertos/tasks.c:3564

0x40091aef: _frxt_dispatch at C:/esp32/esp-idf/components/freertos/portasm.S:407

A2 : 0x00050023 A3 : 0x00000000 A4 : 0x3ffc5150 A5 : 0x3ffc5150
A6 : 0x00000001 A7 : 0x00000000 A8 : 0x00000018 A9 : 0x00000000
A10 : 0x3ffc1100 A11 : 0x00000000 A12 : 0x3ffc5338 A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x00000015 EXCCAUSE: 0x0000001c
EXCVADDR: 0x0000000c LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x4008fb06:0x3ffd8470 0x40091aec:0x3ffd8490 0x40091aa2:0x00000000
0x4008fb06: vTaskSwitchContext at C:/esp32/esp-idf/components/freertos/tasks.c:3564

0x40091aec: _frxt_dispatch at C:/esp32/esp-idf/components/freertos/portasm.S:406

0x40091aa2: _frxt_int_exit at C:/esp32/esp-idf/components/freertos/portasm.S:206
--
Somesh Burkule

fivdiAtESP32
Posts: 47
Joined: Thu Dec 20, 2018 9:47 am

Re: guru meditation error

Postby fivdiAtESP32 » Thu Dec 27, 2018 12:04 pm

The crash occurs while attempting to do a task context switch. If I had to guess I'd say it's a stack size issue somewhere but I may be incorrect here. There are several configuration options for stack sizes in menuconfig. Try increasing them to see if it helps. Try increasing "Component config > ESP32-specific > (3584) Main task stack size" first to see if it helps.

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: guru meditation error

Postby burkulesomesh43 » Thu Dec 27, 2018 12:54 pm

fivdiAtESP32 wrote:
Thu Dec 27, 2018 12:04 pm
The crash occurs while attempting to do a task context switch. If I had to guess I'd say it's a stack size issue somewhere but I may be incorrect here. There are several configuration options for stack sizes in menuconfig. Try increasing them to see if it helps. Try increasing "Component config > ESP32-specific > (3584) Main task stack size" first to see if it helps.
Ok. can you please explain, what is this main task stack size?
--
Somesh Burkule

fivdiAtESP32
Posts: 47
Joined: Thu Dec 20, 2018 9:47 am

Re: guru meditation error

Postby fivdiAtESP32 » Thu Dec 27, 2018 1:29 pm

Your app_main function runs in a task and that task needs a stack for storing things like local variables, arguments passed to functions and function call return address. The stack for this task is called the main stack and it must have a certain number of bytes. If it has less bytes than required things like what you are seeing can happen. The size of this stack in bytes is called the main task stack size.

As an example, if I run the following program on an ESP32-WROVER-B:

Code: Select all

#include <iostream>

void foo(int val) {
  std::cout << val << "\n";

  if (val < 1000) {
    foo(val  + 1);
  }
}

extern "C" void app_main() {
  foo(0);
}
This is the output (it's not exactly like your output but similar):

Code: Select all

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
11Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x4008569c  PS      : 0x00060033  A0      : 0x8008573a  A1      : 0x3ffb7730  
0x4008569c: prvCheckTasksWaitingTermination at /home/brian/src/esp-idf/esp-iot-solution/submodule/esp-idf/components/freertos/tasks.c:4579

A2      : 0x013f4032  A3      : 0x00000001  A4      : 0x00000000  A5      : 0x3ffb7070  
A6      : 0x00000000  A7      : 0x00000001  A8      : 0x00000000  A9      : 0x00000001  
A10     : 0x3ffb5771  A11     : 0x80000001  A12     : 0x00000000  A13     : 0x00000001  
A14     : 0x00060021  A15     : 0x00000000  SAR     : 0x00000000  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x013f407a  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  

Backtrace: 0x4008569c:0x3ffb7730 0x40085737:0x3ffb7750
0x4008569c: prvCheckTasksWaitingTermination at /home/brian/src/esp-idf/esp-iot-solution/submodule/esp-idf/components/freertos/tasks.c:4579

0x40085737: prvIdleTask at /home/brian/src/esp-idf/esp-iot-solution/submodule/esp-idf/components/freertos/tasks.c:4579


CPU halted.
The program calls foo recursively, uses too much stack and crashes.

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: guru meditation error

Postby burkulesomesh43 » Thu Dec 27, 2018 1:34 pm

fivdiAtESP32 wrote:
Thu Dec 27, 2018 1:29 pm
Your app_main function runs in a task and that task needs a stack for storing things like local variables, arguments passed to functions and function call return address. The stack for this task is called the main stack and it must have a certain number of bytes. If it has less bytes than required things like what you are seeing can happen. The size of this stack in bytes is called the main task stack size.

As an example, if I run the following program on an ESP32-WROVER-B:

Code: Select all

#include <iostream>

void foo(int val) {
  std::cout << val << "\n";

  if (val < 1000) {
    foo(val  + 1);
  }
}

extern "C" void app_main() {
  foo(0);
}
This is the output (it's not exactly like your output but similar):

Code: Select all

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
11Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x4008569c  PS      : 0x00060033  A0      : 0x8008573a  A1      : 0x3ffb7730  
0x4008569c: prvCheckTasksWaitingTermination at /home/brian/src/esp-idf/esp-iot-solution/submodule/esp-idf/components/freertos/tasks.c:4579

A2      : 0x013f4032  A3      : 0x00000001  A4      : 0x00000000  A5      : 0x3ffb7070  
A6      : 0x00000000  A7      : 0x00000001  A8      : 0x00000000  A9      : 0x00000001  
A10     : 0x3ffb5771  A11     : 0x80000001  A12     : 0x00000000  A13     : 0x00000001  
A14     : 0x00060021  A15     : 0x00000000  SAR     : 0x00000000  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x013f407a  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  

Backtrace: 0x4008569c:0x3ffb7730 0x40085737:0x3ffb7750
0x4008569c: prvCheckTasksWaitingTermination at /home/brian/src/esp-idf/esp-iot-solution/submodule/esp-idf/components/freertos/tasks.c:4579

0x40085737: prvIdleTask at /home/brian/src/esp-idf/esp-iot-solution/submodule/esp-idf/components/freertos/tasks.c:4579


CPU halted.
The program calls foo recursively, uses too much stack and crashes.
So if you want to avoid this, what we have to do?
By increasing main task stack size is it works?
--
Somesh Burkule

fivdiAtESP32
Posts: 47
Joined: Thu Dec 20, 2018 9:47 am

Re: guru meditation error

Postby fivdiAtESP32 » Thu Dec 27, 2018 1:43 pm

As already mentioned above, changing the main tasks size may fix the issue, but it may not.

Try the following:

Call "make menuconfig" from a command line, navigate to "Component config > ESP32-specific > (nnnn) Main task stack size", and change nnnn to the number you would like it to be.

Note that we're in the "ESP32 IDF" forum here so I'm assuming that you're using esp-idf directly.

burkulesomesh43
Posts: 132
Joined: Tue Aug 14, 2018 6:21 am
Location: India

Re: guru meditation error

Postby burkulesomesh43 » Thu Dec 27, 2018 1:55 pm

fivdiAtESP32 wrote:
Thu Dec 27, 2018 1:43 pm
As already mentioned above, changing the main tasks size may fix the issue, but it may not.

Try the following:

Call "make menuconfig" from a command line, navigate to "Component config > ESP32-specific > (nnnn) Main task stack size", and change nnnn to the number you would like it to be.

Note that we're in the "ESP32 IDF" forum here so I'm assuming that you're using esp-idf directly.
yes, I am using esp idf.
I have changed main task stack size from 3584 to 4000 again giving error.
--
Somesh Burkule

fivdiAtESP32
Posts: 47
Joined: Thu Dec 20, 2018 9:47 am

Re: guru meditation error

Postby fivdiAtESP32 » Thu Dec 27, 2018 2:00 pm

Try with an even bigger number, maybe 10000.

Who is online

Users browsing this forum: No registered users and 360 guests