13

I have numerous ESP8266 apps converted to 32 bit. These seem to run fine on the WROVER chips but on the WROOM-32 chips they load and execute, but panic after some time. I get this error:

Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

My code is just flashing an LED (onboard pin 2) every second and watching for UDP packets. Other that this, they are just sitting the execute loop. I have a number of these chips and would like to use them if I can get them to run reliably.

Any hints on how/what to track down would be greatly appreciated.

Thanks.

Tom Lindley
  • 351
  • 1
  • 3
  • 14
  • Which versions of the ESP32 modules are you using, specifically? There are several variants of each series with subtle differences that might matter. It certainly doesn't sound like you are doing anything that is beyond the capabilities of any of the the `WROOM` modules, however, it might be relevant to narrow down the issue. – Mukunda Modell Jan 22 '20 at 07:27
  • Include your code, it is hard to know what went wrong with limited info you provided. One of the possibility is some of the libraries that you used in ESP8266 may not be the right one for ESP32. – hcheung Jan 22 '20 at 10:20
  • I am using a dev board with an ESP-WROOM-32 chip on it. In the platform.ini file I have the following: [env:esp_wroom_02] platform = espressif32 board = esp_wroom_02 framework = arduino monitor_speed = 115200 The only library I am using, besides what Visual Studio Code setup is a JSON library. – Tom Lindley Jan 23 '20 at 17:48
  • The code would be lengthy, at the point of failure, the only thing the code is doing is broadcasting a UDP datagram. It does create a JSON string to send. The code to send the packet is: StaticJsonBuffer<1024> jsonBuffer; JsonObject& root = jsonBuffer.createObject(); BuildJson(root); root["Command"] = (int)RackIdent; char jsonIdent[1024]; root.printTo(jsonIdent); _network->BroadcastPacket(jsonIdent); – Tom Lindley Jan 23 '20 at 17:53
  • And the code in the broadcast packet function is: _udp.beginPacket(_broadcastAddress,_broadcastPort); _udp.write((uint8_t*)buffer,strlen(buffer)+1); _udp.endPacket(); – Tom Lindley Jan 23 '20 at 17:54

4 Answers4

15

The biggest difference between the WROOM and the WROVER chips is that the WROVER integrates an 8 MB "SPI PSRAM" chip on the module along with the ESP32-D0WDQ6. The specs and features of the various ESP32 modules are described in a table at the top of the ESP32 Modules and Boards section of the ESP32 Hardware Reference.

Without knowing more it's hard to say what the exact problem is, however, I suspect it has something to do with memory management. It could also be caused by a race condition as a consequence of the dual-core architecture of the ESP32.

msysmilu
  • 2,015
  • 23
  • 24
Mukunda Modell
  • 824
  • 9
  • 24
8

I think I may have the answer. I have some dormant code (at least I thought it was dormant) around for writing to the display on some NodeMCU chips with a display on them. It turns out that the initialize routine was actually being called. Once I corrected this, the program appears to be working. Once again, I am the victim of my own stupidity. Thanks very much for the help, it got me on the right track.

Tom Lindley
  • 351
  • 1
  • 3
  • 14
8

WROVER integrates an 8 MB "SPI PSRAM" AND it uses 2 GPIOs internally to control that PSRAM, cause it shares the SPI bus for flash. So the WROOM module has two additional GPIOs (16/17).

Michael Sch.
  • 81
  • 1
  • 2
1

The problem is that your code is blocking main task in loop function. You need to create a new task with lower priority or in core 1, so the main task in loop function don't get blocked.

Check how to create task with freertos documentation.