i2s_adc_dac example, increase length of audio recording

HyperUniverse
Posts: 33
Joined: Fri Oct 29, 2021 11:20 pm

i2s_adc_dac example, increase length of audio recording

Postby HyperUniverse » Fri Dec 03, 2021 11:05 am

Hi,

I can't figure out how to increase the length of my sound recording in the i2s_adc_dac example.

I have successfully increased my storage size to 6M, as I've got a 16M chip;

Code: Select all

# Name	   Type	 SubType	 Offset	  Size	 Flags
# Note: if you have increased the bootloader size	 make sure to update the offsets to avoid overlap				
nvs	        data	         nvs	         0x9000	  0x6000	
phy_init	 data         phy	         0xf000	  0x1000	
factory      app	        factory	 0x10000	 1M	
storage     data	 fat	         0x110000  6M	
In the example:

Code: Select all

//flash record size, for recording 5 seconds' data
#define FLASH_RECORD_SIZE         (EXAMPLE_I2S_CHANNEL_NUM * EXAMPLE_I2S_SAMPLE_RATE * EXAMPLE_I2S_SAMPLE_BITS / 8 * 5)
I have replaced the 5 at the end with 30, as I want 30 seconds of audio recording:

Code: Select all

//flash record size, for recording 30 seconds' data
#define FLASH_RECORD_SIZE         (EXAMPLE_I2S_CHANNEL_NUM * EXAMPLE_I2S_SAMPLE_RATE * EXAMPLE_I2S_SAMPLE_BITS / 8 * 30)
I have also increased the FLASH_SECTOR_SIZE to as big as my storage partition is = 6M

Code: Select all

#define FLASH_SECTOR_SIZE         (0x600000)
I have pointed to the beginning of the FLASH_ADDRESS:

Code: Select all

#define FLASH_ADDR                (0x110000)
When I run the code, after is recording the sound, the GURU gets upset and is resetting the ESP:
Guru Meditation Error: Core 0 panic'ed (LoadStoreError). Exception was unhandled.

Core 0 register dump:
PC : 0x400d4aa0 PS : 0x00060730 A0 : 0x800d4b86 A1 : 0x3ffba2a0
A2 : 0x3ffbefd4 A3 : 0x3ffbafd0 A4 : 0x00060000 A5 : 0x00060000
A6 : 0x00000000 A7 : 0xffffffff A8 : 0x00000000 A9 : 0x0004102d
A10 : 0x0004102c A11 : 0x0004102c A12 : 0x40000000 A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x00000018 EXCCAUSE: 0x00000003
EXCVADDR: 0x40000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000

Backtrace:0x400d4a9d:0x3ffba2a0 0x400d4b83:0x3ffba2c0 0x40088679:0x3ffba2f0


ELF file SHA256: 4b5df2f943353020

Rebooting...



What am I doing wrong?

Thanks.
Regards.

Who is online

Users browsing this forum: No registered users and 106 guests