STM32F7 13 Flexible memory controller (FMC)

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

Previous topic - Next topic

tha

Common memory space timing register 2..4 (FMC_PMEM)

Address offset: Address: 0x88
Reset value: 0xFCFC FCFC

แต่ละ FSMC_PMEM read/write register บรรจุ the timing information สำหรับ  NAND Flash memory bank. information นี้ถูกใช้เพื่อเข้าถึงอย่างใดอย่างหนึ่ง the common memory space ของ the NAND Flash สำหรับ command, address write access และ data read/write access.



Bits 31:24 MEMHIZ[7:0]: Common memory x data bus Hi-Z time
     กำหนดจำนวนของ HCLK clock cycles ในระหว่างที่ the data bus ถูกเก็บเป็นไฮอิมพิแด๊นท์(HiZ) หลังจากการสตาร์ทของ a NAND
     Flash write access ไปยัง common memory space บน socket. สิ่งนี้ใช้ได้เฉพาะสำหรับ write transaction:
     0000 0000: 1 HCLK cycle
     1111 1110: 255 HCLK cycles
     1111 1111: Reserved

Bits 23:16 MEMHOLD[7:0]: Common memory hold time
     กำหนดจำนวนของ HCLK clock cycles สำหรับ write access และ HCLK (+2) clock cycles สำหรับ read access ในระหว่างที่
     the address ถูกยึดไว้ (และ data สำหรับ write accesses) หลังจาก the command ถูกถอนการยืนยัน (NWE, NOE), สำหรับ
     NAND Flash read or write access ไปยัง common memory space บน socket x:
     0000 0000: reserved.
     0000 0001: 1 HCLK cycle for write access / 3 HCLK cycles for read access
     1111 1110: 254 HCLK cycles for write access / 256 HCLK cycles for read access
     1111 1111: reserved.

tha

Bits 15:8 MEMWAIT[7:0]: Common memory wait time
     กำหนดจำนวนต่ำสุดของ HCLK (+1) clock cycles เพื่อยืนยัน the command (NWE, NOE), สำหรับ NAND Flash read หรือ
     write access ไปยัง common memory space บน socket. The duration สำหรับ command assertion ถูกยืดเวลาถ้า the
     wait signal (NWAIT) แอคทีฟ (low) ที่จุดสุดท้ายของค่าที่โปรแกรมของ HCLK:
     0000 0000: Reserved
     0000 0001: 2 HCLK cycles (+ wait cycle ที่เพิ่มขึ้นโดยการถอนการยืนยันของ NWAIT)
     1111 1110: 255 HCLK cycles (+ wait cycle ที่เพิ่มขึ้นโดยการถอนการยืนยันของ  NWAIT)
     1111 1111: Reserved.

Bits 7:0 MEMSET[7:0]: Common memory x setup time
     กำหนดจำนวนของ HCLK (+1) clock cycles เพื่อเซ็ตอัฟ the address ก่อน the command assertion (NWE, NOE), สำหรับ
     NAND Flash read or write access ไปยัง common memory space บน socket x:
     0000 0000: 1 HCLK cycle
     1111 1110: 255 HCLK cycles
     1111 1111: reserved

tha

Attribute memory space timing registers (FMC_PATT)

Address offset: 0x8C
Reset value: 0xFCFC FCFC

The FSMC_PATT read/write register บรรจุ the timing information สำหรับ NAND Flash memory bank. มันถูกใช้สำหรับ 8-bit เข้าถึงไปยัง the attribute memory space ของ the NAND Flash สำหรับ the last address write access ถ้า the timing ต้องต่างจากที่การเข้าถึงก่อนหน้า (สำหรับ Ready/Busy management, อ้างอิงถึง Section 13.6.5: NAND Flash prewait functionality).



Bits 31:24 ATTHIZ[7:0]: Attribute memory data bus Hi-Z time
     กำหนดจำนวนของ HCLK clock cycles ในระหว่างที่ the data bus ถูกเก็บเป็นไฮอิมพิแด๊นท์(HiZ) หลังจากการสตาร์ทของ a NAND
     Flash write access ไปยัง attribute memory space บน socket. ใช้ได้เฉพาะสำหรับ write transaction:
     0000 0000: 0 HCLK cycle
     1111 1110: 255 HCLK cycles
     1111 1111: reserved.

Bits 23:16 ATTHOLD[7:0]: Attribute memory hold time
     กำหนดจำนวนของ HCLK clock cycles สำหรับ write access และ HCLK (+2) clock cycles สำหรับ read access ในระหว่างที่
     the address ถูกยึดไว้ (และ data สำหรับ write accesses) หลังจาก the command ถูกถอนการยืนยัน (NWE, NOE), สำหรับ
     NAND Flash read or write access ไปยัง attribute memory space บน socket:
     0000 0000: reserved
     0000 0001: 1 HCLK cycle for write access / 3 HCLK cycles for read access
     1111 1110: 254 HCLK cycles for write access / 256 HCLK cycles for read access
     1111 1111: reserved.


tha

Bits 15:8 ATTWAIT[7:0]: Attribute memory wait time
     กำหนดจำนวนต่ำสุดของ HCLK (+1) clock cycles เพื่อยืนยัน the command (NWE, NOE), สำหรับ NAND Flash read หรือ
     write access ไปยัง attribute memory space บน socket x. The duration สำหรับ command assertion ถูกยืดเวลาถ้า the
     wait signal (NWAIT) แอคทีฟ (low) ที่จุดสุดท้ายของค่าที่โปรแกรมของ HCLK:
     0000 0000: Reserved
     0000 0001: 2 HCLK cycles (+ wait cycle ที่เพิ่มขึ้นโดยการถอนการยืนยันของ NWAIT)
     1111 1110: 255 HCLK cycles (+ wait cycle ที่เพิ่มขึ้นโดยการถอนการยืนยันของ  NWAIT)
     1111 1111: Reserved.

Bits 7:0 ATTSET[7:0]: Attribute memory setup time
     กำหนดจำนวนของ HCLK (+1) clock cycles เพื่อเซ็ตอัฟ the address ก่อน the command assertion (NWE, NOE), สำหรับ
     NAND Flash read or write access ไปยัง attribute memory space บน socket:
     0000 0000: 1 HCLK cycle
     1111 1110: 255 HCLK cycles
     1111 1111: reserved

tha

ECC result registers (FMC_ECCR)

Address offset: 0x94
Reset value: 0x0000 0000

registers เหล่านี้บรรจุ the current error correction code value ที่คำนวณโดย the ECC computation modules ของ the FMC NAND controller. เมื่อ the CPU อ่าน the data จาก a NAND Flash memory page ที่ the correct address (อ้างอิงถึง Section 13.6.6: Computation of the error correction code (ECC) in NAND Flash memory), the data ที่อ่าน/เขียน จาก/ถึง the NAND Flash memory จะถูกประมวลผลโดยอัตโนมัติโดย ECC computation module. เมื่อ X bytes ถูกอ่านแล้ว (สอดคล้องกันกับ the ECCPS field ใน the FMC_PCRx registers), the CPU ต้องอ่าน the computed ECC value จาก the FMC_ECCx registers, และจากนั้นตรวจสอบว่า computed parity data เหล่านี้เป็นอย่างเดียวกันกับ the parity value ที่บันทึกใน the spare area, เพื่อตัดสินว่า a page ใช้ได้, และ, เพื่อตรวจแก้มันอีกอย่างหนึ่ง. The FMC_ECCRx registers ควรถูกเคลียร์หลังจากถูกอ่านโดยการเซ็ต the ECCEN bit เป็น '0'. เพื่อคำนวณ a new data block, the ECCEN bit ต้องถูกเซ็ตเป็น '1'.



Bits 31:0 ECC[31:0]: ECC result
     field นี้บรรจุค่าที่คำนวณโดย the ECC computation logic. Table 87 อธิบายสิ่งที่จุภายในของ bit fields เหล่านี้.


tha

13.7 SDRAM controller

13.7.1 SDRAM controller main features

คุณลักษณะหลักของ the SDRAM controller เป็นดังนี้:
•   Two SDRAM banks ที่มี independent configuration
•   8-bit, 16-bit, 32-bit data bus width
•   13-bits Address Row, 11-bits Address Column, 4 internal banks: 4x16Mx32bit (256 MB), 4x16Mx16bit (128
     MB), 4x16Mx8bit (64 MB)
•   Word, half-word, byte access
•   SDRAM clock สามารถเป็น HCLK/2 or HCLK/3
•   Automatic row and bank boundary management
•   Multibank ping-pong access
•   Programmable timing parameters
•   Automatic Refresh operation ที่มี programmable Refresh rate
•   Self-refresh mode
•   Power-down mode
•   SDRAM power-up initialization by software
•   CAS latency of 1,2,3
•   Cacheable Read FIFO ด้วยความลึก 6 lines x32-bit (6 x14-bit address tag)

tha

13.7.2 SDRAM External memory interface signals

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


tha

13.7.3 SDRAM controller functional description

ทุก SDRAM controller outputs (signals, address and data) จะเปลี่ยนบนขอบขาลงของ the memory clock (FMC_SDCLK).

SDRAM initialization

The initialization sequence ถูกจัดการโดย software. ถ้า the two banks ถูกใช้, the initialization sequence ต้องถูกสร้างพร้อมกันไปยัง Bank 1 and Bank 2 โดยการเซ็ต the Target Bank bits CTB1 and CTB2 ใน the FMC_SDCMR register:
1.  โปรแกรม the memory device features ลงใน the FMC_SDCRx register. The SDRAM clock frequency, RBURST and
     RPIPE ต้องถูกโปรแกรมใน the FMC_SDCR1 register.
2.  โปรแกรม the memory device timing ลงใน the FMC_SDTRx register. The TRP and TRC timings ต้องถูกโปรแกรมใน
     the FMC_SDTR1 register.
3.  เซ็ต MODE bits เป็น '001' และกำหนดค่า the Target Bank bits (CTB1 and/or CTB2) ใน the FMC_SDCMR register เพื่อ
     สตาร์ทการส่ง the clock ไปยัง the memory (SDCKE ถูกขับ high).
4.  รอในระหว่าง the prescribed delay period. delay โดยทั่วไปจะประมาณ 100 μs (ดูที่ the SDRAM datasheet สำหรับ the
     required delay หลังจาก power-up).
5.  เซ็ต MODE bits เป็น '010' และกำหนดค่า the Target Bank bits (CTB1 and/or CTB2) ใน the FMC_SDCMR register เพื่อ
     ปล่อยออก a "Precharge All" command.
6.  เซ็ต MODE bits เป็น '011', และกำหนดค่า the Target Bank bits (CTB1 and/or CTB2) ตลอดจนจำนวนของ consecutive
     Auto-refresh commands (NRFS) ใน the FMC_SDCMR register. ดูที่ the SDRAM datasheet สำหรับจำนวนของ Auto-
     refresh commands ที่ควรถูกปล่อยออก. จำนวนโดยทั่วไปคือ 8.