Page 1 of 1

Add files to FAT during building

Posted: Thu Dec 15, 2022 9:36 am
by vanBassum
Hello,

I have a project where I host an Angular application from the ESP32. This is based around this example:
https://github.com/espressif/esp-idf/tr ... le_serving

Right now, I flash the ESP32 with my project. Then I upload all the Angular files through the browser. After this I browse to the Angular application and all seems to be working fine.

The drawback of this approach is that the files have to be uploaded later. I would prefer to prepare the FAT partition during the build process, so the Angular files are contained within the image. (I flash all partitions during production, not just the OTA) This way the application is already placed on the ESP32 after the production stage. I don't want to do this in static flash, so I will still be able to change individual files through the web server later on.

Any suggestions how to achieve this?

Regards,
Bas

Re: Add files to FAT during building

Posted: Thu Dec 15, 2022 2:25 pm
by ESP_Roland
You can use the FATFS generator which is integrated into the build system: https://docs.espressif.com/projects/esp ... -generator

Re: Add files to FAT during building

Posted: Thu Dec 15, 2022 2:33 pm
by vanBassum
Thanks,

This seems like the tool I was looking for.