Crash on attempt to write from i2S mic to SD card #985
-
( Sketch in question : https://pastebin.com/6KPetyeq ) I'm sure it's something simple, a basic minsunderstanding of the order of operations / flow but after many hours hunting I'm out of ideas. I assume I'm corrupting memory somehow? When I call startRec, it seems to succesfuly open the file for writing "Opened r1.wav to record. " but then immediately reboots. Using Arduino IDE 2, a ESP32 S2 Mini, with an INMP441 mic and a FAT 32GB SD card. Playing WAVs from SD card working. |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 2 replies
-
Actually, it prints out the following before rebooting : |
Beta Was this translation helpful? Give feedback.
-
https://github.com/pschatzmann/arduino-audio-tools/wiki/It's-not-working Test the SD functionality outside of the AudioTools to make sure that this is working properly! |
Beta Was this translation helpful? Give feedback.
-
I re-assembled the circuit with more care on a higher quality breadboard and the noise coming from the amplifier during the SD card activity is gone.
Still crashing when calling my startRec function |
Beta Was this translation helpful? Give feedback.
-
I think you messed up badly: don't mix different sd libraries ! |
Beta Was this translation helpful? Give feedback.
-
Ah! Ok, changed to.. |
Beta Was this translation helpful? Give feedback.
-
Are you sure that the directory exists? |
Beta Was this translation helpful? Give feedback.
-
The directory exists, but to be sure, I wrote to root dir. No dice. SD.open seems a success. Unfortunately, I don't know if it is just the ESP32-S2 with integrated USB serial or what, but no stacktrace, and I don't see an option to enable it in the IDE. I will try this on an ESP32 Dev board... |
Beta Was this translation helpful? Give feedback.
-
Ok, on the Dev module I get: [I] StreamCopy.h : 82 - buffer_size=1024 Stack smashing protect failure! abort() was called at PC 0x400e8c0c on core 1 Backtrace: 0x4008378d:0x3ffb20d0 0x40089be1:0x3ffb20f0 0x4008eebd:0x3ffb2110 0x400e8c0c:0x3ffb2190 0x400da7ec:0x3ffb21b0 0x400da7fc:0x3ffb2200 0x400da959:0x3ffb2220 0x400d8e8a:0x3ffb2240 0x400e00f9:0x3ffb2290 ELF file SHA256: 7c158e6161395560 Rebooting... |
Beta Was this translation helpful? Give feedback.
-
0x4008378d: panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:408 |
Beta Was this translation helpful? Give feedback.
-
So, it is quite obvious: et_sd_wav_player.ino line 205 - I don't know anything about your ButtonEvent, so I can't provide any help! |
Beta Was this translation helpful? Give feedback.
-
I commented out all code relating to the button event library. Here is the resultant interpreted backtrace : 0x4008378d: panic_abort at /Users/me/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:408 |
Beta Was this translation helpful? Give feedback.
-
Just look at the line in the sketch where the issues starts and follow the calls: Google is your friend. I don't like if I have to repeat myself, but https://github.com/pschatzmann/arduino-audio-tools/wiki/It's-not-working still applies! |
Beta Was this translation helpful? Give feedback.
-
Maybe you invest also some time to learn the classes that are available in Arduino. It has it's own classes: e.g. String. Arduino is a basically C++, so the corresponding classes will also work most of the time: e.g. std::string. However I agree that it is often more efficient to use the C functionality. If you define a variable in a method, it is allocated on the stack and automatically disappears, when the method is left. |
Beta Was this translation helpful? Give feedback.
https://github.com/pschatzmann/arduino-audio-tools/wiki/It's-not-working
Test the SD functionality outside of the AudioTools to make sure that this is working properly!