Storing a Large Array on ESP32

farzak
Posts: 1
Joined: Mon Jan 15, 2018 10:42 pm

Storing a Large Array on ESP32

Postby farzak » Mon Jan 15, 2018 11:43 pm

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.

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: Storing a Large Array on ESP32

Postby ESP_Sprite » Tue Jan 16, 2018 3:00 am

Moved
Showcase' -> 'Arduino'

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Storing a Large Array on ESP32

Postby WiFive » Tue Jan 16, 2018 5:40 am

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.

Who is online

Users browsing this forum: Baidu [Spider], gfvalvo and 53 guests