STM32F7 13 Flexible memory controller (FMC)

Started by tha, November 10, 2022, 08:25:57 AM

Previous topic - Next topic

tha

13 Flexible memory controller (FMC)

The Flexible memory controller (FMC) ประกอบด้วย three memory controllers:
•   The NOR/PSRAM memory controller
•   The NAND memory controller
•   The Synchronous DRAM (SDRAM/Mobile LPSDR SDRAM) controller

tha

13.1 FMC main features

The FMC functional block สร้าง the interface ด้วย: synchronous and asynchronous static memories, SDRAM memories, and NAND Flash memory. วัตถุประสงค์หลักของมันคือ:
•   เพื่อแปล AHB transactions ไปเป็น the appropriate external device protocol
•   เพื่อให้ตรงตาม the access time requirements ของ the external memory devices

ทุก external memories แชร์ the addresses, data and control signals กับ the controller. แต่ละ external device ถูกเข้าถึงโดยใช้ a unique chip select. The FMC ดำเนินการ one access เท่านั้นในแต่ละครั้งถึง an external device.

tha

คุณสมบัติหลักของ the FMC controller มีดังต่อไปนี้:
•   อินเตอร์เฟสกับ static-memory mapped devices ประกอบด้วย:
     –   Static random access memory (SRAM)
     –   NOR Flash memory/OneNAND Flash memory
     –   PSRAM (4 memory banks)
     –   NAND Flash memory พร้อมด้วย ECC hardware เพื่อตรวจสอบมากถึง 8 Kbytes of data
•   อินเตอร์เฟสกับ synchronous DRAM (SDRAM/Mobile LPSDR SDRAM) memories
•   อินเตอร์เฟสกับ parallel LCD modules, รองรับ Intel 8080 and Motorola 6800 modes.
•   Burst(ส่งข้อมูลเป็นชุดอย่างเร็ว) mode รองรับสำหรับการเข้าถึงที่เร็วขึ้นไปยัง synchronous devices อย่างเช่น NOR Flash
     memory, PSRAM and SDRAM)
•   Programmable continuous clock output สำหรับ asynchronous and synchronous accesses
•   8-,16- or 32-bit wide data bus
•   Independent chip select ควบคุมสำหรับแต่ละ memory bank
•   Independent configuration สำหรับแต่ละ memory bank
•   Write enable and byte lane select ส่งออกสำหรับใช้กับ PSRAM, SRAM and SDRAM devices
•   External asynchronous wait control
•   Write FIFO ที่มี 16 x32-bit depth
•   Cacheable Read FIFO ที่มี 6 x32-bit depth (6 x14-bit address tag) สำหรับ SDRAM controller.


tha

The Write FIFO เป็นธรรมดาของทุก memory controllers และประกอบด้วย:
•   a Write Data FIFO ซึ่งเก็บ the AHB data ที่จะถูกเขียนไปยัง the memory (มากถึง 32 bits) บวก one bit สำหรับ the AHB
     transfer (burst หรือไม่ใช่ sequential mode)
•   a Write Address FIFO ซึ่งเก็บ the AHB address (มากถึง 28 bits) บวก the AHB data size (มากถึง 2 bits). เมื่อทำงานใน
     burst mode, เพียง the start address เท่านั้นที่ถูกเก็บยกเว้นเมื่อข้าม a page boundary (สำหรับ PSRAM and SDRAM). ใน
     กรณีนี้, the AHB burst จะถูกแบ่งออกเป็น two FIFO entries.

The Write FIFO สามารถถูกปิดใช้งานโดยการเซ็ต the WFDIS bit ใน the FMC_BCR1 register.

เมื่อเริ่มต้น the FMC pins ต้องถูกกำหนดค่าโดย the user application. The FMC I/O pins ซึ่งไม่ได้ถูกใช้โดย the application สามารถถูกใช้สำหรับวัตถุประสงค์อื่น.

The FMC registers ที่กำหนด the external device type และ associated characteristics มักจะถูกเซ็ตไว้ตอนบู็ตและไม่เปลี่ยนจนกระทั่ง the next reset or power-up. อย่างไรก็ตาม การเซ็ตสามารถถูกเปลี่ยนได้ตลอดเวลา.

tha

13.2 FMC block diagram

The FMC ประกอบด้วย the following main blocks:
•   The AHB interface (รวมทั้ง the FMC configuration registers)
•   The NOR Flash/PSRAM/SRAM controller
•   The SDRAM controller
•   The NAND Flash controller

The block diagram ถูกแสดงในรูปข้างล่าง.



tha

13.3 AHB interface

The AHB slave interface ช่วยให้ internal CPUs และ bus master peripherals อื่นๆเข้าถึง the external memories.

AHB transactions จะถูกแปลเป็น the external device protocol. โดยเฉพาะถ้า the selected external memory คือ 16- or 8-bit wide, ส่วน 32-bit wide transactions บน the AHB จะถูกแยกออกเป็น 16- or 8-bit accesses ที่ติดต่อกัน. The FMC chip select (FMC_NEx) จะไม่สลับระหว่าง the consecutive accesses ยกเว้นในกรณีของ Access mode D เมื่อ the Extended mode ถูกเปิดใช้งาน.

The FMC จะสร้าง an AHB error ในเงื่อนไขต่อไปนี้:
•   เมื่อการอ่านหรือการเขียนไปยัง an FMC bank (Bank 1 ถึง 4) ซึ่งไม่ได้เปิดใช้งาน.
•   เมื่อการอ่านหรือการเขียนไปยัง the NOR Flash bank ในขณะที่ the FACCEN bit ถูกรีเซ็ตใน the FMC_BCRx register.
•   เมื่อเขียนไปยัง a write protected SDRAM bank (WP bit ถูกเซ็ตใน the SDRAM_SDCRx register).
•   เมื่อ the SDRAM address range ถูกละเมิด (เข้าถึง reserved address range)

ผลของ an AHB error ขึ้นอยู่กับ the AHB master ซึ่งได้พยายาม the R/W access:
•   ถ้า the access ถูกพยายามโดย the Cortex®-M7 CPU แล้ว, a hard fault interrupt จะถูกสร้าง.
•   ถ้า the access ถูกดำเนินการโดย a DMA controller แล้ว, a DMA transfer error จะถูกสร้างและ the corresponding DMA
     channel จะถูกปิดใช้งานโดยอัตโนมัติ.

The AHB clock (HCLK) เป็น the reference clock สำหรับ the FMC.

tha

13.3.1 Supported memories and transactions

General transaction rules

The requested AHB transaction data size สามารถเป็น 8-, 16- or 32-bit wide ในขณะที่ the accessed external device มี a fixed data width. ซึ่งอาจนำไปสู่การส่งถ่ายที่ไม่สอดคล้องกัน.

ดังนั้น, some simple transaction rules ต้องถูกปฏิบัติตาม:
•   AHB transaction size and memory data size เท่ากัน
    ไม่มีปัญหาในกรณีนี้.
•   AHB transaction size ใหญ่กว่า the memory size:
    ในกรณีนี้, the FMC จะแบ่ง the AHB transaction เป็น smaller consecutive memory accesses เพื่อให้ตรงตาม the
    external data width. The FMC chip select (FMC_NEx) จะไม่สลับระหว่าง the consecutive accesses.
•   AHB transaction size เล็กกว่า the memory size:
    การส่งถ่ายอาจสอดคล้องหรือไม่ขึ้นอยู่กับ the type of external device:
    –   เข้าถึงไปยัง devices ที่มี the byte select feature (SRAM, ROM, PSRAM, SDRAM)
         ในกรณีนี้, the FMC ยอมให้ read/write transactions และเข้าถึง the right data ผ่านทาง byte lanes ของมัน NBL[3:0].
         Bytes ที่จะถูกเขียนถูกระบุที่อยู่โดย NBL[3:0].
         All memory bytes ถูกอ่าน (NBL[3:0] ถูกขับ low ในระหว่าง read transaction) และสิ่งที่ไร้ประโยชน์จะถูกทิ้ง.
    –   เข้าถึงไปยัง devices ที่ไม่มี the byte select feature (NOR and NAND Flash memories)
         สถานการณ์นี้เกิดขึ้นเมื่อ a byte access ถูกร้องขอไปยัง a 16-bit wide Flash memory. เนื่องจาก the device ไม่สามารถถูก
         เข้าถึงใน Byte mode (เฉพาะ 16-bit words ที่สามารถถูก read/written from/to the Flash memory), Write
         transactions and Read transactions ถูกยอมให้ (the controller จะอ่าน the entire 16-bit memory word และใช้เฉพาะ
         the required byte).

tha

Wrap support for NOR Flash/PSRAM and SDRAM

The synchronous memories ต้องถูกกำหนดค่าใน Linear burst mode ของความยาวที่ไม่ได้กำหนดเนื่องจากไม่ทุก masters สามารถออก a wrap transactions.

ถ้า a master สร้าง an AHB wrap transaction:
•   The read ถูกแบ่งออกเป็น two linear burst transactions.
•   The write ถูกแบ่งออกเป็น two linear burst transactions ถ้า the write fifo ถูกเปิดใช้งานและเป็น several linear burst
     transactions ถ้า the write fifo ถูกปิดใช้งาน.