Page 1 of 1

Trying to read a .bin file via SPIFFS in segments/chunks

Posted: Tue Oct 13, 2020 9:03 pm
by kyleneville
Hi, I'm trying to read a file that's saved (~500kB) on my ESP32 WROVER-B. I uploaded the file using SPIFFS from the '/data' in my sketch. When upload my code, I get this error during compilation.

Code: Select all

c:/users/user/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\user\AppData\Local\Temp\arduino_build_587637/new_websocket4.ino.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
c:/users/user/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/user/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 408872 bytes
collect2.exe: error: ld returned 1 exit status
Which is why I want to read the data in parts.

I'm looking for some methods where I can mention the address and the size of the data that I can read at a time, process it and then move on with the next chunk of data. Can someone please help me with this?

Thanks,
Kyle

Re: Trying to read a .bin file via SPIFFS in segments/chunks

Posted: Wed Oct 14, 2020 1:12 am
by ESP_Sprite
Hard to say without knowing your code or seeing what you want to do with the data, but what's keeping you from just doing a fread() with a limited amount of bytes until the file is done?