STM32F7 13 Flexible memory controller (FMC)

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

Previous topic - Next topic

tha

Configuration registers

The FMC สามารถถูกกำหนดค่าผ่านทางชุดของ registers. ดูที่ Section 13.5.6, สำหรับการอธิบายโดยละเอียดของ the NOR Flash/PSRAM controller registers. ดูที่ Section 13.6.7, สำหรับการอธิบายโดยละเอียดของ the NAND Flash registers และที่ Section 13.7.5 สำหรับการอธิบายโดยละเอียดของ the SDRAM controller registers.

tha

13.4 External device address mapping

จากมุมมองของ the FMC , the external memory ถูกแบ่งออกเป็น fixed-size banks ของแต่ละ 256 Mbytes (ดู Figure 34):
•   Bank 1 ถูกใช้เพื่อระบุที่อยู่มากถึง 4 NOR Flash memory หรือ PSRAM devices. bank นี้ถูกแบ่งออกเป็น 4 NOR/PSRAM
     subbanks ที่มี 4 dedicated chip selects, ดังต่อไปนี้:
     –   Bank 1 - NOR/PSRAM 1
     –   Bank 1 - NOR/PSRAM 2
     –   Bank 1 - NOR/PSRAM 3
     –   Bank 1 - NOR/PSRAM 4
•   Bank 3 ถูกใช้เพื่อระบุที่อยู่ NAND Flash memory devices.The MPU memory attribute สำหรับพื้นที่นี้ต้องถูกกำหนดค่าใหม่
     โดย software ไปยัง Device.
•   Bank 4 and 5 ถูกใช้เพื่อระบุที่อยู่ SDRAM devices (1 device ต่อ bank).

สำหรับแต่ละ bank the type of memory ที่จะถูกใช้สามารถถูกกำหนดค่าโดย the user application ผ่านทาง the Configuration register.


tha

13.4.1 NOR/PSRAM address mapping

HADDR[27:26] bits ถูกใช้เพื่อเลือกหนึ่งใน the four memory banks ดังแสดงใน Table 48.



The HADDR[25:0] bits บรรจุ the external memory address. เนื่องจาก HADDR เป็น a byte address ในขณะที่ the memory ถูกระบุที่อยู่ที่ word level, the address จริงๆแล้วถูกปล่อยออกไปยัง the memory จะแตกต่างกันไปตาม the memory data width, ดังแสดงใน the following table.


1.   ในกรณีของ a 16-bit external memory width, the FMC จะใช้ภายใน HADDR[25:1] เพื่อสร้าง the address สำหรับ
      external memory FMC_A[24:0]. ในกรณีของ a 32-bit memory width, the FMC จะใช้ภายใน HADDR[25:2] เพื่อสร้าง
      the external address.
      ไม่ว่า the external memory width เป็นเท่าใด, FMC_A[0] ควรถูกต่อกับ external memory address A[0].


tha

13.4.2 NAND Flash memory address mapping

The NAND bank ถูกแบ่งออกเป็น memory areas ดังที่แสดงให้เห็นใน Table 50.



For NAND Flash memory, the common and attribute memory spaces ถูกแบ่งย่อยออกเป็นสาม sections (ดูใน Table 51 ข้างล่าง) ที่ตำแหน่งอยู่ใน 256 Kbytes ล่าง:
•   Data section (first 64 Kbytes in the common/attribute memory space)
•   Command section (second 64 Kbytes in the common / attribute memory space)
•   Address section (next 128 Kbytes in the common / attribute memory space)



The application software ใช้ the 3 sections เพื่อเข้าถึง the NAND Flash memory:
•   เพื่อส่ง a command ไปยัง NAND Flash memory, the software ต้องเขียน the command value ไปยัง memory location
     ใดๆใน the command section.
•   เพื่อระบุ the NAND Flash address ที่ต้องถูกอ่านหรือถูกเขียน, the software ต้องเขียน the address value ไปยัง memory
     location ใดๆใน the address section. เนื่องจาก an address สามารถยาว 4 หรือ 5 bytes (ขึ้นอยู่กับ the actual memory
     size), several consecutive write operations ไปยัง the address section ถูกต้องการเพื่อระบุ the full address.
•   เพื่ออ่านหรือเขียน data, the software อ่านหรือเขียน the data จาก/ไปยัง memory location ใดๆใน the data section

เนื่องจาก the NAND Flash memory เพิ่ม addresses ขึ้นโดยอัตโนมัติ, ไม่มีความจำเป็นต้องเพิ่ม the address of the data section เพื่อเข้าถึง consecutive memory locations.

tha

13.4.3 SDRAM address mapping

The HADDR[28] bit (internal AHB address line 28) ถูกใช้เพื่อเลือกหนึ่งใน the two memory banks ดังที่แสดงให้เห็นใน Table 52.



The following table แสดง SDRAM mapping สำหรับ a 13-bit row, a 11-bit column และ a 4 internal bank configuration.


1.   เมื่ออินเตอร์เฟสกับ a 16-bit memory, the FMC ใช้ภายใน the HADDR[11:1] internal AHB address lines เพื่อสร้าง the
      external address. ไม่ว่า the memory width เป็นเท่าใด, FMC_A[0] ต้องถูกต่อกับ external memory address A[0].
2.   The AutoPrecharge ไม่ถูกรองรับ. FMC_A[10] ต้องถูกต่อกับ the external memory address A[10] แต่มันจะถูกขับ 'low'
      เสมอ.

tha

The HADDR[27:0] bits ถูกแปลเป็น external SDRAM address ขึ้นอยู่กับ the SDRAM controller configuration:
•   Data size:8, 16 or 32 bits
•   Row size:11, 12 or 13 bits
•   Column size: 8, 9, 10 or 11 bits
•   จำนวนของ internal banks: สองหรือสี่ internal banks

The following tables แสดง the SDRAM address mapping เทียบกับ the SDRAM controller configuration.


1.   BANK[1:0] เป็น the Bank Address BA[1:0]. เมื่อเฉพาะ 2 internal banks ถูกใช้, BA1 ต้องถูกเซ็ตเป็น '0' เสมอ.
2.   เข้าถึงไปยัง Reserved (Res.) address range จะสร้าง an AHB error.




tha

13.5 NOR Flash/PSRAM controller

The FMC สร้าง the appropriate signal timings เพื่อขับประเภทต่อไปนี้ของ memories:
•   Asynchronous SRAM and ROM
     –   8 bits
     –   16 bits
     –   32 bits
•   PSRAM (CellularRAM™)
     –   Asynchronous mode
     –   Burst mode for synchronous accesses
     –   Multiplexed or non-multiplexed
•   NOR Flash memory
     –   Asynchronous mode
     –   Burst mode for synchronous accesses
     –   Multiplexed or non-multiplexed

The FMC ส่งออก a unique chip select signal, NE[4:1], ต่อ bank. สัญญาณอื่นๆ ทั้งหมด(addresses, data and control) จะถูกแชร์.

The FMC รองรับความหลากหลายของ devices ผ่านทาง a programmable timings ซึ่งได้แก่:
•   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 เพื่อรองรับความหลากหลายของ memories and timings
•   Programmable continuous clock (FMC_CLK) output.

The FMC Clock (FMC_CLK) เป็นตัวคูณย่อยของ the HCLK clock. มันสามารถถูกส่งไปยัง the selected external device อย่างใดอย่างหนึ่งในระหว่าง synchronous accesses เท่านั้นหรือในระหว่าง asynchronous and synchronous accesses ขึ้นอยู่กับ the CCKEN bit configuration ใน the FMC_BCR1 register:
•   ถ้า the CCLKEN bit ถูกรีเซ็ต, the FMC จะสร้าง the clock (CLK) เฉพาะในระหว่าง synchronous accesses (Read/write
     transactions).
•   ถ้า the CCLKEN bit ถูกเซ็ต, the FMC จะสร้าง a continuous clock ในระหว่าง asynchronous and synchronous accesses.
     เพื่อสร้าง the FMC_CLK continuous clock, Bank 1 ต้องถูกกำหนดค่าใน Synchronous mode (ดู Section 13.5.6:
     NOR/PSRAM controller registers). เนื่องจาก the same clock ถูกใช้สำหรับทุก synchronous memories, เมื่อ a
     continuous output clock ถูกสร้างและ synchronous accesses ถูกดำเนินการ, the AHB data size ต้องเป็นอย่างเดียวกันกับ
     the memory data width (MWID) มิฉะนั้น the FMC_CLK frequency จะถูกเปลี่ยนขึ้นอยู่กับ AHB data transaction (ดูที่
     Section 13.5.5: Synchronous transactions for FMC_CLK divider ratio formula)

ขนาดของแต่ละ bank ถูกคงที่และเท่ากับ 64 Mbytes. แต่ละ bank ถูกกำหนดค่าผ่านทาง dedicated registers (ดู Section 13.5.6: NOR/PSRAM controller registers).

The programmable memory parameters ได้รวม access times เอาไว้(ดู Table 57) และรองรับสำหรับ wait management (สำหรับ PSRAM and NOR Flash ถูกเข้าถึงใน Burst mode).


tha

13.5.1 External memory interface signals

Table 58, Table 59 and Table 60 แสดงรายการสัญญาณที่ถูกใช้โดยทั่วไปเพื่อเชื่อมต่อกับ NOR Flash memory, SRAM and PSRAM.

Note:   คำนำหน้า "N" ระบุ the signals ที่ active low.

NOR Flash memory, non-multiplexed I/Os



The maximum capacity คือ 512 Mbits (26 address lines).