STM32F7 3 Embedded Flash memory (FLASH)

Started by tha, October 05, 2022, 07:22:52 AM

Previous topic - Next topic

tha

3 Embedded Flash memory (FLASH)

3.1 Introduction

The Flash memory interface จัดการ Cortex®-M7 AXI and TCM เข้าถึงไปยัง the Flash memory. มันจัดให้มีใช้ the erase and program Flash memory operations และ the read and write protection mechanisms.

The Flash memory interface เร่ง code execution ด้วย a system of instruction prefetch และ cache lines บน ITCM interface (ART Accelerator™).

3.2 Flash main features

•   Flash memory read operations
•   Flash memory program/erase operations
•   Read / write protections
•   64 cache lines of 256 bits on ITCM interface (ART Accelerator™)
•   Prefetch on TCM instruction code

Figure 3 แสดง the Flash memory interface connection ภายใน the system architecture.


tha

3.3.1 Flash memory organization

The Flash memory มี the following main features:
•   ความจุมากถึง 1 Mbyte บน STM32F756xx and STM32F74xx devices และ 64 Kbytes บน STM32F750xx devices
•   256 bits wide data read
•   Byte, half-word, word and double word write
•   Sector and mass erase

tha

The Flash memory ถูกจัดระเบียบดังต่อไปนี้:
•   บน STM32F756xx and STM32F74xx devices, a main memory block ถูกแบ่งออกเป็น 4 sectors ของ 32 Kbytes, 1
     sector ของ 128 Kbytes และ 3 sectors ของ 256 Kbytes
•   บน STM32F750xx devices, a main memory block ถูกแบ่งออกเป็น 2 sectors ของ 32 Kbytes.
•   Information blocks บรรจุ:
     –   System memory ซึ่ง the device บู๊ตจากใน System memory boot mode
     –   1024 OTP (one-time programmable) สำหรับ user data
     –   The OTP area บรรจุ 16 additional bytes ที่ใช้เพื่อล็อค the corresponding OTP data block.
     –   Option bytes เพื่อกำหนดค่า read and write protection, BOR level, software/hardware watchdog, boot memory
          base address และ reset เมื่อ the device อยู่ใน Standby หรือ Stop mode.


tha

The embedded flash มี three main interfaces:
•   64-bits ITCM interface:
     –   มันถูกเชื่อมต่อถึง the ITCM bus of Cortex-M7 และถูกใช้สำหรับ instruction execution และ data read access.
     –   Write accesses ไม่ถูกรองรับบน ITCM interface
     –   รองรับ a unified 64 cache lines of 256 bits (ART accelerator)
•   64-bits AHB interface:
     –   มันถูกเชื่อมต่อถึง the AXI bus of Cortex-M7 ผ่านทาง the AHB bus matrix และถูกใช้สำหรับ code execution, read and
          write accesses.
     –   DMAs and peripherals DMAs data transfer on Flash ถูกกระทำผ่านทาง the AHB interface ไม่ว่า the addressed
          flash อินเตอร์เฟส TCM หรือ AHB.
•   32-bits AHB register interface:
     –   มันถูกใชสำหรับ control and status register accesses.

The main memory and information block organization ถูกแสดงใน Table 3.



tha

3.3.2 Read access latency

เพื่ออ่าน data จาก Flash memory อย่างถูกต้อง, จำนวนของ wait states (LATENCY) ต้องถูกโปรแกรมอย่างถูกต้องใน the Flash access control register (FLASH_ACR) ให้สอดคล้องกับ the frequency of the CPU clock (HCLK) และ the supply voltage of the device.

ความตรงกันระหว่าง wait states และ CPU clock frequency ถูกให้ใน Table 14 และ Table 5.

Note:   -   เมื่อ VOS[1:0] = '0x01', the maximum value of fHCLK คือ 144 MHz.
            -   เมื่อ VOS[1:0] = '0x10', the maximum value of fHCLK คือ 168 MHz. มันสามารถถูกยืดถึง 180 MHz โดยการเปิด
                ใช้งาน the over-drive mode.
            -   เมื่อ VOS[1:0] = '0x11, the maximum value of fHCLK คือ 180 MHz. มันสามารถถูกยืดถึง 216 MHz โดยการเปิด
                ใช้งาน the over-drive mode.
            -   The over-drive mode ไม่มีให้ใช้งานเมื่อ VDD ช่วงจาก 1.8 ถึง 2.1 V.
            ดูที่ Section 4.1.4: Voltage regulator สำหรับรายละเอียดเกี่ยวกับวิธีเปิดใช้งาน the over-drive mode.



tha

หลังจากรีเซ็ต, the CPU clock frequency คือ 16 MHz และ 0 wait state (WS) ถูกกำหนดค่าใน the FLASH_ACR register.

ขอแนะนำอย่างยิ่งให้ใช้ the following software sequences เพื่อปรับจำนวนของ wait states เพื่อเข้าถึง the Flash memory ด้วย the CPU frequency นั้น.

Increasing the CPU frequency

1.   โปรแกรม the new number of wait states ไปยัง the LATENCY bits ใน the FLASH_ACR register
2.   ตรวจสอบว่า the new number of wait states ได้รับการพิจารณาในการเข้าถึง the Flash memory โดยการอ่าน the FLASH_ACR
      register
3.   แก้ไข the CPU clock source โดยการเขียน the SW bits ใน the RCC_CFGR register
4.   ถ้าจำเป็น, แก้ไข the CPU clock prescaler โดยการเขียน the HPRE bits ใน RCC_CFGR
5.   ตรวจสอบว่า the new CPU clock source or/and the new CPU clock prescaler value ได้รับการพิจารณาโดยการอ่าน the clock
      source status (SWS bits) or/and the AHB prescaler value (HPRE bits), ตามลำดับ, ใน the RCC_CFGR register.

tha

Decreasing the CPU frequency

1.   แก้ไข the CPU clock source โดยการเขียน the SW bits ใน the RCC_CFGR register
2.   ถ้าจำเป็น, แก้ไข the CPU clock prescaler โดยการเขียน the HPRE bits ใน RCC_CFGR
3.   ตรวจสอบว่า the new CPU clock source or/and the new CPU clock prescaler value ได้รับการพิจารณาโดยการอ่าน the clock
      source status (SWS bits) or/and the AHB prescaler value (HPRE bits), ตามลำดับ, ใน the RCC_CFGR register
4.   โปรแกรม the new number of wait states ไปยัง the LATENCY bits ใน FLASH_ACR
5.   ตรวจสอบว่า the new number of wait states ถูกใช้ในการเข้าถึง the Flash memory โดยการอ่าน the FLASH_ACR register

tha

Note:   การเปลี่ยน CPU clock configuration หรือ wait state (WS) configuration อาจไม่ได้ผลทันที. เพื่อให้แน่ใจว่า the current
            CPU clock frequency เป็นความถี่ที่ผู้ใช้กำหนดค่าแล้ว, ผู้ใช้สามารถตรวจสอบ the AHB prescaler factor และ clock source
            status values. เพื่อให้แน่ใจว่า the number of WS ที่โปรแกรมเป็นผล, ผู้ใช้สามารถอ่าน the FLASH_ACR register.