Skip to content
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

Reboot loop with latest version #900

Closed
mitchsf opened this issue Dec 4, 2017 · 25 comments
Closed

Reboot loop with latest version #900

mitchsf opened this issue Dec 4, 2017 · 25 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@mitchsf
Copy link

mitchsf commented Dec 4, 2017

Windows 10, ESP32 DevKitC

With the latest core just installed on a new pc, working programs reboot in a loop. The first line hopefully indicates the issue. That is not a path or user on my pc.

I'm guessing that this happened because it is a new installation, rather than an update.

Thanks in advance for help with this.

assertion "res == pdTRUE" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/./cpu_start.c", line 368, function: start_cpu0_default
abort() was called at PC 0x400dde57 on core 0

Backtrace: 0x40088168:0x3ffe3b90 0x40088267:0x3ffe3bb0 0x400dde57:0x3ffe3bd0 0x40082c7a:0x3ffe3c00 0x40082e24:0x3ffe3c30 0x4007891e:0x3ffe3c50 0x40078987:0x3ffe3c80 0x40078aca:0x3ffe3cb0 0x40078bf2:0x3ffe3e70 0x40007c31:0x3ffe3eb0 0x4000073d:0x3ffe3f20

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

rst:0xc (SW_CPU_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:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078ad0

@mitchsf
Copy link
Author

mitchsf commented Dec 4, 2017

Exception decoder:

Decoding 11 results
0x40088168: invoke_abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/./panic.c line 572
0x40088267: abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/./panic.c line 572
0x400dde57: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c line 63 (discriminator 8)
0x40082c7a: start_cpu0_default at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/./cpu_start.c line 368 (discriminator 1)
0x40082e24: call_start_cpu0 at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/./cpu_start.c line 210

@me-no-dev
Copy link
Member

can you get it down to minimal reproducible sketch? What features are you using? Exception seem to happen really early

@mitchsf
Copy link
Author

mitchsf commented Dec 4, 2017

I'm working on it. Sketch is failing somewhere in Setup()

@me-no-dev
Copy link
Member

from the backtrace above, it does not even get to setup :) probably out of heap

@me-no-dev
Copy link
Member

stack sorry

@mitchsf
Copy link
Author

mitchsf commented Dec 4, 2017

Removed all code in loop and setup, and it doesn't fail. With setup code, it goes back to a reset loop. I'll work to figure out where it's failing.

@mitchsf
Copy link
Author

mitchsf commented Dec 4, 2017

Removing sections of code clears the issue, but any one of several sections, so possibly that does indicate a problem with the stack. Going back to the old pc with a version not more than 2-4 weeks old, the original sketch compiles and runs perfectly.

Is there a way to further debug this from here? Can the stack size be increased?

@me-no-dev
Copy link
Member

depends which one :) can you please post some code that shows the issue? I need something to work with

@stickbreaker
Copy link
Contributor

@me-no-dev are Global variables allocated in the task's Stack space? Maybe @mitchsf has a few large structures pre-allocated that fill Stack. The Default Arduino task has a 8k stack?

Chuck.

@mitchsf
Copy link
Author

mitchsf commented Dec 4, 2017

I'm trying to put something together that crashes, without having to deal with some modified libraries.

@mitchsf
Copy link
Author

mitchsf commented Dec 4, 2017

Here is a mess of code that compiles, and demonstrates the problem.

One hint - when ledcWrite() is removed from ledIndicator(), the sketch runs successfully.

`
//#include <SPI.h>
//#include <WiFi.h>
//#include <NTPClientOne.h>
//#include <TimeZoneOne.h>
//#include <TimeLib.h>
//#include <TinyGPS++.h>
//#include <WiFiUdp.h>
//#include <Preferences.h>
//#include <Bounce.h> // use the original Bounce library included with Bounce2
//#include <Adafruit_Sensor.h>
//#include <Adafruit_BME280.h>
//#include <SimpleTimer.h>
//#include <FastLED.h>

//#define DEBUG

hw_timer_t * timer = NULL;
hw_timer_t * toneTimer = NULL;
portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED;

const byte fRev = 1; // firmware revision

//WiFiServer server(80);
//WiFiClient client;
//WiFiUDP ntpUDP;
//IPAddress Ip(192, 168, 13, 1); // ip address for AP

const int udpSyncInterval = 60000; // NTP sync every 10 minutes (ms)
const int timeSyncInterval = 30; // seconds to sync with time server (seconds)

// You can specify the time server pool and the offset, (in seconds)
// additionaly you can specify the update interval (in milliseconds).
// NTPClientOne timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000);
//NTPClientOne timeClient(ntpUDP, "us.pool.ntp.org", 0, udpSyncInterval);

HardwareSerial Serial1(1);
#define gpsRx 13
#define gpsTx 2

#define serialGPS Serial1
//TinyGPSPlus gps;

struct tmt { // used for digit change effects
byte hour10;
byte hour1;
byte minute10;
byte minute1;
byte second10;
byte second1;
byte tenth;
byte hundredth;
};
tmt currTime;
tmt oldTime;
tmt *switchTime;

// initialize and instantiate tz object
//TimeZoneOne tz;
//TimeChangeRule dSt; // = {};
//TimeChangeRule sTd; // = {};

// set variables for FastLED
#define DATA_PIN 15
#define CLOCK_PIN 4
#define COLOR_ORDER BGR
#define LED_TYPE APA102
#define NUM_LEDS 12
#define NUM_LEDS_TOP 8
/*
typedef struct colorRGBB {
uint8_t red, green, blue, brightness;
} colorRGBB;

colorRGBB RGB[NUM_LEDS];
*/
//struct CRGB leds[NUM_LEDS];

const byte clockPin = 26; // note that clock, data, and latch ports are written to directly but set using Arduino
const byte dataPin = 27;
const byte latchPin = 14; // latch
const byte blankPin = 25; // blank
const byte hvEnable = 32; //******************************* not connected
const byte tonePin = 12;
const byte rgbLED[3] = {18, 17, 16}; // RGB LED pin numbers, red-green-blue
const byte lightPin = 33;
const byte buttonPin = 34;
const byte pirPin = 35; // *********************************** moved to a different pin

byte gate = 0; // used to transfer program flow from loop() to appropriate function
const byte off = 10;
long unsigned int menuTimeout;
unsigned long int overrideTime = 0;
boolean sleepNow = false;
boolean sleepOverride = false;
boolean finishAP = false; // used by anti-Poison timer
boolean poisonFlag = false;
boolean timeFlag = true;
boolean setFlag = true;
boolean LEDIndFlag = true; // indicator LEDs state
byte displayNum[8] = {10, 10, 10, 10, 10, 10, 10, 10};
const byte ledOrd[11] = {7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10}; // RGB LED order
byte neons;
byte ledBright;
byte ledMode;
byte NUM_LEDS_USED = 8; // LEDs used for effects
byte referenceEnable = false; // 0=none, 1=gps, 2=MOD-6 RPTR
int referenceBaudRate;
byte tzOffsetDirection = 0;
time_t lTime; // local time
unsigned long int rptrTime;
long int rptrTemp32 = 20000;
long int rptrAge;
boolean lightLevel = false; // low light level indicator for light sensor
static byte lastMinute = 0, lastHour = 0; // for anti-poison
byte overrideBrightLevel = 0;
byte onBrightLevel = 0;
byte currentOverride = 0;
boolean tlNeon = LOW, blNeon = LOW, tmNeon = LOW, bmNeon = LOW, trNeon = LOW, brNeon = LOW;
boolean pirNow = false; // in PIR?
boolean pirOverride = false; // override while in menus
volatile byte h10 = 0, h1 = 0, m10 = 0, m1 = 0, s10 = 0, s1 = 0, tSec = 0;
volatile boolean hBlank, mBlank, sBlank, split, hBlank12;
volatile byte tick10;
volatile byte tick100;
byte xArray[8] = {10, 10, 10, 10, 10, 10, 10, 10};
byte neOnOff = false;
int setUpDown1 = 0; // set menu
int rgbColor[29][3];
//int (*hours)(); // pointer to hour() or hourFormat12()
static byte rgbStat[8] = {0, 0, 0, 0, 0, 0, 0, 0};
static byte s = 0; // for FastLED waves
boolean wSensor = false; // weather sensor
byte xBlink = 0;
bool useNTP = false;
bool ntpStatus = false;
bool wifiStatus = false;
int wifiCheck = 5000; // check wifi connection interval
bool boot = true;

const int gpsTimeAge = 1000; // oldest packet to sync
bool gpsStatus = false;
unsigned long int startTime = millis();
long int rOffset; // timezone offset
long int tOffset; // DST offset

boolean needParameters = false;
boolean needWiFi = false;
String xnetwork;
String xpassword;
const byte maxFields = 10; // maximum number of fields for access point config
int iFieldTag;
const int startFieldTag = 10; // tag used for HTML fields
String fieldTag;
byte wTries = 0; // count number of tries to connect
byte maxTries = 10; // maximum number of tries to connect to WiFi before indicating error (still keep trying)
long int connectDelay = 5000; // time between tries to connect

byte xType;
String xFieldPrompt;
int xNumDefault;
String xTextDefault;
String xFieldOptions[20];
byte xValid[30];
bool xReturnPrompts;

// Setup Options
struct fields {
byte type; // 0=combo, 1=radio, 2=text, 3+=custom
String fieldPrompt;
String textDefault; // used for text field
byte numDefault; // default element for dropdown
String heading; // displays before field
String fieldOptions[20]; // Only 30 alpha prompts are allowed, should be enough. If not specified, valid[] value is prompt. For fieldOptions[], use valid[] range.
byte valid[30]; // if valid[2] = 255, valid[0] and valid[1] are low and high range. otherwise, valid[0]-valid[100] specify individual selections as 1,4,7,12, etc., and set last element to 254
bool returnPrompts; // if true, return value is fieldPrompt
String returnVal; // returned value
};
fields settings[maxFields];
byte numberFields;

int xVersion = 1; // software version
int xStartAP = false;
String xApName = "ZEV-3";
int xNtpOrGps = false; // default NTP = false
String xSsid = "";
String xPassword = "";
String xNtpServer = "us.pool.ntp.org";

const int maxPresets = 61; // number of settings
const byte presetDefault[maxPresets + 1] = {0, 0, 1, 1, 4, 4, 8, 7, 0, 0, 0, 2, 2, 4, 1, 0, 0, 0, 2, 0, 4, 1, 0, 0, 0, 2, 0, 4, 1, 0, 1, 0, 0, 0, 0, 0,
3, 2, 1, 2, 1, 1, 11, 1, 1, 2, 1, 0, 0, 0, 6, 6, 0, 1, 1, 1, 0, 1, 50, 30, 1
}; // initial default settings
byte preset[maxPresets + 1]; // presets read from EEPROM
const byte refreshRate = 10; // refresh rate for display, in ms - programmatically changed during fades
const byte fadeRefreshRate = 2; // rate while in fade or vibrate digit change
byte currRefreshRate = refreshRate; // to start
const byte timeReference = 1; // difference from GPS to reset RTC in seconds
const byte ledLevel[10] = {0, 5, 20, 40, 60, 80, 100, 120, 150, 255}; // RGB LED brightness levels
byte ledBr = 31;
byte bLevel;
const int nixieLevel[10] = {0, 8, 8, 45, 81, 108, 135, 162, 189, 255}; // Nixie brightness levels - note that levels 1 and 2 are the same, see option 5
const unsigned long int nixieFixDuration = 300000; // anti-poison duration = 5 minutes
const int lightLow = 0; // light sensor levels
const int lightHigh = 4032;
const int lightDuration = 10000; // wait period before restoring brightness level changed by sensor
const long unsigned int antiRunOpt[] = {5000, 10000, 60000, 600000}; // anti-poison run time
const int nixieBlinkInterval = 200;

const byte scrollSpeed = 80;
const int dtHold = 1500; // date and weather hold
const byte rebounceRate = 150;
const byte rgbRebounceRate = 120;
const int pirThreshhold = 1000;
const long unsigned int pirTime[10] = {0, 10000, 200000, 30000, 60000, 300000, 600000, 900000, 6000000, 12000000};
const int ledBlinkInterval = 500;
//const int rgbCorrect[3] = {0, 0, 0}; // Red-Green-BLue used to balance RGB LED brightness
const byte ledRgbUpdate = 50; // how often we update RGB effects - should be just fast enough for smooth transitions
const unsigned long int menuReset = 120000; // reset time for no button presses while in menus, in ms
const byte noSyncCount = 5; // number of tries to sync external source at one each minute, before setting blue blink indicator

// temperature, pressure, humidity
//Adafruit_BME280 bme; // I2C address is 0x76 set in library

// instantiate timers
//SimpleTimer sleepButton; // display sleep override timer
//SimpleTimer pir; // pir sensor

//Bounce button = Bounce(buttonPin, 120);

//Preferences nvs;

int rgbRefreshLow = 30; // these parameters smooth out fades - APA102 only has 31 brightness levels
int rgbRefreshHigh = 60;
byte rgbRefreshThreshhold = 12;
int rgbRefresh = rgbRefreshLow;

/----------------------------------------------------------------------
upTick() ISR
----------------------------------------------------------------------/
void IRAM_ATTR upTick() { // ISR IRAM_ATTR
tick100++;
tick10 = tick100 / 10;
if (tick100 > 99) tick100 = 0; // just in case
if (tick10 > 9) tick10 = 0;
}
/
----------------------------------------------------------------------*
toneOff() ISR
----------------------------------------------------------------------/
void IRAM_ATTR toneOff() { // ISR IRAM_ATTR
timerAlarmDisable(toneTimer);
ledcWriteTone(4, 0);
}
/
----------------------------------------------------------------------*
Initialize
----------------------------------------------------------------------*/

void setup()
{

#ifdef DEBUG
Serial.begin(115200);
delay(500);
#endif

// FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);
/*
timer = timerBegin(0, 80, true); // initialize timer - timer_id = 0; divider=80; countUp = true;
timerAttachInterrupt(timer, &upTick, true); // edge = true
timerAlarmWrite(timer, 10000, true); //10 ms

toneTimer = timerBegin(1, 80, true); // initialize timer - timer_id = 0; divider=80; countUp = true;
timerAttachInterrupt(toneTimer, &toneOff, true); // edge = true
*/
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(latchPin, OUTPUT);
pinMode(hvEnable, OUTPUT);
pinMode(DATA_PIN, OUTPUT);
pinMode(CLOCK_PIN, OUTPUT);
pinMode(lightPin, INPUT);
pinMode(pirPin, INPUT);
pinMode(buttonPin, INPUT);

// if (bme.begin()) wSensor = true; // temperature sensor

delay(1000); // give it some time
// button.update(); // reset

//if (adjButtonDown.read() == LOW && adjButtonUp.read() == LOW) EEPROM.write(0, 255); // hold SW3 and SW4 while applying power to reset default settings

if (xStartAP) { // AP or client
needParameters = true;
needWiFi = false;
// startAP();
}
else {
ledIndicator(2, 0, 0, 0, 0, 0); // start red blink for connecting to WiFi or GPS
needParameters = false;
needWiFi = true;
}

if (preset[33] == 0) { // use only for RTC with no external sync
// setSyncProvider(RTC.get); // get RTC time
// if (timeStatus() != timeSet) clockReset(B1111); // can't find RTC - stop and blink - bad!!
}

// setSyncInterval(timeSyncInterval);

clearD();
getTime();
setTZOffset();
sleepMode();
brightLevel();
}

/----------------------------------------------------------------------
Main Loop
----------------------------------------------------------------------*/
void loop()
{
}

/----------------------------------------------------------------------
Get time
----------------------------------------------------------------------*/
void getTime()
{

}

/----------------------------------------------------------------------
Get GPS NMEA Data
----------------------------------------------------------------------*/
void readGPS(unsigned long int ms)
{

}

/----------------------------------------------------------------------
Adjust RTC to Reference
----------------------------------------------------------------------*/
void adjustRTCtoReference(byte timeR)
{

}

/----------------------------------------------------------------------
getGPS
----------------------------------------------------------------------*/
void getGPS()
{

}

/----------------------------------------------------------------------
Set UTC and Timezone Offsets
----------------------------------------------------------------------*/
void setTZOffset()
{

}

/----------------------------------------------------------------------
Display
----------------------------------------------------------------------*/
void displayD(boolean useTime, boolean hBlank, boolean mBlank, boolean sBlank, boolean tBlank)
{

}

/----------------------------------------------------------------------
change effect
----------------------------------------------------------------------*/
void changeEffect(boolean st)
{

}

/----------------------------------------------------------------------
clearD clear display
----------------------------------------------------------------------*/
void clearD() {
setNeons(0); // clear neons
for (byte x = 0; x < 8; x++) displayNum[x] = off;
displayD(false, false, false, false, false); // clear display
}

/----------------------------------------------------------------------
Shift one bit of data to HV5530s
----------------------------------------------------------------------*/
void shiftOut1(boolean val, boolean fade)
{
if (val == LOW || !fade) digitalWrite(dataPin, LOW);
else digitalWrite(dataPin, HIGH);
delayMicroseconds(100);
digitalWrite(clockPin, HIGH);
delayMicroseconds(400);
digitalWrite(clockPin, LOW);
delayMicroseconds(100);
}

/----------------------------------------------------------------------
Shift ten bits of data to HV5530s
----------------------------------------------------------------------*/
void shiftOut10(byte val)
{
for (int i = 10; i > 0; i--) {
if (displayNum[val] == i - 1) digitalWrite(dataPin, HIGH);
else digitalWrite(dataPin, LOW);
delayMicroseconds(100);
digitalWrite(clockPin, HIGH);
delayMicroseconds(400);
digitalWrite(clockPin, LOW);
delayMicroseconds(100);
}

}

/----------------------------------------------------------------------
RGB Menu
----------------------------------------------------------------------*/
void rgbMenu()
{

}

/----------------------------------------------------------------------
Scroll Date and Temperature
----------------------------------------------------------------------*/
void scrollDate()
{

}

/----------------------------------------------------------------------
Period override
----------------------------------------------------------------------*/
void sleepMode() {

}

/----------------------------------------------------------------------
Anti-poison
----------------------------------------------------------------------*/
void antiPoison() {

}

/----------------------------------------------------------------------
Neons
----------------------------------------------------------------------*/
void setNeons(int xneons) {

}
/----------------------------------------------------------------------
GPS Baud Rate
----------------------------------------------------------------------*/
int setBaud(int bTemp)
{

}
void ledIndicators(byte xBlue, byte xGreen, byte xRed) // 0=off, 1=on, 2=blink 3=current state
{
return;
}
/----------------------------------------------------------------------
Set Indicator LEDs
----------------------------------------------------------------------*/
void ledIndicator(byte xRed, byte redLevel, byte xGreen, byte greenLevel, byte xBlue, byte blueLevel) // 0=off, 1=on, 2=blink 3=current state, level = 0-255
{
static unsigned long int lastTime = 0;
static bool changeState = false;
static boolean lastLEDState = true;
static boolean blinkState = LOW;
static byte blinker[3];
static bool ledU = false;
static byte rgbLevel[3];

blinker[2] = (xBlue == 3 ? blinker[2] : xBlue); // retain values if update, before deciding whether to leave
blinker[1] = (xGreen == 3 ? blinker[1] : xGreen);
blinker[0] = (xRed == 3 ? blinker[0] : xRed);

if (xRed != 3) rgbLevel[0] = redLevel;
if (xGreen != 3) rgbLevel[1] = greenLevel;
if (xBlue != 3) rgbLevel[2] = blueLevel;

if (LEDIndFlag == false) { // turn off LEDs
if (lastLEDState == true) {
for (byte x = 0; x < 3; x++) ledcWrite(x, 256);
lastLEDState = false;
}
return;
}
else lastLEDState = true;

if (millis() - lastTime >= ledBlinkInterval) {
ledU = !ledU;
for (byte x = 0; x < 3; x++) {
if (blinker[x] == 2) {
if (blinkState == LOW) ledcWrite(x, 256);
else ledcWrite(x, rgbLevel[x]);
changeState = true;
lastTime = millis();
}
else if (blinker[x] == 0) ledcWrite(x, 256);
else if (blinker[x] == 1) ledcWrite(x, rgbLevel[x]);

}

}
if (changeState)
{
blinkState = !blinkState;
changeState = false;
}
}

/----------------------------------------------------------------------
Get ambient light level
----------------------------------------------------------------------*/
int lightSample() {

return map(analogRead(lightPin), lightLow, lightHigh, 0, 50);
}

/----------------------------------------------------------------------
Get Temperature
----------------------------------------------------------------------*/
int getTemperature(byte xT) {

return 0;
}

/----------------------------------------------------------------------
Beep
----------------------------------------------------------------------*/
void beep(int freq, int dur) {
// tone(zTone, freq, dur);
}

/----------------------------------------------------------------------
PIR Sensor
----------------------------------------------------------------------*/
void setPIR() {

}

/----------------------------------------------------------------------
Nixie Brightness
----------------------------------------------------------------------*/
void brightLevel() {

}

/----------------------------------------------------------------------
Clock Reset
----------------------------------------------------------------------*/
void clockReset(byte pattern) {

}
/----------------------------------------------------------------------
Weather sensor BME280
----------------------------------------------------------------------*/
unsigned long int weather(byte sFunction, byte scale) {

return 0;
}

/----------------------------------------------------------------------
Blink LED
----------------------------------------------------------------------*/
void blinkLED(byte blinkRate) {

}

/----------------------------------------------------------------------
stepNixies() used at startup
----------------------------------------------------------------------*/
void stepNixies() {

}

`

@mitchsf
Copy link
Author

mitchsf commented Dec 9, 2017

Any updates on this? I went back to a two week old version, and everything works. Thanks.

@rhyslbw
Copy link

rhyslbw commented Mar 6, 2018

Have you tried reflashing using esptool erase_flash?

@everslick
Copy link
Contributor

@mitchsf Is this issue still relevant or did you find a solution in the meantime? Also please use the correct MARKDOWN syntax for code snippets (three ticks before and after source code).

@daduke
Copy link

daduke commented May 29, 2018

commit 600f4c4 broke it.

@mitchsf
Copy link
Author

mitchsf commented May 29, 2018

Sorry, I have not tried it again with a newer release.

@mitchsf
Copy link
Author

mitchsf commented Jan 2, 2019

I just tried with the latest release, and the problem persists. Sketch works perfectly using an older version. The sketch uses 25% of program storage space, and 13% of dynamic memory.

The error seems to be related to calling the WiFi.h library, and it is using the correct, ESP32 version. When in the reboot loop, Serial.print statements don't work reliably so it is impossible (for me) to debug further. It seems like variables are corrupted, but that is just a suspicion.

Below is the latest result from the exception decoder.

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:952
load:0x40078000,len:6084
load:0x40080000,len:7936
entry 0x40080310
assertion "err == ESP_OK" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/crosscore_int.c", line 93, function: esp_crosscore_int_init
abort() was called at PC 0x400df637 on core 0

Backtrace: 0x40090464:0x3ffe3b80 0x40090667:0x3ffe3ba0 0x400df637:0x3ffe3bc0 0x400e068d:0x3ffe3bf0 0x400836fc:0x3ffe3c10 0x400838e0:0x3ffe3c40 0x4007892f:0x3ffe3c60 0x40078995:0x3ffe3c90 0x400789a0:0x3ffe3cc0 0x40078b33:0x3ffe3ce0 0x40080335:0x3ffe3df0 0x40007c31:0x3ffe3eb0 0x4000073d:0x3ffe3f20

Decoding stack results
0x40090464: invoke_abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/panic.c line 140
0x40090667: abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/panic.c line 149
0x400df637: __assert_func at ../../../.././newlib/libc/stdlib/assert.c line 63
0x400e068d: esp_crosscore_int_init at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/crosscore_int.c line 93
0x400836fc: start_cpu0_default at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/cpu_start.c line 350
0x400838e0: call_start_cpu0 at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/cpu_start.c line 213

@me-no-dev
Copy link
Member

sounds like memory issue probably to fail that early @mitchsf . Please post some code

@mitchsf
Copy link
Author

mitchsf commented Jan 3, 2019

@me-no-dev, while working on example code to post, I deleted a struct that creates about 32k bytes of variable space, and the sketch no longer crashes, exactly what you suggested.

So my question is, with only a small percentage of dynamic memory used, where is it stored, and is there a way around this?

@lbernstone
Copy link
Contributor

Memory management is not a simple subject, but, if you have a 32k struct, it will need contiguous space. The earlier you set that up in your code, the less likely your SRAM is to be fragmented. If the memory will not be frequently accessed, you could get a WRover module, and store it in PSRAM.

@me-no-dev
Copy link
Member

Also you can use a pointer to it and malloc the struct on init, which will put it on the heap and not on the Task stack where it will break :)

@mitchsf
Copy link
Author

mitchsf commented Jan 4, 2019

Thanks for the help!

@Marc-Aurele
Copy link

Hi,

I had the same issue. It stopped rebooting when i launched make erase_flash command.

@stale
Copy link

stale bot commented Aug 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Aug 1, 2019
@stale
Copy link

stale bot commented Aug 15, 2019

This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

8 participants