mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-02 08:01:43 +01:00
docs: update application examples for storage component
This commit is contained in:
@@ -64,7 +64,7 @@ Steps For Creating Custom Chip Drivers and Overriding the ESP-IDF Default Driver
|
||||
.get_chip_caps = spi_flash_chip_eon_get_caps,
|
||||
};
|
||||
|
||||
- You also can see how to implement this in the example :example:`storage/custom_flash_driver`.
|
||||
- You also can see how to implement this in the example :example:`storage/custom_flash_driver`. This example demonstrates how to override the default chip driver list.
|
||||
|
||||
4. Write a new ``CMakeLists.txt`` file for the ``custom_chip_driver`` component, including an additional line to add a linker dependency from ``spi_flash`` to ``custom_chip_driver``::
|
||||
|
||||
@@ -80,8 +80,3 @@ Steps For Creating Custom Chip Drivers and Overriding the ESP-IDF Default Driver
|
||||
5. The ``linker.lf`` is used to put every chip driver that you are going to use whilst cache is disabled into internal RAM. See :doc:`/api-guides/linker-script-generation` for more details. Make sure this file covers all the source files that you add.
|
||||
|
||||
6. Build your project, and you will see the new flash driver is used.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
See also :example:`storage/custom_flash_driver`.
|
||||
|
||||
@@ -182,6 +182,14 @@ The FATFS component supports FAT12, FAT16, and FAT32 file system types. The file
|
||||
|
||||
Please refer :doc:`File System Considerations <../../api-guides/file-system-considerations>` for further details.
|
||||
|
||||
Application Examples
|
||||
--------------------
|
||||
|
||||
- :example:`storage/fatfs/getting_started` demonstrates the minimal setup required to store persistent data on SPI flash using the FatFS, including mounting the file system, opening a file, performing basic read and write operations, and unmounting the file system.
|
||||
|
||||
- :example:`storage/fatfs/fs_operations` demonstrates more advanced FatFS operations, including reading and writing files, creating, moving, and deleting files and directories, and inspecting file details.
|
||||
|
||||
- :example:`storage/fatfs/ext_flash` demonstrates how to operate an external SPI flash formatted with FatFS, including initializing the SPI bus, configuring the flash chip, registering it as a partition, and performing read and write operations.
|
||||
|
||||
High-level API Reference
|
||||
------------------------
|
||||
|
||||
@@ -219,3 +219,8 @@ Date and Time in FAT File System
|
||||
The FAT file system protocol used by ESP-IDF does not preserve the date or time on the chips' media, so all the images extracted from the device have the same default timestamp for all the FAT-specified date-time fields (creation and the last modification timestamp as well as creation, last modification and last access dates).
|
||||
|
||||
There are a couple of fields in the SFN entry describing time, such as **DIR_CrtTime** and **DIR_WrtTime**. Some fields are ignored by the FAT implementation used by ESP-IDF (see the file ``entry.py``). However, changes in the fields **DIR_WrtTime** and **DIR_WrtDate** are preserved in the chip. Both time and data entry are 16-bit, where the granularity of the time is 2 seconds.
|
||||
|
||||
Application Examples
|
||||
--------------------
|
||||
|
||||
- :example:`storage/fatfs/fatfsgen` demonstrates how to use the FatFS partition generation tool to automatically create a FatFS image from a host folder during the building process.
|
||||
|
||||
@@ -24,6 +24,16 @@ This component provides API functions to enumerate partitions found in the parti
|
||||
- :cpp:func:`esp_partition_find_first` is a convenience function which returns the structure describing the first partition found by :cpp:func:`esp_partition_find`.
|
||||
- :cpp:func:`esp_partition_read`, :cpp:func:`esp_partition_write`, :cpp:func:`esp_partition_erase_range` are equivalent to :cpp:func:`esp_flash_read`, :cpp:func:`esp_flash_write`, :cpp:func:`esp_flash_erase_region`, but operate within partition boundaries.
|
||||
|
||||
Application Examples
|
||||
--------------------
|
||||
|
||||
- :example:`storage/partition_api/partition_ops` demonstrates how to perform read, write, and erase operations on a partition table.
|
||||
|
||||
- :example:`storage/parttool` demonstrates how to use the partitions tool to perform operations such as reading, writing, erasing partitions, retrieving partition information, and dumping the entire partition table.
|
||||
|
||||
- :example:`storage/partition_api/partition_find` demonstrates how to search the partition table and return matching partitions based on set constraints such as partition type, subtype, and label/name.
|
||||
|
||||
- :example:`storage/partition_api/partition_mmap` demonstrates how to configure the MMU, map a partition into memory address space for read operations, and verify the data written and read.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
@@ -29,10 +29,16 @@ Host layer driver(s) implement the protocol layer driver by supporting these fun
|
||||
:align: center
|
||||
|
||||
|
||||
Application Example
|
||||
-------------------
|
||||
Application Examples
|
||||
--------------------
|
||||
|
||||
An example which combines the SDMMC driver with the FATFS library is provided in the :example:`storage/sd_card` directory of ESP-IDF examples. This example initializes the card, then writes and reads data from it using POSIX and C library APIs. See README.md file in the example directory for more information.
|
||||
.. list::
|
||||
|
||||
:SOC_SDMMC_HOST_SUPPORTED: - :example:`storage/sd_card/sdmmc` demonstrates how to operate an SD card formatted with the FatFS file system via the SDMMC interface.
|
||||
|
||||
:SOC_SDMMC_HOST_SUPPORTED: - :example:`storage/emmc` demonstrates how to operate an eMMC chip formatted with the FatFS file system via the SDMMC interface.
|
||||
|
||||
:SOC_GPSPI_SUPPORTED: - :example:`storage/sd_card/sdspi` demonstrates how to operate an SD card formatted with the FatFS file system via the SPI interface.
|
||||
|
||||
Protocol Layer API
|
||||
------------------
|
||||
|
||||
@@ -65,7 +65,7 @@ There are cases where the contents of the base directory itself is generated at
|
||||
|
||||
spiffs_create_partition_image(my_spiffs_partition my_folder DEPENDS dep)
|
||||
|
||||
For an example, see :example:`storage/spiffsgen`.
|
||||
For an example, see :example:`storage/spiffsgen`. This example demonstrates how to use the SPIFFS image generation tool to automatically create an SPIFFS image from a host folder during building.
|
||||
|
||||
``mkspiffs``
|
||||
^^^^^^^^^^^^
|
||||
|
||||
@@ -221,6 +221,7 @@ Application Examples
|
||||
|
||||
- :example:`system/select` demonstrates how to use synchronous I/O multiplexing with the ``select()`` function, using UART and socket file descriptors, and configuring both to act as loopbacks to receive messages sent from other tasks.
|
||||
|
||||
- :example:`storage/semihost_vfs` demonstrates how to use the semihosting VFS driver, including registering a host directory, redirecting stdout from UART to a file on the host, and reading and printing the content of a text file.
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
@@ -6,10 +6,10 @@ See Also
|
||||
- :doc:`./fatfs`
|
||||
- :doc:`../../api-guides/partition-tables`
|
||||
|
||||
Application Example
|
||||
-------------------
|
||||
Application Examples
|
||||
--------------------
|
||||
|
||||
An example that combines the wear levelling driver with the FATFS library is provided in the :example:`storage/wear_levelling` directory. This example initializes the wear levelling driver, mounts FatFs partition, as well as writes and reads data from it using POSIX and C library APIs. See :example_file:`storage/wear_levelling/README.md` for more information.
|
||||
- :example:`storage/wear_levelling` demonstrates how to use the wear levelling library and FatFS library to store files in a partition, as well as write and read data from these files using POSIX and C library APIs.
|
||||
|
||||
High-level API Reference
|
||||
------------------------
|
||||
|
||||
Reference in New Issue
Block a user