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

kyleneville
Posts: 3
Joined: Tue Oct 13, 2020 8:45 pm

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

Postby kyleneville » Tue Oct 13, 2020 9:03 pm

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
Last edited by kyleneville on Wed Nov 04, 2020 10:50 pm, edited 1 time in total.

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

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

Postby ESP_Sprite » Wed Oct 14, 2020 1:12 am

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?

Who is online

Users browsing this forum: Bing [Bot], jeffas and 179 guests