STM32F7 13 Flexible memory controller (FMC)

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

Previous topic - Next topic

tha

Cross boundary page for CellularRAM™ 1.5

Cellular RAM 1.5 ไม่อนุญาติ burst access ข้าม the page boundary. The FSMC controller อนุญาติแยก the burst access โดยอัตโนมัติเมื่อ the memory page size ถูกถึงโดยการกำหนดค่า the CPSIZE bits ใน the FSMC_BCR1 register ตามหลัง the memory page size.

tha

Wait management

สำหรับ synchronous NOR Flash memories, NWAIT จะได้รับการประเมินหลังจาก the programmed latency period, ซึ่งตรงกันกับ (DATLAT+2) CLK clock cycles.

ถ้า NWAIT แอคทีฟ (low level เมื่อ WAITPOL = 0, high level เมื่อ WAITPOL = 1), wait states จะถูกใส่ไว้จนกว่า NWAIT ไม่แอคทีฟ (high level เมื่อ WAITPOL = 0, low level เมื่อ WAITPOL = 1).

เมื่อ NWAIT ไม่แอคทีฟ, the data ถูกพิจารณาว่าถูกต้อง โดยทันที (bit WAITCFG = 1) หรือบน the next clock edge (bit WAITCFG = 0) อย่างใดอย่างหนึ่ง.

ในระหว่าง wait-state insertion โดยทาง the NWAIT signal, the controller จะส่ง clock pulses อย่างต่อเนื่องไปยัง the memory, ทำให้ the chip select and output enable signals ถูกต้อง, และมันไม่ได้พิจารณาว่า the data ถูกต้อง.

ใน Burst mode, มี two timing configurations สำหรับ the NOR Flash NWAIT signal:
•    Flash memory ยืนยัน the NWAIT signal หนึ่ง data cycle ก่อน the wait state (ค่าเริ่มต้นหลังจาก reset)
•    Flash memory ยืนยัน the NWAIT signal ในระหว่าง the wait state

The FMC รองรับทั้งสอง NOR Flash wait state configurations, สำหรับแต่ละ chip select, ขอบคุณ the WAITCFG bit in the FMC_BCRx registers (x = 0..3).










tha

13.5.6 NOR/PSRAM controller registers

SRAM/NOR-Flash chip-select control register for bank x (FMC_BCRx) (x = 1 to 4)

Address offset: 8 * (x – 1), (x = 1 to 4)
Reset value: Bank 1: 0x0000 30DB
Reset value: Bank 2: 0x0000 30D2
Reset value: Bank 3: 0x0000 30D2
Reset value: Bank 4: 0x0000 30D2
register นี้บรรจุ the control information ของแต่ละ memory bank, ที่ใช้สำหรับ SRAMs, PSRAM and NOR Flash memories.



Bits 31:22 Reserved, must be kept at reset value.

Bit 21 WFDIS: Write FIFO Disable
     บิตนี้ปิดใช้งาน the Write FIFO ที่ใช้สำหรับ the FMC controller.
     0: Write FIFO ถูกเปิดใช้งาน (ค่าเริ่มต้นหลังจาก reset)
     1: Write FIFO ถูกปิดใช้งาน
  Note: The WFDIS bit of the FMC_BCR2..4 registers นั้นไม่สนใจ. มันถูกเปิดใช้งานเฉพาะผ่านทาง the FMC_BCR1 register.

Bit 20 CCLKEN: Continuous Clock Enable.
     บิตนี้เปิดใช้งาน the FMC_CLK clock output ไปยัง external memory devices.
     0: The FMC_CLK ถูกสร้างเฉพาะในระหว่าง the synchronous memory access (read/write transaction). The FMC_CLK
         clock ratio ถูกระบุโดย the programmed CLKDIV value ใน the FMC_BCRx register (ค่าเริ่มต้นหลังจาก reset).
     1: The FMC_CLK ถูกสร้างอย่างต่อเนื่องในระหว่าง asynchronous and synchronous access. The FMC_CLK clock ถูกทำให้
         ทำงานเมื่อ the CCLKEN ถูกเซ็ต.
Note: The CCLKEN bit of the FMC_BCR2..4 registers นั้นไม่สนใจ. มันถูกเปิดใช้งานเฉพาะผ่านทาง the FMC_BCR1 register.
            Bank 1 ต้องถูกกำหนดค่าใน Synchronous mode เพื่อสร้าง the FMC_CLK continuous clock.
  Note: ถ้า CCLKEN bit ถูกเซ็ต, the FMC_CLK clock ratio จะถูกระบุโดย CLKDIV value ใน the FMC_BTR1 register.
            CLKDIV ใน FMC_BWTR1 นั้นไม่สนใจ.
  Note: ถ้า the Synchronous mode ถูกใช้และ CCLKEN bit ถูกเซ็ต, the synchronous memories ที่ต่อกับ banks อื่นที่ไม่ใช่
            Bank 1 จะถูกให้สัญญานนาฬิกาโดย the same clock (the CLKDIV value ใน the FMC_BTR2..4 and FMC_BWTR2..4
            registers สำหรับ banks อื่นจะไม่มีผลอะไร.)


tha

Bit 19 CBURSTRW: Write burst enable.
     สำหรับ PSRAM (CRAM) operating ใน Burst mode, the bit เปิดใช้งาน synchronous accesses ในระหว่าง write
     operations. The enable bit สำหรับ synchronous read accesses คือ the BURSTEN bit ใน the FMC_BCRx register.
     0: Write operations ถูกดำเนินการใน asynchronous mode เสมอ
     1: Write operations ถูกดำเนินการใน synchronous mode.

Bits 18: 16 CPSIZE[2:0]: CRAM page size.
     เหล่านี้ถูกใช้สำหรับ Cellular RAM 1.5 ซึ่งไม่ยอมให้ burst access ข้าม the address boundaries ระหว่าง pages. เมื่อบิตเหล่านี้
     ถูกกำหนดค่า, the FMC controller จะแยก the burst access โดยอัตโนมัติเมื่อ the memory page size ถูกถึง (อ้างอิงถึง
     memory datasheet สำหรับ page size).
     000: ไม่มี burst แยกออกเมื่อข้าม page boundary (ค่าเริ่มต้นหลังจาก reset)
     001: 128 bytes
     010: 256 bytes
     011: 512 bytes
     100: 1024 bytes
     อื่นๆ: สงวนไว้.

Bit 15 ASYNCWAIT: Wait signal during asynchronous transfers
     บิตนี้ enables/disables the FMC เพื่อใช้ the wait signal แม้ในระหว่าง an asynchronous protocol.
     0: NWAIT signal ไม่ถูกคำนึงถึงเมื่อรัน an asynchronous protocol (ค่าเริ่มต้นหลังจาก reset)
     1: NWAIT signal ถูกคำนึงถึงเมื่อรัน an asynchronous protocol

Bit 14 EXTMOD: Extended mode enable.
     บิตนี้เปิดการใช้งาน the FMC เพื่อโปรแกรม the write timings สำหรับ non-multiplexed asynchronous accesses ภายใน the
     FMC_BWTR register, ดังนั้นเป็นผลให้เวลาสำหรับ read and write operations แตกต่างกัน.
     0: values ภายใน FMC_BWTR register ไม่ถูกคำนึงถึง (ค่าเริ่มต้นหลังจาก reset)
     1: values ภายใน FMC_BWTR register ถูกคำนึงถึง
  Note: เมื่อ the extended mode ถูกปิดใช้งาน, the FMC สามารถทำงานใน Mode1 or Mode2 ดังต่อไปนี้:
           – Mode 1 คือ the default mode เมื่อ the SRAM/PSRAM memory type ถูกเลือก (MTYP [0:1]=0x0 or 0x01)
           – Mode 2 คือ the default mode เมื่อ the NOR memory type ถูกเลือก (MTYP [0:1]= 0x10).

tha

Bit 13 WAITEN: Wait enable bit.
     บิตนี้ enables/disables wait-state insertion โดยทาง the NWAIT signal เมื่อเข้าถึง the Flash memory ใน synchronous
     mode.
     0: NWAIT signal ถูกปิดใช้งาน ( level ของมันไม่ถูกคำนึงถึง, ไม่มี wait state ถูกแทรกหลังจาก the programmed Flash
          latency period)
     1: NWAIT signal ถูกเปิดใช้งาน (level ของมันถูกคำนึงถึงหลังจาก the programmed Flash latency period เพื่อแทรก wait
          states ถ้าถูกยืนยัน) (ค่าเริ่มต้นหลังจาก reset)

Bit 12 WREN: Write enable bit.
     บิตนี้แสดงให้เห็นว่า write operations ถูก enabled/disabled ใน the bank โดย the FMC:
     0: Write operations ถูกปิดใช้งานใน the bank โดย the FMC, an AHB error ถูกรายงาน,
     1: Write operations ถูกเปิดใช้งานสำหรับ the bank โดย the FMC (ค่าเริ่มต้นหลังจาก reset)

Bit 11 WAITCFG: Wait timing configuration.
     The NWAIT signal แสดงให้เห็นว่า the data จาก the memory ถูกต้องหรือว่า a wait state ต้องถูกแทรกหรือไม่เมื่อเข้าถึง the
     memory ใน synchronous mode. configuration bit นี้กำหนดว่า NWAIT ถูกยืนยันโดย the memory หนึ่ง clock cycle ก่อน 
     the wait state หรือในระหว่าง the wait state:
     0: NWAIT signal is active หนึ่ง data cycle ก่อน wait state (default after reset),
     1: NWAIT signal is active ในระหว่าง wait state (ไม่ถูกใช้สำหรับ PRAM).

Bit 10 Reserved, must be kept at reset value.

tha

Bit 9 WAITPOL: Wait signal polarity bit.
     กำหนดขั้วของ the wait signal จาก memory ที่ใช้สำหรับอย่างใดอย่างหนึ่งใน Synchronous หรือ Asynchronous mode :
     0: NWAIT active low (ค่าเริ่มต้นหลังจาก reset),
     1: NWAIT active high.

Bit 8 BURSTEN: Burst enable bit.
     บิตนี้ enables/disables synchronous accesses ในระหว่าง read operations. มันใช้ได้เฉพาะสำหรับ synchronous
     memories ที่ทำงานใน burst mode:
     0: Burst mode ถูกปิดใช้งาน (ค่าเริ่มต้นหลังจาก reset). Read accesses ถูกดำเนินการใน Asynchronous mode.
     1: Burst mode ถูกเปิดใช้งาน. Read accesses ถูกดำเนินการใน Synchronous mode.

Bit 7 Reserved, must be kept at reset value.

Bit 6 FACCEN: Flash access enable
     เปิดใช้งาน NOR Flash memory access operations.
     0: Corresponding NOR Flash memory access ถูกปิดใช้งาน
     1: Corresponding NOR Flash memory access ถูกเปิดใช้งาน (default after reset)

tha

Bits 5:4 MWID[1:0]: Memory data bus width.
     กำหนด the external memory device width, ใช้ได้สำหรับทุกชนิดของ memories.
     00: 8 bits
     01: 16 bits (default after reset)
     10: 32 bits
     11: reserved

Bits 3:2 MTYP[1:0]: Memory type.
     กำหนดชนิดของ external memory ที่ต่อกับ the corresponding memory bank:
     00: SRAM (ค่าเริ่มต้นหลังจาก reset สำหรับ Bank 2...4)
     01: PSRAM (CRAM)
     10: NOR Flash/OneNAND Flash (ค่าเริ่มต้นหลังจาก reset สำหรับ Bank 1)
     11: reserved

Bit 1 MUXEN: Address/data multiplexing enable bit.
     เมื่อบิตนี้ถูกเซ็ต, the address and data values ถูกใช้ซ้อนกันบน the data bus, ใช้ได้เฉพาะกับ NOR and PSRAM
     memories:
     0: Address/Data ไม่ซ้อนกัน
     1: Address/Data ถูกซ้อนกันบน databus (ค่าเริ่มต้นหลังจาก reset)

Bit 0 MBKEN: Memory bank enable bit.
     เปิดใช้งาน the memory bank. หลังจากรีเซ็ต Bank1 ถูกเปิดใช้งาน, อื่นๆทั้งหมดถูกปิดใช้งาน. การเข้าถึง a disabled bank เป็น
     เหตุให้เกิด an ERROR บน AHB bus.
     0: Corresponding memory bank ถูกปิดใช้งาน
     1: Corresponding memory bank ถูกเปิดใช้งาน

tha

SRAM/NOR-Flash chip-select timing register for bank x (FMC_BTRx)

Address offset: 0x04 + 8 * (x – 1), (x = 1 to 4)
Reset value: 0x0FFF FFFF

register นี้บรรจุ the control information ของแต่ละ memory bank, ที่ใช้สำหรับ SRAMs, PSRAM and NOR Flash memories. ถ้า the EXTMOD bit ถูกเซ็ตใน the FMC_BCRx register, ดังนั้น register นี้ถูกแยกสำหรับ write และ read access, นั่นคือ, 2 registers มีให้ใช้งาน: หนึ่งเพื่อกำหนดค่า read accesses (register นี้) และหนึ่งเพื่อกำหนดค่า write accesses (FMC_BWTRx registers).



Bits 31:30 Reserved, must be kept at reset value.

Bits 29:28 ACCMOD[1:0]: Access mode
     ระบุ the asynchronous access modes ดังแสดงใน the timing diagrams. บิตเหล่านี้ถูกคำนึงถึงเฉพาะเมื่อ the EXTMOD bit
     ใน the FMC_BCRx register เป็น 1.
     00: access mode A
     01: access mode B
     10: access mode C
     11: access mode D

Bits 27:24 DATLAT[3:0]: (ดู note ข้างล่าง bit description): Data latency for synchronous memory
     สำหรับ synchronous access พร้อมด้วย read/write burst mode ถูกเปิดการใช้งาน  (BURSTEN / CBURSTRW bits ถูกเซ็ต),
     กำหนดจำนวนของ memory clock cycles (+2) เพื่อปล่อยออกไปยัง the memory ก่อน reading/writing the first data.
     timing parameter นี้ไม่ถูกแสดงใน HCLK periods, แต่ใน FMC_CLK periods.
     สำหรับ asynchronous access, ค่านี้ไม่ต้องสนใจ.
     0000: Data latency of 2 CLK clock cycles สำหรับ first burst access
     1111: Data latency of 17 CLK clock cycles สำหรับ first burst access (ค่าเริ่มต้นหลังจาก reset)

Bits 23:20 CLKDIV[3:0]: Clock divide ratio (for FMC_CLK signal)
     กำหนดคาบเวลาของ of FMC_CLK clock output signal, ที่แสดงในจำนวนของ HCLK cycles:
     0000: Reserved
     0001: FMC_CLK period = 2 × HCLK periods
     0010: FMC_CLK period = 3 × HCLK periods
     1111: FMC_CLK period = 16 × HCLK periods (default value after reset)
     ใน asynchronous NOR Flash, SRAM or PSRAM accesses, ค่านี้ไม่ต้องสนใจ.
  Note: ดูที่ Section 13.5.5: Synchronous transactions for FMC_CLK divider ratio formula)