Guru Meditation Error of type IllegalInstruction?

Resch2061
Posts: 40
Joined: Mon May 01, 2017 1:56 pm

Guru Meditation Error of type IllegalInstruction?

Postby Resch2061 » Fri Jul 21, 2017 12:25 pm

Hello all,
I'm not too sure why this error is happening. I'm trying to start Wifi in AP mode, and I can't quite figure out the source of this error.
This is the register dump:

Code: Select all

Guru Meditation Error of type IllegalInstruction occurred on core  0. Exception was unhandled.
Register dump:
PC      : 0x400dc867  PS      : 0x00060430  A0      : 0x00000000  A1      : 0x3ffc6580  
0x400dc867: wifi_init at /home/rene/esp32/apps/josuino/main/src/josuino/comms/wifi.c:91

A2      : 0x3f402600  A3      : 0x3ffc6614  A4      : 0x00000000  A5      : 0x00000000  
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x800dc867  A9      : 0x3ffc6550  
A10     : 0x00000000  A11     : 0x3ffc7d54  A12     : 0x3ffb2cd0  A13     : 0x3ffc6710  
A14     : 0x00000001  A15     : 0x00000005  SAR     : 0x00000004  EXCCAUSE: 0x00000000  
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff  

Backtrace: 0x400dc867:0x3ffc6580 0x00000000:0x3ffc66a0
0x400dc867: wifi_init at /home/rene/esp32/apps/josuino/main/src/josuino/comms/wifi.c:91
This is on line 91 in wifi.c:
esp_err_t err = esp_wifi_start();

GDB has the following to say about the source of the error:

Code: Select all

Reading symbols from ./build/app-template.elf...done.
Remote debugging using /dev/ttyUSB0
uart_tx_char (uart=0x3ffb1718, c=21) at /home/rene/esp32/esp-idf/components/vfs/./vfs_uart.c:43
43	    while (uart->status.txfifo_cnt >= 127) {
How is it possible the error happens here? What's wrong with my code?
Before this I was getting stack overflow errors, which is why I decided to make a task for the actual initialization. Is it possible the problem originates because I'm calling the initializiation from the event loop?

Code: Select all

		case SYSTEM_EVENT_ETH_GOT_IP:
			JOS_LOGI("Attempting to start Wifi in AP mode...");
			//Starting Wifi with STA now will cause conflicts.
			josuino_wifi_init(WIFI_MODE_AP);
			JOS_LOGV("Returned from josuino_wifi_init to SYSTEM_EVENT_ETH_GOT_IP handler");

ESP_Sprite
Posts: 9020
Joined: Thu Nov 26, 2015 4:08 am

Re: Guru Meditation Error of type IllegalInstruction?

Postby ESP_Sprite » Fri Jul 21, 2017 3:50 pm

What hardware do you use? Weirdness on WiFi startup is 99% of the time caused by your 3.3V rail not being able to deliver enough current.

Resch2061
Posts: 40
Joined: Mon May 01, 2017 1:56 pm

Re: Guru Meditation Error of type IllegalInstruction?

Postby Resch2061 » Mon Jul 24, 2017 8:36 am

I currently use this product to test a custom print we're going to make. This hardware was brought in so I could test both Ethernet and Wifi until our prints are in.
I'm supplying 5.0v through an external supply, so I wonder if this is the issue. The error appears to be very consistent.

Resch2061
Posts: 40
Joined: Mon May 01, 2017 1:56 pm

Re: Guru Meditation Error of type IllegalInstruction?

Postby Resch2061 » Mon Jul 24, 2017 8:41 am

I'm currently attempting something else. My guess is there are conflicts when both Ethernet and Wifi in (AP)STA mode are enabled and connected, since the issue arises when attempting to have MQTT send data, which I assume must be done through sockets. I'm trying to see if setting the Wifi mode to purely AP works.

Nope, doesn't seem to work with purely AP. I have MQTT connect to the broker before enabling AP mode, which works fine. After setting up the AP mode, I attempt to subscribe to a few topics. As soon as the subscribe message is sent, I get Guru Meditation Error of type InstrFetchProhibited on core 0.
The odd thing about this is that PC is 0x0(lots of zeros)3, which appears to point to... nothing. I'm quite clueless as to what's going on here. Perhaps it's simply because I'm trying to use Ethernet and Wifi at the same time :lol:
I would assume however that not doing anything with STA would work, even when Ethernet has been connected...

Resch2061
Posts: 40
Joined: Mon May 01, 2017 1:56 pm

Re: Guru Meditation Error of type IllegalInstruction?

Postby Resch2061 » Mon Jul 24, 2017 1:35 pm

I can't seem to figure it out. LoadProhibited all over the place, this is so frustrating... It seems to be mostly related to FreeRTOS and tasks.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Guru Meditation Error of type IllegalInstruction?

Postby kolban » Mon Jul 24, 2017 3:25 pm

When I hit problems like this my technique for debugging is slow and painfull ... I isolate (comment out) sections of logic until I have a minimum environment in which the problem manifests. This removes as much "chaff" from the puzzle as possible. When I have a minimum problem, I then copy the project/code and actually remove the now commented out clutter so that what remains is a source file that is 100% the minimum to recreate the issue ... then I study and test just that by itself. If I then can't make further progress, I package that up with full recreate instructions and as much commentary as possible and make available as either a new defect report on Github (assuming I have a very high confidence that it should work) or else post it to pastebin with a forum post link explaining in as much detail the nature of the issue. My thinking is to make it as easy as possible for potential collaborators to understand the issue I am facing so that they have minimal work to do to understand what my goal is and what I am experiencing ... in addition, I try and provide a fully buildable and runnable sample (with instructions on how to build and run) so that others can attempt to recreate the issue that I am facing.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ESP_Sprite
Posts: 9020
Joined: Thu Nov 26, 2015 4:08 am

Re: Guru Meditation Error of type IllegalInstruction?

Postby ESP_Sprite » Tue Jul 25, 2017 1:40 am

Honestly, can you try if feeding the ESP32 directly from a known-good 3.3V power supply (bypassing any LDOs on the board) with enough decoupling capacitance can work? I'm still 90% sure this is the issue... in practice, it's the only source of illegalinstruction exceptions that pop up in the field. If this is it and you're not looking at it, you're going to be chasing red herrings in software land.

Resch2061
Posts: 40
Joined: Mon May 01, 2017 1:56 pm

Re: Guru Meditation Error of type IllegalInstruction?

Postby Resch2061 » Tue Jul 25, 2017 10:02 am

Okay I think the voltage does seem to be the issue. If I'm reading this right, I'm getting a usage of 0.21a...

Who is online

Users browsing this forum: No registered users and 100 guests