The following Configuration is only for the Cortex M7 series MCUsตอนนี้เนื่องจากฉันใช้ MCU ที่ใช้ a cortex M7 ซึ่งไม่มี Flash memory เพียงพอ ฉันต้องใช้ the external flash และต้องกำหนดค่า MPU ให้เหมือนกัน ส่วนต่อไปนี้ของการกำหนดค่าใช้ได้สำหรับสิ่งที่เหมือนกันเท่านั้น

• The MPU Control mode ถูกเซ็ตเป็น “Background Region Privileged access only + MPU disabled during hardfault”
• ฉันได้เปิดใช้งาน the Instruction prefetch, CPU ICache and DCache.
ต่อไปนี้คือ the MPU Configuration สำหรับ the external Flash, ซึ่งถูกวางตำแหน่งที่ the memory address 0x90000000 และมีขนาด 16 MB.

• โดยพื้นฐานฉันได้เซ็ต the 16 MB Region (external flash) เป็น the cacheable and bufferable region. สิ่งนี้จะกำหนดค่า the
memory region เป็น the Normal memory type ที่มี write back attribute.
• The 1 MB ในตอนเริ่มต้นจะอนุญาตให้ the instructions ถูกปฏิบัติจาก region นี้ได้ด้วย.
หากคุณต้องการเรียนรู้เพิ่มเติมเกี่ยวกับ MPU configuration and memory types, เราขอแนะนำให้คุณดู STM32 MPU Config playlist ใน the topic
https://www.youtube.com/playlist?list=PLfIJKC1ud8gjoY2McCCqkxXWuwiC2iSap