-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Comments
Exception decoder: Decoding 11 results |
can you get it down to minimal reproducible sketch? What features are you using? Exception seem to happen really early |
I'm working on it. Sketch is failing somewhere in Setup() |
from the backtrace above, it does not even get to setup :) probably out of heap |
stack sorry |
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. |
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? |
depends which one :) can you please post some code that shows the issue? I need something to work with |
@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. |
I'm trying to put something together that crashes, without having to deal with some modified libraries. |
Here is a mess of code that compiles, and demonstrates the problem. One hint - when ledcWrite() is removed from ledIndicator(), the sketch runs successfully. ` //#define DEBUG hw_timer_t * timer = NULL; const byte fRev = 1; // firmware revision //WiFiServer server(80); const int udpSyncInterval = 60000; // NTP sync every 10 minutes (ms) // You can specify the time server pool and the offset, (in seconds) HardwareSerial Serial1(1); #define serialGPS Serial1 struct tmt { // used for digit change effects // initialize and instantiate tz object // set variables for FastLED colorRGBB RGB[NUM_LEDS]; const byte clockPin = 26; // note that clock, data, and latch ports are written to directly but set using Arduino byte gate = 0; // used to transfer program flow from loop() to appropriate function const int gpsTimeAge = 1000; // oldest packet to sync boolean needParameters = false; byte xType; // Setup Options int xVersion = 1; // software version const int maxPresets = 61; // number of settings const byte scrollSpeed = 80; // temperature, pressure, humidity // instantiate timers //Bounce button = Bounce(buttonPin, 120); //Preferences nvs; int rgbRefreshLow = 30; // these parameters smooth out fades - APA102 only has 31 brightness levels /---------------------------------------------------------------------- void setup() #ifdef DEBUG // FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS); toneTimer = timerBegin(1, 80, true); // initialize timer - timer_id = 0; divider=80; countUp = true; // if (bme.begin()) wSensor = true; // temperature sensor delay(1000); // give it some time //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 if (preset[33] == 0) { // use only for RTC with no external sync // setSyncInterval(timeSyncInterval); clearD(); /---------------------------------------------------------------------- /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- /---------------------------------------------------------------------- /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } } blinker[2] = (xBlue == 3 ? blinker[2] : xBlue); // retain values if update, before deciding whether to leave if (xRed != 3) rgbLevel[0] = redLevel; if (LEDIndFlag == false) { // turn off LEDs if (millis() - lastTime >= ledBlinkInterval) {
} /---------------------------------------------------------------------- return map(analogRead(lightPin), lightLow, lightHigh, 0, 50); /---------------------------------------------------------------------- return 0; /---------------------------------------------------------------------- /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } return 0; /---------------------------------------------------------------------- } /---------------------------------------------------------------------- } ` |
Any updates on this? I went back to a two week old version, and everything works. Thanks. |
Have you tried reflashing using esptool |
@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). |
commit 600f4c4 broke it. |
Sorry, I have not tried it again with a newer release. |
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 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 |
sounds like memory issue probably to fail that early @mitchsf . Please post some code |
@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? |
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. |
Also you can use a pointer to it and |
Thanks for the help! |
Hi, I had the same issue. It stopped rebooting when i launched make erase_flash command. |
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. |
This stale issue has been automatically closed. Thank you for your contributions. |
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
The text was updated successfully, but these errors were encountered: