Page 1 of 1

Storing a Large Array on ESP32

Posted: Mon Jan 15, 2018 11:43 pm
by farzak
I was seeking advice on how to to store a large array on the ESP32. I'm currently using the Adafruit Huzzah WROOM-32 module on the Arduino IDE platform.

I have this I2S microphone and want to send around 5-6 seconds of 18-bit audio over WiFi. Sampled at 32 kHz, the audio requires alot of memory. I was gonna store the audio first in order to avoid latencies between each sample cycle. The stored audio would then be transmitted sample by sample over WiFi. I tried passing the samples right through the Serial.print() and I get around 300 000 integer values in a record cycle. I have tried many ways (simply declaring a massive array, malloc/calloc, Arduino EEPROM example, static or constant declaration) but it keeps rebooting and giving this message in Serial:

Guru Meditation Error: Core 1 panic'ed (StoreProhibited)
. Exception was unhandled.
Register dump:
PC : 0x400d0842 PS : 0x00060530 A0 : 0x800df7aa A1 : 0x3ffca600
A2 : 0x3ffc2214 A3 : 0x00000000 A4 : 0x00000000 A5 : 0x3ffc7e9c
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x800d083c A9 : 0x3ffca5e0
A10 : 0x00000000 A11 : 0x00000008 A12 : 0x00000000 A13 : 0x00000003
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000001f EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x400d0842:0x3ffca600 0x400df7a7:0x3ffca620

Im trying to use the SPI flash but my weak MCU programming background is failing me. From what I know, the Huzzah has 16 Mb of flash. Its just a matter of allocating it.

It would be greatly appreciated if you can help or suggest alternatives to solve this.

Re: Storing a Large Array on ESP32

Posted: Tue Jan 16, 2018 3:00 am
by ESP_Sprite
Moved
Showcase' -> 'Arduino'

Re: Storing a Large Array on ESP32

Posted: Tue Jan 16, 2018 5:40 am
by WiFive
farzak wrote:From what I know, the Huzzah has 16 Mb of flash. Its just a matter of allocating it.
You are confusing flash and ram. Wroom32 on huzzah only has 520kbyte ram and maybe half would be available as heap to your application.