Skip to content

(SOLVED) Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed) ESP32 VSC Platformio #3634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
petervflocke opened this issue Jan 11, 2020 · 9 comments

Comments

@petervflocke
Copy link

petervflocke commented Jan 11, 2020

Hardware:

Board: ESP32 Dev Module node32
IDE name: Platform.io on Visual Studio Code
Computer OS: Ubuntu?

Description:

Decoding Guru Meditation does not provide a place of the issue.

Exception Cause: Not found

0x400d1d90: loop() at /home/peter/Documents/PlatformIO/Projects/monitorv1/src/main.cpp:150 (discriminator 10)
0x40084774: _xt_coproc_exc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/xtensa_vectors.S:1091
0x40086a21: spi_flash_restore_cache at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/spi_flash/cache_utils.c:283
0x400d1d90: loop() at /home/peter/Documents/PlatformIO/Projects/monitorv1/src/main.cpp:150 (discriminator 10)
0x400d1d90: loop() at /home/peter/Documents/PlatformIO/Projects/monitorv1/src/main.cpp:150 (discriminator 10)
0x40084771: _xt_coproc_exc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/xtensa_vectors.S:1090
0x40086a1e: spi_flash_phys2cache at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/spi_flash/flash_mmap.c:466
0x40082b8b: esp_reset_reason_get_hint at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/reset_reason.c:117
0x40088b7d: vQueueDelete at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:1796 (discriminator 1)

The system reads sensor data over simple 433Mhz ASK routine ( RFReceiver or RadioHead ) and updates a web page on ESPAsyncWebServer. There is also a routine to read the time from NTP server.

If I don't initialize 433Mhz radio objects, failure of the WiFi does not influence the system. If WiFi will be available again the system recovers the WiFI connection and works as design.
With an active radio object and failure of the WiFi after few seconds system reboots with guru meditation:

Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)
Core 1 register dump:
PC : 0x400d1d90 PS : 0x00060034 A0 : 0x40084774 A1 : 0x3ffbe7b0
A2 : 0x00000004 A3 : 0x3ffc192c A4 : 0x00000000 A5 : 0x00000010
A6 : 0x00000000 A7 : 0x1300005c A8 : 0x80080f80 A9 : 0x00000001
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x3ffc1c7c A13 : 0x00000000
A14 : 0x3ffc1c78 A15 : 0xffffffff SAR : 0x00000018 EXCCAUSE: 0x00000007
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Core 1 was running in ISR context:
EPC1 : 0x40086a21 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x400d1d90

Backtrace: 0x400d1d90:0x3ffbe7b0 0x40084771:0x3ffbe7d0 0x40086a1e:0x3ffba1f0 0x40082b8b:0x3ffba210 0x40088b7d:0x3ffba230

The reboots happen also even if the transmitter is switched off and actually there is no reason to call any radio method.

I read here1 and here2 that a part of the code within interrupt routine must always be in the ESP32's IRAM - is that correct?

I tried to add IRAM_ATTR to few function handling radio parts without any success.

Question1:

Can i somehow disable (taking into consideration a slowdown of the performance) the caching? Is there something similar in Arduino / Platformio config to disable SPI_MASTER_ISR_IN_IRAM in ESP32 config settings?

Question2:

Or how can I identify a function, which requires to stay in IRAM (if it is the solution of my problem)?

Sketch:

#include <Arduino.h>
#include "main.h"
#include "index.h"
#include "credentials.h"
#include <NTPClient.h>
#include <WiFiUdp.h>
#include <TimeLib.h>
#include <Timezone.h>
#include "WiFi.h"
#include <ESPmDNS.h>
#include "ESPAsyncWebServer.h"
#include <PinChangeInterruptHandler.h>
#include <RFReceiver.h>

void updateJson();
void blink();
void printData(Tdata&);
void printDateTime(Timezone, time_t, const char *);

// Central European Time (Frankfurt, Paris)
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 0);     /// get UTC
TimeChangeRule CEST = {"CEST", Last, Sun, Mar, 2, 120};     // Central European Summer Time
TimeChangeRule CET = {"CET ", Last, Sun, Oct, 3, 60};       // Central European Standard Time
Timezone CE(CEST, CET);
TimeChangeRule *tcr; 

time_t syncNTP();
getExternalTime NtpTime = &syncNTP;

AsyncWebServer server(80);
AsyncEventSource events("/events");

Tdata sensorsData[sensorNumber];
char jsonData[370];

RFReceiver receiver(4);

void setup()
{
  for (int i=0; i<sensorNumber; i++) {
    sensorsData[0].timeStamp = 0;
    sensorsData[0].temperature = 0.0;
    sensorsData[0].humidity = 0.0;
    sensorsData[0].pressure = 0.0;
    sensorsData[0].battery = 0.0;
}
 
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
  delay(1000);
   
  WiFi.begin(ssid, password);
  Serial.setDebugOutput(true);
  PRINTS("Connecting to WiFi ");
  while (WiFi.status() != WL_CONNECTED) {
    PRINTS(".");
    blink();
   }
  PRINTS(" connected\n");
  PRINTS(WiFi.localIP());
  
  if (!MDNS.begin(localDomain)) {
      PRINTS("Error setting up MDNS responder! Program Stoped\n");
      while(1) {
          blink();
      }
  }
  PRINTS("mDNS responder started\n");

  timeClient.begin();
  if (!timeClient.update()) {
    PRINTS("1st NTP Update Failed. Program Stoped\n");
      while(1) {
          blink();
      }    
  };

  setSyncInterval(_setSyncInterval);
  setSyncProvider(NtpTime);


  server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send(200, "text/html", index_html);
  });

  server.on("/favicon.ico", HTTP_GET, [](AsyncWebServerRequest *request) {
      request->send(404);
    });
  
  events.onConnect([](AsyncEventSourceClient *client){
    syncNTP();
    updateJson();
    client->send(jsonData,"data",millis());
  });
  
  server.addHandler(&events);
  server.begin();
  MDNS.addService("http", "tcp", 80);

  receiver.begin();
  PRINT("Max Buf: ", MAX_PACKAGE_SIZE);

}
time_t last_utc=0;

void loop()
{
   uint8_t buf[MAX_PACKAGE_SIZE];
   uint8_t buflen = sizeof(buf);
   uint8_t sensorID;
   byte senderId = 0;
   byte packageId = 0;
  
//PP2
    if (receiver.ready())
    { // (driver.recv(buf, &buflen)) // Non-blocking
      buflen = receiver.recvPackage(buf, &senderId, &packageId);
      // Message with a good checksum received, dump it.
	    #if  DEBUG_ON
         //driver.printBuffer("Got:", buf, buflen);
         PRINT("Buf Len:", buflen); PRINTLN;
         PRINT("Size of TData:", sizeof(Tdata)); PRINTLN;
      #endif
      if (buflen==dataSize) {
        //data = *(Tdata *) buf;
        sensorID=(*reinterpret_cast<Tdata *> (buf)).sensorID;
        memcpy(&sensorsData[sensorID],&buf, sizeof(Tdata));
        PRINT("Sensor ID: ", sensorID); PRINTLN;
        sensorsData[sensorID].timeStamp = now();
        updateJson();
        events.send(jsonData,"data",millis());
        printData(sensorsData[sensorID]);
      }
    }
    if (now()-last_utc >= 1) {
     last_utc = now();
     updateJson();
     events.send(jsonData,"data",millis());
     //printDateTime(CE, last_utc,(timeStatus()==timeSet)? " OK":(timeStatus()==timeNeedsSync)? " Need Sync":" Not Set");

    }
}

void updateJson() {
  time_t  t = CE.toLocal(now(), &tcr);
  time_t t0 = CE.toLocal(sensorsData[0].timeStamp, &tcr);
  time_t t1 = CE.toLocal(sensorsData[1].timeStamp, &tcr);
  time_t t2 = CE.toLocal(sensorsData[2].timeStamp, &tcr);
  sprintf(jsonData,jsonStruc, 
      (timeStatus()==timeSet)? "white":(timeStatus()==timeNeedsSync)? "red":"yellow",
      hour(t), minute(t), second(t), day(t), month(t), year(t),
      hour(t0), minute(t0), second(t0), day(t0), month(t0), year(t0)%100U, 
      sensorsData[0].temperature,
      sensorsData[0].humidity,
      sensorsData[0].pressure,
      sensorsData[0].battery,
      hour(t1), minute(t1), second(t1), day(t1), month(t1), year(t1)%100U,  
      sensorsData[1].temperature,
      sensorsData[1].humidity,
      sensorsData[1].pressure,
      sensorsData[1].battery,
      hour(t2), minute(t2), second(t2), day(t2), month(t2), year(t2)%100U,  
      sensorsData[2].temperature,
      sensorsData[2].humidity,
      (float)sensorsData[0].counter);
}

time_t syncNTP() {
  bool NTPSyncOK=true;
  PRINTS("\nNTP Syncing ... ");
  // WiFi.printDiag(Serial);  
  if (WiFi.isConnected()) {
    NTPSyncOK = timeClient.forceUpdate();
  } else {
      PRINTS("\nRecovering WiFi connection\n");
      //WiFi.mode(WIFI_STA);
      WiFi.begin();
      if (WiFi.isConnected()) {
        NTPSyncOK = timeClient.forceUpdate();
        //WiFi.mode(WIFI_OFF);
      } else {
        PRINTS("\nWIFI failed ...\n");
        NTPSyncOK = false;
      }
  }
  if (NTPSyncOK) {
    PRINTS("NTP Sync OK\n");
    return timeClient.getEpochTime();
  }
  else { 
    PRINTS("NTP Sync Failed\n");
    return 0;
  }
}

void blink() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
}

// --------------------------------
void printData(Tdata& data)
{ 
    PRINT ("Sensor      = ", data.sensorID);    PRINTLN;
    PRINT ("Temperature = ", data.temperature); PRINTS(" *C\n");
    PRINT ("Pressure    = ", data.pressure);    PRINTS(" hPa\n");
    PRINT ("Humidity    = ", data.humidity);    PRINTS(" %\n");
    PRINT ("Battery     = ", data.battery);     PRINTS(" V\n");
    PRINTS("Time        = "); printDateTime(CE, data.timeStamp,(timeStatus()==timeSet)? " OK":(timeStatus()==timeNeedsSync)? " Need Sync":" Not Set");
    PRINT ("Counter     = ", data.counter);     PRINTLN;
}

void printDateTime(Timezone tz, time_t utc, const char *descr)
{
    char buf[40];
    char m[4];    // temporary storage for month string (DateStrings.cpp uses shared buffer)
    TimeChangeRule *tcr;        // pointer to the time change rule, use to get the TZ abbrev

    time_t t = tz.toLocal(utc, &tcr);
    strcpy(m, monthShortStr(month(t)));
    sprintf(buf, "%.2d:%.2d:%.2d %s %.2d %s %d %s",
        hour(t), minute(t), second(t), dayShortStr(weekday(t)), day(t), m, year(t), tcr -> abbrev);
    PRINTS(buf); PRINTS(descr); PRINTLN;
}

Sketch main.h:

#include <Arduino.h>
#define  DEBUG_ON 1

#define localDomain "pogoda"
#define _setSyncInterval 15


typedef struct 
{
  float temperature;
  float humidity;
  float pressure;
  float battery;
  long  counter;
  uint8_t  sensorID; 
  long  dummy;
  time_t timeStamp;
} Tdata;

const char jsonStruc[] PROGMEM = R"rawliteral(
{"XC1":"%s",
"clock":"%02d:%02d:%02d &nbsp; %02d:%02d:%02d",
"time0":"%02d:%02d:%02d &nbsp; %02d:%02d:%02d",
"temp0":"%.2f",
"hum0" :"%.0f",
"pres0":"%.0f",
"bat0" :"%.2f",
"time1":"%02d:%02d:%02d &nbsp; %02d:%02d:%02d",
"temp1":"%.2f",
"hum1" :"%.0f",
"pres1":"%.0f",
"bat1" :"%.2f",
"time2":"%02d:%02d:%02d &nbsp; %02d:%02d:%02d",
"temp2":"%.2f",
"hum2" :"%.0f",
"pres2":"%.0f"}
)rawliteral";

const uint8_t sensorNumber = 3;
const uint8_t dataSize = 21; // data frame size

#if  DEBUG_ON
#define PRINT(s, v) { Serial.print(s); Serial.print(v); }    
#define PRINTX(s, v) { Serial.print(s); Serial.print(v, HEX); }  
#define PRINTS(s) Serial.print(s)   
#define PRINTLN Serial.println()
#else
#define PRINT(s, v)   
#define PRINTX(s, v)  
#define PRINTS(s)     
#define PRINTLN
#endif

Sketch index.h:

const char index_html[] PROGMEM = R"rawliteral(
<!DOCTYPE html>
<html lang=pl>
<head>
....
</body>
</html>
)rawliteral";
@petervflocke petervflocke changed the title Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed) ESP32 ARDUINO IDE VSC Platformio Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed) ESP32 VSC Platformio Jan 11, 2020
@petervflocke
Copy link
Author

petervflocke commented Jan 12, 2020

Ok, it can be closed.
Solution: switch to radiohead from adafruit: https://github.com/adafruit/RadioHead
and add ESP32 handling: #define INTERRUPT_ATTR IRAM_ATTR for RH_PLATFORM == RH_PLATFORM_ESP32 by changing the code in RH_ASK.cpp file as follow:

FROM:

#if (RH_PLATFORM == RH_PLATFORM_ESP8266)
    // interrupt handler and related code must be in RAM on ESP8266,
    // according to issue #46.
    #define INTERRUPT_ATTR ICACHE_RAM_ATTR
#else
    #define INTERRUPT_ATTR
#endif

TO:

#if (RH_PLATFORM == RH_PLATFORM_ESP8266)
    // interrupt handler and related code must be in RAM on ESP8266,
    // according to issue #46.
    #define INTERRUPT_ATTR ICACHE_RAM_ATTR
#elif (RH_PLATFORM == RH_PLATFORM_ESP32)
    #define INTERRUPT_ATTR IRAM_ATTR 
#else
    #define INTERRUPT_ATTR
#endif

@petervflocke petervflocke changed the title Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed) ESP32 VSC Platformio (SOLVED) Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed) ESP32 VSC Platformio Jan 12, 2020
@minhaz005
Copy link

did you get any solution to this problem... i am suffering the same problem...
i have integrate lua on esp32 project for user scripting ... now when user event occur on mqtt or rf loop... few moments its getting restart...after that work ok then again restart... i used vtaskdelay() and yield() function ....now still the same problem

IQ3/mtbd_haa/cmd/DO1
IOSTAT EVENT=1191
IQ3/mtbd_haa/cmd/DO1
Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)
Core 1 register dump:
PC : 0x40080f92 PS : 0x00060034 A0 : 0x800810a1 A1 : 0x3ffbe750
A2 : 0x00000001 A3 : 0x0000000c A4 : 0x000000ba A5 : 0x3ffbe760
A6 : 0x00000008 A7 : 0x00000001 A8 : 0x3f408338 A9 : 0x000000d0
A10 : 0x116e29a7 A11 : 0x3ffc183c A12 : 0x000000ad A13 : 0x3ffc1cfc
A14 : 0x00000003 A15 : 0x00060023 SAR : 0x0000001c EXCCAUSE: 0x00000007
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Core 1 was running in ISR context:
EPC1 : 0x4008734f EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x40080f92

Backtrace: 0x40080f92:0x3ffbe750 0x4008109e:0x3ffbe780 0x40081125:0x3ffbe7b0 0x40085099:0x3ffbe7d0 0x4008734c:0x3ffba190 0x400834b3:0x3ffba1b0 0x400894a5:0x3ffba1d0

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

rst:0x3 (SW_RESET),boot:0x13 (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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
Contents of file 'if count==nil then count=0;end;count=count+1;delay(1000);print(count);print("\n->Sec Up Lua!");function rfevent() print(RFCODE);delay(1);end;function ioevent() print("IOSTAT EVENT=");print(IOSTAT);delay(10); end;function mqevent() print(MQMSG);print("\r\n");print(MQTOPIC);print("\r\n")delay(10);end;function timerevent()print("\nMin Timer Called\r\n"); delay(10);end;function alarmevent() print(ALARMMSG);delay(10);end; function thevent() print(HUMIDITY);print(TEMPERATURE);delay(10);end;
Configurarion Found!

@atanisoft
Copy link
Collaborator

@minhaz005 Perhaps open your own issue and provide actual code. This error typically will only occur if you have an interrupt routine that runs while accessing flash (ie:spiffs)

@muhaimin365
Copy link

did you get any solution ? I'm also facing same problem.
I want to make mesh communication between the lora device by using ESP32 module. so I want to make routing table for each node.
the Arduino sketch that attempts to talk to all other nodes in the mesh. Each node sends its routing information to every other node. The process of sending data and receiving acknowledgements lets a node determine which nodes it can successfully communicate with directly. This is how each node builds up it's routing table.

`
#include <EEPROM.h>
#include <RHRouter.h>
#include <RHMesh.h>
#include <RH_RF95.h>
#define RH_HAVE_SERIAL
#define LED 9
#define N_NODES 3
#define INTERRUPT_ATTR IRAM_ATTR

uint8_t nodeId;
uint8_t routes[N_NODES]; // full routing table for mesh
int16_t rssi[N_NODES]; // signal strength info

// Singleton instance of the radio driver
RH_RF95 rf95;

// Class to manage message delivery and receipt, using the driver declared above
RHMesh *manager;

// message buffer
char buf[RH_MESH_MAX_MESSAGE_LEN];

int freeMem() {
return ESP.getFreeHeap();
}

void setup() {
randomSeed(analogRead(0));
pinMode(LED, OUTPUT);
Serial.begin(115200);
while (!Serial) ; // Wait for serial port to be available

nodeId = EEPROM.read(0);
if (nodeId > 10) {
Serial.print(F("EEPROM nodeId invalid: "));
Serial.println(nodeId);
nodeId = 1;
}
Serial.print(F("initializing node "));

manager = new RHMesh(rf95, nodeId);

if (!manager->init()) {
Serial.println(F("init failed"));
} else {
Serial.println("done");
}
rf95.setTxPower(23, false);
rf95.setFrequency(915.0);
rf95.setCADTimeout(500);

// Possible configurations:
// Bw125Cr45Sf128 (the chip default)
// Bw500Cr45Sf128
// Bw31_25Cr48Sf512
// Bw125Cr48Sf4096

// long range configuration requires for on-air time
boolean longRange = false;
if (longRange) {
RH_RF95::ModemConfig modem_config = {
0x78, // Reg 0x1D: BW=125kHz, Coding=4/8, Header=explicit
0xC4, // Reg 0x1E: Spread=4096chips/symbol, CRC=enable
0x08 // Reg 0x26: LowDataRate=On, Agc=Off. 0x0C is LowDataRate=ON, ACG=ON
};
rf95.setModemRegisters(&modem_config);
if (!rf95.setModemConfig(RH_RF95::Bw125Cr48Sf4096)) {
Serial.println(F("set config failed"));
}
}

Serial.println("RF95 ready");

for(uint8_t n=1;n<=N_NODES;n++) {
routes[n-1] = 0;
rssi[n-1] = 0;
}

Serial.print(F("mem = "));
Serial.println(freeMem());
}

const __FlashStringHelper* getErrorString(uint8_t error) {
switch(error) {
case 1: return F("invalid length");
break;
case 2: return F("no route");
break;
case 3: return F("timeout");
break;
case 4: return F("no reply");
break;
case 5: return F("unable to deliver");
break;
}
return F("unknown");
}

void updateRoutingTable() {
for(uint8_t n=1;n<=N_NODES;n++) {
RHRouter::RoutingTableEntry *route = manager->getRouteTo(n);
if (n == nodeId) {
routes[n-1] = 255; // self
} else {
routes[n-1] = route->next_hop;
if (routes[n-1] == 0) {
// if we have no route to the node, reset the received signal strength
rssi[n-1] = 0;
}
}
}
}

// Create a JSON string with the routing info to each node
void getRouteInfoString(char *p, size_t len) {
p[0] = '\0';
strcat(p, "[");
for(uint8_t n=1;n<=N_NODES;n++) {
strcat(p, "{"n":");
sprintf(p+strlen(p), "%d", routes[n-1]);
strcat(p, ",");
strcat(p, ""r":");
sprintf(p+strlen(p), "%d", rssi[n-1]);
strcat(p, "}");
if (n<N_NODES) {
strcat(p, ",");
}
}
strcat(p, "]");
}

void printNodeInfo(uint8_t node, char *s) {
Serial.print(F("node: "));
Serial.print(F("{"));
Serial.print(F("""));
Serial.print(node);
Serial.print(F("""));
Serial.print(F(": "));
Serial.print(s);
Serial.println(F("}"));
}

void loop() {

for(uint8_t n=1;n<=N_NODES;n++) {
if (n == nodeId) continue; // self

updateRoutingTable();
getRouteInfoString(buf, RH_MESH_MAX_MESSAGE_LEN);

Serial.print(F("->"));
Serial.print(n);
Serial.print(F(" :"));
Serial.print(buf);

// send an acknowledged message to the target node
uint8_t error = manager->sendtoWait((uint8_t *)buf, strlen(buf), n);
if (error != RH_ROUTER_ERROR_NONE) {
  Serial.println();
  Serial.print(F(" ! "));
  Serial.println(getErrorString(error));
} else {
  Serial.println(F(" OK"));
  // we received an acknowledgement from the next hop for the node we tried to send to.
  RHRouter::RoutingTableEntry *route = manager->getRouteTo(n);
  if (route->next_hop != 0) {
    rssi[route->next_hop-1] = rf95.lastRssi();
  }
}
if (nodeId == 1) printNodeInfo(nodeId, buf); // debugging

// listen for incoming messages. Wait a random amount of time before we transmit
// again to the next node
unsigned long nextTransmit = millis() + random(3000, 5000);
while (nextTransmit > millis()) {
  int waitTime = nextTransmit - millis();
  uint8_t len = sizeof(buf);
  uint8_t from;
  if (manager->recvfromAckTimeout((uint8_t *)buf, &len, waitTime, &from)) {
    buf[len] = '\0'; // null terminate string
    Serial.print(from);
    Serial.print(F("->"));
    Serial.print(F(" :"));
    Serial.println(buf);
    if (nodeId == 1) printNodeInfo(from, buf); // debugging
    // we received data from node 'from', but it may have actually come from an intermediate node
    RHRouter::RoutingTableEntry *route = manager->getRouteTo(from);
    if (route->next_hop != 0) {
      rssi[route->next_hop-1] = rf95.lastRssi();
    }
  }
}

}

}`

but when i run the code, i got error as i mentioned in the picture below
Capture

. what is the solution for it?

@petervflocke
Copy link
Author

If you are asking me, then I would suggest to decode the guru mediation, to see where the issue comes from.
For me the solution is presented in previous post.

For guru mediation please refer to:

  1. https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/fatal-errors.html
  2. https://www.esp32.com/viewtopic.php?t=13615

Best
Peter

@muhaimin365
Copy link

If you are asking me, then I would suggest to decode the guru mediation, to see where the issue comes from.
For me the solution is presented in previous post.

For guru mediation please refer to:

  1. https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/fatal-errors.html
  2. https://www.esp32.com/viewtopic.php?t=13615

Best
Peter

thank you so much sir for you your quick response

@kanakamedalasumanth
Copy link

@minhaz005 Perhaps open your own issue and provide actual code. This error typically will only occur if you have an interrupt routine that runs while accessing flash (ie:spiffs)

Exactly, I have an interrupt routine and on parallel when I try to write to SPIFF it's getting crashed. What might be the solution? For temporarily I am disabling timerAttachInterrupt while accessing the SPIFF and enabling back after doing the operation. Does anyone suggest something better?

@aidanbusby123
Copy link

One thing I've found is that if you press on the CPU, it gives you that error.

@Hamza123-eng
Copy link

if you are using the interrupt then you have to assign the IRAM_ATTR to your ISR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants