I want to load a bin file into memory. Is it necessary to declare a partition?

natee.th
Posts: 26
Joined: Fri Feb 10, 2023 5:25 pm

I want to load a bin file into memory. Is it necessary to declare a partition?

Postby natee.th » Mon Nov 27, 2023 6:48 am

I want to load a bin file used to store audio data (raw PCM) and be able to program it by partition in a csv file. What declarations do I need in partitions, spiffs or other types? What directories do I need?




I learned it through this video https://www.youtube.com/watch?v=V9-cgXag4Ko
What should I do next?

ESP_adokitkat
Posts: 52
Joined: Thu Jun 22, 2023 12:50 pm

Re: I want to load a bin file into memory. Is it necessary to declare a partition?

Postby ESP_adokitkat » Tue Nov 28, 2023 4:56 pm

Hello.

you can use SPIFFS or FATFS or LittleFS filesystem to achieve this. I do not recommend using SPIFFS since it's no longer maintained by its author.

These are our examples which achieve your goal for each filesystem:
https://github.com/espressif/esp-idf/tr ... /spiffsgen
https://github.com/espressif/esp-idf/tr ... e/fatfsgen
https://github.com/espressif/esp-idf/tr ... e/littlefs

In each example project, there is `main/CMakeLists.txt` file calling a function, which generates the filesystem binary from a folder on your computer specified in `main/CMakeLists.txt`. You can put your audio file there and then it will be included in the generated binary and flashed to you ESP device with `idf.py flash` command. You can access this partition and file in your C code.

Who is online

Users browsing this forum: axellin and 136 guests