![STMicroelectronics STM32F405 Скачать руководство пользователя страница 1592](http://html1.mh-extra.com/html/stmicroelectronics/stm32f405/stm32f405_reference-manual_13810621592.webp)
Flexible memory controller (FMC)
RM0090
1592/1731
DocID018909 Rev 11
The FMC generates an AHB error in the following conditions:
•
When reading or writing to an FMC bank (Bank 1 to 4) which is not enabled.
•
When reading or writing to the NOR Flash bank while the FACCEN bit is reset in the
FMC_BCRx register.
•
When reading or writing to the PC Card banks while the FMC_CD input pin (Card
Presence Detection) is low.
•
When writing to a write protected SDRAM bank (WP bit set in the SDRAM_SDCRx
register).
•
When the SDRAM address range is violated (access to reserved address range)
The effect of an AHB error depends on the AHB master which has attempted the R/W
access:
•
If the access has been attempted by the Cortex
®
-M4 with FPU CPU, a hard fault
interrupt is generated.
•
If the access has been performed by a DMA controller, a DMA transfer error is
generated and the corresponding DMA channel is automatically disabled.
The AHB clock (HCLK) is the reference clock for the FMC.
37.3.1
Supported memories and transactions
General transaction rules
The requested AHB transaction data size can be 8-, 16- or 32-bit wide whereas the
accessed external device has a fixed data width. This may lead to inconsistent transfers.
Therefore, some simple transaction rules must be followed:
•
AHB transaction size and memory data size are equal
There is no issue in this case.
•
AHB transaction size is greater than the memory size:
In this case, the FMC splits the AHB transaction into smaller consecutive memory
accesses to meet the external data width. The FMC Chip Select (FMC_NEx) does not
toggle between the consecutive accesses.
•
AHB transaction size is smaller than the memory size:
The transfer may or not be consistent depending on the type of external device:
–
Accesses to devices that have the byte select feature (SRAM, ROM, PSRAM,
SDRAM)
In this case, the FMC allows read/write transactions and accesses the right data
through its byte lanes BL[3:0].
byte to be written are addressed by NBL[3:0].
All memory byte are read (NBL[3:0] are driven low during read transaction) and
the useless ones are discarded.
–
Accesses to devices that do not have the byte select feature (16-bit NOR and
NAND Flash memories)
This situation occurs when a byte access is requested to a 16-bit wide Flash
memory. Since the device cannot be accessed in byte mode (only 16-bit words
can be read/written from/to the Flash memory), Write transactions and Read
transactions are allowed (the controller reads the entire 16-bit memory word and
uses only the required byte).