-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
With ESP32S2, SD card read works in main loop, but will crash when called in a subroutine. #4716
Comments
that |
Yeah. I was trying to enter the Arduino version and I was starting up a new session with the IDE and it changed the focus. Something like that. I have not done much with ESP32s yet. I don't know how to do a backtrace yet, I have not installed and decoder. I'm assuming it is like the ESP8266, if so then I should have no problem. I can't look at this until tonight. Right now I need to get this working in loop(). I was hoping to demo something to my managers today. |
In my application I tried moving the file read routine into loop() and have a flag to trigger it. It doesn't work. So maybe it working in loop() with the above code isn't triggering the problem. This is from the code above. `Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled. Core 0 register dump: Backtrace:0x400a43eb:0x3ffc6e00 0x40082fcd:0x3ffc6e20 0x400826ca:0x3ffc6e50 0x4008b72d:0x3ffc6e80 0x4008d38c:0x3ffc6ea0 0x4008eafd:0x3ffc6ee0 0x40086906:0x3ffc6f10 0x4001a1cb:0x3ffc6f30 |<-CORRUPTED ` `PC: 0x400a43ee: spiGetClockDiv at E:\arduino-1.8.13-windows\arduino-1.8.13\portable\packages\esp32\hardware\esp32\1.0.4\cores\esp32\esp32-hal-spi.c line 427 Decoding stack results |
The following is from the crash of my application code. In this I have the file read in loop() and triggered with a flag. `Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled. Core 0 register dump: Backtrace:0x400af8ce:0x3ffca500 0x40083e2d:0x3ffca520 0x4008352a:0x3ffca550 0x40090d01:0x3ffca580 0x40091041:0x3ffca5a0 0x40092278:0x3ffca5c0 0x40092395:0x3ffca5e0 0x40093002:0x3ffca610 0x400943e4:0x3ffca880 0x4008a2fe:0x3ffca9f0 0x400a20f9:0x3ffcaa10 0x40082be5:0x3ffcaa30 0x40082248:0x3ffcaaa0 0x40081f11:0x3ffcaad0 0x400888c9:0x3ffcab20 0x4002b30d:0x3ffcab40 `PC: 0x400af8d1 Decoding stack results |
In my application (the above post) I have it do (inline) the file read in setup() without a crash. But in loop() it causes the crash in the above post. |
I think I used an older ESP32S2 code to generate the above stack traces. I will do it again but with a version that is more recent.
`#include "FS.h" int DACvalue = 0; //------------------------------------------- //uninitalised pointers to SPI objects //------------------------------------------- File profile = SD.open("/foo.txt", FILE_READ); if (!profile) { Serial.println("File Content:"); while (profile.available()) { Serial.println(""); //=========================================== //------------------------------------ #define SD_miso 17 SDSPI.begin(SD_sck, SD_miso, SD_mosi, -1); if (!SD.begin(SD_ss, SDSPI)) { File profile = SD.open("/foo.txt", FILE_READ); if (!profile) { Serial.println("File Content:"); while (profile.available()) {
}
/* if (!profile) { Serial.println("File Content:"); while (profile.available()) { Serial.println(""); //----------- }` |
I had had something similar. See: Maybe it helps. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Could someone help me to fix this error AllanOricil/esp32-mfa-authenticator#9 |
Hardware:
Board: ESP32-S2-Saola-1M
Core Installation version: ?1.0.0? ?1.0.1-rc4? ?1.0.1? ?1.0.1-git? ?1.0.2? ?1.0.3?
IDE name: Arduino IDE 1,8.13
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Windows 10
Description:
I can read a file on a SD card if I try and read it from Setup() or in Loop(). But if I have the same routine in a subroutine I get a crash.
Sorry if I have not done a good enough job with the formatting. I always have difficulty with it, but I can't put the time in to fix it. I should have been in bed a couple of hours ago.
Sketch: (leave the backquotes for code formatting)
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0x8
load:0x3ffe6108,len:0x608
load:0x4004c000,len:0xa38
load:0x40050000,len:0x2848
entry 0x4004c190
The text was updated successfully, but these errors were encountered: