3.3 MPU例子分析
例子在TivaWare安装目录下,examples\boards\ek-tm4c123gxl\mpu_fault,支持多种开发环境,CCS,Keil uVision,GCC等。
This example application demonstrates the use of the MPU to protect a region of memory from access,
and to generate a memory management fault when there is an access violation.
开始之前,建议阅读datasheet2.4节memory model,对memory map有个大概了解,
Table 2-4. Memory Map
3.3.1调用ROM_MPURegionSet()
代码中共设置6个区域,我们以第一个为例,参考SW-TM4C-DRL-UG-2.1.4.178.pdf 19.2.2.9 MPURegionSet
#define FLASH_BASE 0x00000000 // FLASH memory in hw_memmap.h
ROM_MPURegionSet</