![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
january 2015 docid026804 rev 1 1/46 1 AN4570 application note using the high-density stm32f30xxd/e fmc peripheral to drive external memories introduction this application note describes how to use the high-density stm32f30xxd/e fmc (flexible memory controller) peripheral to drive a set of external memories. for that aim, it gives an overview of the stm32f30xxd/e fmc. the document also presents memory interfacing examples that include the typical fmc configuration, the timing computation method and the hardware connection. this application note considers a 16-bit asynchronous nor flash memory, an 8-bit nand flash memory and a 16-bit asynchronous sram. the stm32f30xxd/e firmware library and the different memory drivers corresponding to the memory types presented in this application note are available for download on stmicroelectronics website at www.st.com . table 1 provides the list of products to which this application note applies. table 1. applicable products reference part number stm32f30xxd/e stm32f302rd, stm32f302vd, stm32f302zd, stm32f302re, stm32f302ve, stm32f302ze, stm32f303rd, stm32f303vd, stm32f303zd, stm32f303re, stm32f303ve, stm32f303ze. www.st.com
contents AN4570 2/46 docid026804 rev 1 contents 1 overview of the stm32f30xxd/e flexible static memory controller . . 5 1.1 interfacing asynchronous static memories (nor flash, sram) . . . . . . . . 7 2 interfacing with a non-multiplexed, asynchronous 16-bit nor flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1 fmc configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.1 typical use of the fmc to interface with a nor flash memory . . . . . . 10 2.2 timing computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3 hardware connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3 interfacing with a non-multiplexed, asynchronous 16-bit sram . . . . 22 3.1 fmc configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.1.1 typical use of the fmc to interface with an sram . . . . . . . . . . . . . . . . 23 3.2 timing computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.3 hardware connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4 interfacing with an 8-bit nand flash memory . . . . . . . . . . . . . . . . . . . 30 4.1 fmc configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.1.1 typical use of the fmc to interface with a nand memory . . . . . . . . . . 32 4.2 timing computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.3 hardware connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.4 error correction code computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.4.1 error correction code (ecc) computation overview . . . . . . . . . . . . . . . 41 4.4.2 error detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5 stm32f30xxd/e fmc configuration in 100-pin packages . . . . . . . . . . 43 5.1 interfacing the fmc with a nand flash memory . . . . . . . . . . . . . . . . . . 43 5.2 interfacing the fmc with a nor flash memory . . . . . . . . . . . . . . . . . . . . 44 6 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 docid026804 rev 1 3/46 AN4570 list of tables 3 list of tables table 1. applicable products. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 table 2. fmc operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 table 3. stm32f30xxd/e fmc asynchronous timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 table 4. nor flash memory timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 table 5. m29w128fl signal to fmc pin correspondence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 table 6. is61wv51216bl sram timings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 table 7. is61wv51216bll signal to fmc pin correspondence. . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 table 8. nand512w3a2c flash memory timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 table 9. nand512w3a signal to fmc pin correspondence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 table 10. nand flash memory connection to the fmc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 table 11. nor flash memory connection to the fmc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 table 12. document revision history. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 list of figures AN4570 4/46 docid026804 rev 1 list of figures figure 1. fmc block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 figure 2. fmc memory banks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 figure 3. asynchronous nor flash read access timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 4. asynchronous nor flash write access timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 5. 16-bit nor flash: m29w128fl/gl connection to stm32f30xxd/e . . . . . . . . . . . . . . . . . 14 figure 6. sram asynchronous read access timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 figure 7. sram asynchronous write access timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 figure 8. 16-bit sram: is61wv51216bll connection to stm32f30xxd/e . . . . . . . . . . . . . . . . . . . 25 figure 9. fmc nand bank sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 figure 10. nand memory access timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 figure 11. 8-bit nand flash: nand512w3a2c/nand512w3a2b connection to stm32f30xxd/e . 36 figure 12. error detection flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 docid026804 rev 1 5/46 AN4570 overview of the stm32f30xxd/e flexible static memory controller 45 1 overview of the stm32f30xxd/e flexible static memory controller the fmc has the following main features: ? interface with static-memory mapped devices including: ? static random access memory (sram), ? nor flash memory/onenand flash memory, ? psram (4 memory banks), ? 16-bit pc card compatible devices, ? two banks of nand flash memory with ecc hardware to check up to 8 kbyte of data ? supports burst mode access to synchronous devices (nor flash and psram) ? 8- or 16-bit wide data bus ? independent chip select control for each memory bank ? independent configuration for each memory bank ? programmable timings to support a wide range of devices, in particular: ? programmable wait states (up to 15) ? programmable bus turnaround cycles (up to 15) ? programmable output enable and write enable delays (up to 15) ? independent read and write timings and protocol, so as to support the widest variety of memories and timings ? write enable and byte lane select outputs for use with psram and sram devices ? translation of 32-bit wide ahb transactions into consecutive 16-bit or 8-bit accesses to external 16-bit or 8-bit devices ? the fmc embeds two write fifos: ? write data fifo with 16x33-bit depth, ? write address fifo with 16x30-bit depth). ? external asynchronous wait control the fmc registers that define the external device type and associated characteristics are usually set at boot time and do not change until the next reset or power-up. however, it is possible to change the settings at any time. figure 1 illustrates the fmc block diagram. overview of the stm32f30xxd/e flexible static memory controller AN4570 6/46 docid026804 rev 1 figure 1. fmc block diagram from the fmc point of view, the external memory is divided into four fixed-size banks of 256 mbyte each, as shown in figure 2 : ? bank 1 used by the nor flash/sram controller to address up to 4 memory devices. this bank is split into 4 regions with 4 dedicated chip select signals. ? banks 2 and 3 used by the nand flash/pc card controller to address nand flash devices. ? bank 4 used by the nand flash/pc card controller to address a pc card device. for each bank, the type of memory to be used is user-defined in the configuration register. 0 6 9 1 2 5 3 6 5 $ 0 v l j q d o v ) 0 & |