My assumption is that using just an esp32-c3, I can create a partition and tun FatFS against it to store configuration (which will change very rarely). If this is correct, how do I go about creating the initial partition? I need to understand:
1. First time creation
2. How to avoid trashing it during an OTA upgrade.
I have read the ESP32 docs on this but I've not yet gotten my head around the partition creation steps.
Thanks!
FatFS - how create a partition?
Re: FatFS - how create a partition?
I suggest use SPIFFS there are some limitations compared to FatFS but I don't think there will be any problems if you just need to store some files that you will rarely edit.
You must cerate a partition for SPIFFS in ESP3 flash This this can be done by creating a csv file describing the partitions
Example
Partition csv file contain spiffs partition and two ota partitions for OTA upgrade
You must also configure project with custom partition table (VScode example)
You must cerate a partition for SPIFFS in ESP3 flash This this can be done by creating a csv file describing the partitions
Example
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, 0x009000, 0x6000,
otadata, data, ota, 0x00F000, 0x2000,
phy_init, data, phy, 0x011000, 0x1000,
storage, data, spiffs, , 900K
factory, app, factory, 0x100000, 2M,
ota_0, app, ota_0, , 2M,
ota_1, app, ota_1, , 2M,
You must also configure project with custom partition table (VScode example)
-
- Posts: 1708
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: FatFS - how create a partition?
https://docs.espressif.com/projects/esp ... -generator
But FAT is indeed pretty heavy for just "some" configuration data. Check out SPIFFS or NVS.
But FAT is indeed pretty heavy for just "some" configuration data. Check out SPIFFS or NVS.
-
- Posts: 28
- Joined: Thu Nov 03, 2022 1:57 pm
Re: FatFS - how create a partition?
Thanks. The configuration includes some long strings (needed to provide authentication to connect to Microsoft Azure resources) which was why I was avoiding the "simpler" options. I expect this to mostly be one-time set-up with rare changes but I will look again at the SPIFFS stuff.
As to the CSV file, if I go look will I find a sample for the "standard" layout somewhere? I guess I'm just stealing space form the existing layout for my configuration partition (or using the existing NV/SPIFFS ones)?
Thanks.
As to the CSV file, if I go look will I find a sample for the "standard" layout somewhere? I guess I'm just stealing space form the existing layout for my configuration partition (or using the existing NV/SPIFFS ones)?
Thanks.
-
- Posts: 1708
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: FatFS - how create a partition?
"Somewhere" would be here.papadeltasierra wrote: ↑Thu Nov 09, 2023 8:14 amAs to the CSV file, if I go look will I find a sample for the "standard" layout somewhere?
Re: FatFS - how create a partition?
You requested FatFS, I suggested SPIFFS with which you can manage the files (fopen fread fwrite...) exactly as on FatFS but storing the data in the internal flash of ESP32.Thanks. The configuration includes some long strings (needed to provide authentication to connect to Microsoft Azure resources) which was why I was avoiding the "simpler" options. I expect this to mostly be one-time set-up with rare changes but I will look again at the SPIFFS stuff.
If you have few values that you rarely modify then I think MicroController solution of using NVS is most appropriate
-
- Posts: 28
- Joined: Thu Nov 03, 2022 1:57 pm
Re: FatFS - how create a partition?
Thanks for all the help and pointers.
Who is online
Users browsing this forum: Google [Bot] and 116 guests