spi_flash: Add documents for flash optional features

pull/8526/head
Cao Sen Miao 2022-02-25 17:04:32 +08:00
rodzic 85dd785d8d
commit a0bd06af54
4 zmienionych plików z 167 dodań i 13 usunięć

Wyświetl plik

@ -27,6 +27,9 @@ Encrypted reads and writes use the old implementation, even if :ref:`CONFIG_SPI_
Support for Features of Flash Chips
-----------------------------------
Quad/Dual mode chips
^^^^^^^^^^^^^^^^^^^^
Flash features of different vendors are operated in different ways and need special support. The fast/slow read and Dual mode (DOUT/DIO) of almost all 24-bits address flash chips are supported, because they don't need any vendor-specific commands.
Quad mode (QIO/QOUT) is supported on following chip types:
@ -39,18 +42,33 @@ Quad mode (QIO/QOUT) is supported on following chip types:
6. XMC
7. BOYA
Optional Features
^^^^^^^^^^^^^^^^^
.. toctree::
:hidden:
spi_flash_optional_feature
There are some features that are not supported by all flash models, or not supported by all Espressif chips. These features include:
.. only:: esp32s3
Octal mode (OPI) are supported on following chip types:
- OPI flash - means that flash supports octal mode.
1. MXIC
- 32-bit address flash - usually means that the flash has higher capacity (equal to or larger than 16MB) that needs longer address to access.
To know how to configure menuconfig for a board with different Flash and PSRAM, please refer to the :ref:`SPI Flash and External SPI RAM Configuration <flash-psram-configuration>`
.. only:: esp32s3
The 32-bit address range of following chip type is supported:
- High performance mode (HPM) - means that flash works under high frequency which is higher than 80MHz.
1. W25Q256
2. GD25Q256
- Flash unique ID - means that flash supports its unique 64-bits ID.
.. only:: esp32c3
- Suspend & Resume - means that flash can accept suspend/resume command during its writing/erasing. The {IDF_TARGET_NAME} may keep the cache on when the flash is being written/erased and suspend it to read its contents randomly.
If you want to use these features, you need to ensure {IDF_TARGET_NAME} supports this feature, and ALL the flash chips in your product have this feature. For more details, refer :doc:`spi_flash_optional_feature`.
Users can also customize their own flash chip driver, see :doc:`spi_flash_override_driver` for more details.
@ -169,7 +187,7 @@ The ``esp_flash_t`` structure holds chip data as well as three important parts o
1. The host driver, which provides the hardware support to access the chip;
2. The chip driver, which provides compatibility service to different chips;
3. The OS functions, provides support of some OS functions (e.g. lock, delay) in different stages (1st/2st boot, or the app).
3. The OS functions, provide support of some OS functions (e.g. lock, delay) in different stages (1st/2nd boot, or the app).
Host driver
^^^^^^^^^^^

Wyświetl plik

@ -0,0 +1,117 @@
Optional features for flash
===========================
Some features are not supported on all ESP chips and Flash chips. You can check the list below for more information.
- `Auto Suspend & Resume <#auto-suspend-&-resume>`__
- `Flash unique ID <#flash-unique-id>`__
- `High performance mode <#high-performance-mode>`__
- `OPI flash support <#opi-flash-support>`__
- `32-bit Address Flash Chips <#32-bit-address-flash-chips>`__
.. note::
- The features listed above needs to be supported by both esp chips and flash chips.
- If you are using an official Espressif modules/SiP. Some of the modules/SiPs always support the feature, in this case you can see these features listed in the datasheet. Otherwise please contact `Espressif's business team <https://www.espressif.com/en/contact-us/sales-questions>`_ to know if we can supply such products for you.
- If you are making your own modules with your own bought flash chips, and you need features listed above. Please contact your vendor if they support the those features, and make sure that the chips can be supplied continuously.
.. attention::
This document only shows that IDF code has supported the features of those flash chips. It's not a list of stable flash chips certified by Espressif. If you build your own hardware from flash chips with your own brought flash chips (even with flash listed in this page), you need to validate the reliability of flash chips yourself.
Auto Suspend & Resume
---------------------
.. only:: esp32c3
You can refer to :ref:`auto-suspend` for more information about this feature. The support list is as follows.
ESP Chips List:
1. ESP32C3
Flash Chips List:
1. XM25QxxC series.
Flash unique ID
---------------
Unique ID is not flash id, which means flash has 64-Bit unique ID for each device. The instruction to read the unique ID (4Bh) accesses a factory-set read-only 64-bit number that is unique to each flash device. This ID number helps you to recognize each single device. Not all flash vendors support this feature. If you try to read the unique ID on a chip which does not have this feature, the behavior is not determined. The support list is as follows.
ESP Chips Lists:
ALL
Flash Chips List:
1. ISSI
2. GD
3. TH
4. FM
5. Winbond
6. XMC
7. BOYA
High performance mode
---------------------
.. note::
This section is provided for Dual mode (DOUT/DIO) and Quad mode (QIO/QOUT) flash chips. Octal flash used on ESP-chips support High performance mode by default so far, you can refer to the octal flash support list below.
High performance mode (HPM) means that the SPI1 and flash chip works under high frequency. Usually, when the operating frequency of the flash is greater than 80MHz, it is considered that the flash works under HPM. As far as we acknowledged, flash chips have more than two different coping strategies when flash work under HPM. For some flash chips, HPM is controlled by high performance flag (HPF) in status register and for some flash chips, HPM is controlled by dummy cycle bit.
For following conditions IDF start code deals with HPM internally.
ESP Chips List:
1. ESP32S3
Flash Chips (name & ID) List:
1. GD25Q64C (ID: 0xC84017)
2. GD25Q32C (ID: 0xC84016)
.. attention::
It is hard to create several strategies to cover all situations, so all flash chips using HPM need to be supported explicitly. Therefore, if you try to use a flash not listed as supported under high performance mode, it might cause some error. So, when you try to use the flash chip beyond supported list, please test properly.
OPI flash support
-----------------
OPI flash means that the flash chip supports octal peripheral interface, which has octal I/O pins. Different octal flash has different configurations and different commands. Hence, it is necessary to carefully check the support list.
.. only:: esp32s3
.. note::
To know how to configure menuconfig for a board with different Flash and PSRAM, please refer to the :ref:`SPI Flash and External SPI RAM Configuration <flash-psram-configuration>`
ESP Chips List:
1. ESP32S3
Flash Chips List:
1. MX25UM25645G
32-bit Address Flash Chips
--------------------------
Most NOR flash chips used by Espressif chips use 24-bits address, which can cover 16 MBytes memory. However, for larger memory (usually equal to or larger than 16 MBytes), flash uses a 32-bits address to address larger memory. Regretfully, 32-bits address chips have vendor-specific commands, so we need to support the chips one by one.
ESP Chips List:
ALL ESP Chips support this.
Flash Chips List:
1. W25Q256
2. GD25Q256

Wyświetl plik

@ -27,6 +27,9 @@ Kconfig 选项 :ref:`CONFIG_SPI_FLASH_USE_LEGACY_IMPL` 可将 ``spi_flash_*``
Flash 特性支持情况
-----------------------------------
支持的 Flash 列表
^^^^^^^^^^^^^^^^^^^^^
不同厂家的 flash 特性有不同的操作方式,因此需要特殊的驱动支持。当前驱动支持大多数厂家 Flash 24 位地址范围内的快速/慢速读,以及二线模式 (DIO / DOUT),因为他们不需要任何厂家的自定义命令。
当前驱动支持以下厂家/型号的 flash 的四线模式 (QIO/QOUT)
@ -39,18 +42,33 @@ Flash 特性支持情况
6. XMC
7. BOYA
Flash 可选的功能
^^^^^^^^^^^^^^^^^^^^
.. toctree::
:hidden:
spi_flash_optional_feature
有一些功能可能不是所有的 flash 芯片都支持,或不是所有的 ESP 芯片都支持。这些功能包括:
.. only:: esp32s3
下列芯片支持八线模式 (OPI)
- OPI flash - 表示 Flash 支持 8 线模式。
1. MXIC
- 32 比特地址的 flash 支持 - 通常意味着拥有大于 16MB 内存空间的大容量 flash 需要更长的地址去访问。
关于如何为具有不同 flash 和 PSRAM 容量的开发板设置 menuconfig请参考 :ref:`SPI flash 和片外 SPI RAM 设置 <flash-psram-configuration>`
.. only:: esp32s3
当前驱动支持以下厂家/型号的 flash 的 32 位地址范围的访问:
- 高性能 (HPM) 模式 - 表示 flash 工作频率大于 80MHz 。
1. W25Q256
2. GD25Q256
- flash 的私有ID (unique ID) - 表示 flash 支持它自己的 64-bits 独一无二的 ID 。
.. only:: esp32c3
- 暂停与恢复 - 表示 flash 可以在读/写的过程中接受暂停/恢复的命令。{IDF_TARGET_NAME} 可以在 flash 正在写/擦除的过程中保持 cache 开启,并能随机读取 flash 中的内容。
如果您想使用这些功能,则需保证 {IDF_TARGET_NAME} 支持这些功能,且产品里所使用的 flash 芯片也要支持这些功能。请参阅 :doc:`spi_flash_optional_feature`,查看更多信息。
如果有需要,也可以自定义 flash 芯片驱动,参见 :doc:`spi_flash_override_driver`

Wyświetl plik

@ -0,0 +1 @@
.. include:: ../../../en/api-reference/storage/spi_flash_optional_feature.rst