此帖出自NXP MCU论坛
最新回复
有关mpu的设置函数如下,
void board_mpu_init( void )
{
/* - Region 0: 0x00000000 - 0x0007FFFF --- on-chip non-volatile memory
* + Size: 512kB
* + Acess permission: full access
*/
MPU->RNR = 0; // indicate MPU region 0
MPU->RBAR = 0x00000000; // update the base address for the region 0
MPU->RASR = MPU_RASR_ACCESS_PERMISSION( MPU_FULL_ACCESS ) //full access
|MPU_RASR_REGION_SIZE( MPU_REGION_SIZE_512KB ) //512Kb size
|MPU_REGION_ENABLE; //region enable
/* - Region 1: 0x10000000 - 0x1000FFFF --- on-chip SRAM
* + Size: 64kB
* + Access permission: full access
*/
MPU->RNR = 1;
MPU->RBAR = 0x10000000; // update the base address for the region 1
MPU->RASR = MPU_RASR_ACCESS_PERMISSION( MPU_FULL_ACCESS )
|MPU_RASR_REGION_SIZE( MPU_REGION_SIZE_64KB )
|MPU_REGION_ENABLE;
/* - Region 2: 0x40000000 - 0x400FFFFF --- APB peripheral
* + Size: 1MB
* + Access permission: full access
*/
MPU->RNR = 2;
MPU->RBAR = 0x40000000; // update the base address for the region 2
MPU->RASR = MPU_RASR_ACCESS_PERMISSION( MPU_FULL_ACCESS )
|MPU_RASR_REGION_SIZE( MPU_REGION_SIZE_1MB )
|MPU_REGION_ENABLE;
/* - Region 3: 0x20080000 - 0x200BFFFF --- AHB peripheral
* + Size: 256KB
* + AP=b011: full access
*/
MPU->RNR = 3;
MPU->RBAR = 0x20080000; // update the base address for the region 3
MPU->RASR = MPU_RASR_ACCESS_PERMISSION( MPU_FULL_ACCESS )
|MPU_RASR_REGION_SIZE( MPU_REGION_SIZE_256KB )
|MPU_REGION_ENABLE;
/* - Region 4: 0xE0000000 - 0xE00FFFFF --- System control
* + Size: 1MB
* + Access permission: full access
*/
MPU->RNR = 4;
MPU->RBAR = 0xE0000000; // update the base address for the region 4
MPU->RASR = MPU_RASR_ACCESS_PERMISSION(MPU_FULL_ACCESS)
|MPU_RASR_REGION_SIZE(MPU_REGION_SIZE_1MB)
|MPU_REGION_ENABLE;
/* - Region 5:0x20000000 - 0x20007FFF --- on chip SRAM
* + Size: 32kB
* + Access permission: full access
*/
MPU->RNR = 5;
MPU->RBAR = 0x20000000; // update the base address for the region 5
MPU->RASR = MPU_RASR_ACCESS_PERMISSION(MPU_FULL_ACCESS)
|MPU_RASR_REGION_SIZE(MPU_REGION_SIZE_32KB)
|MPU_REGION_ENABLE;
/* - Region 6:0x80000000 - 0x90000000 --- NandFlash
* + Size: 256MB
* + Access permission: full access
*/
MPU->RNR = 6;
MPU->RBAR = 0x80000000; // update the base address for the region 6
MPU->RASR = MPU_RASR_ACCESS_PERMISSION(MPU_FULL_ACCESS)
|MPU_RASR_REGION_SIZE(MPU_REGION_SIZE_256MB)
|MPU_REGION_ENABLE;
/* - Region 6:0xA0000000 - 0xA2000000 --- SDRAM
* + Size: 32MB
* + Access permission: full access
*/
MPU->RNR = 7;
MPU->RBAR = 0xA0000000; // update the base address for the region 7
MPU->RASR = MPU_RASR_ACCESS_PERMISSION( MPU_FULL_ACCESS )
|MPU_RASR_REGION_SIZE( MPU_REGION_SIZE_32MB )
|MPU_REGION_ENABLE;
SCB->SHCSR |=(1
详情
回复
发表于 2015-12-5 11:18
| ||
|
||
| |
个人签名我的博客
|
|
| |
|
|
此帖出自NXP MCU论坛
| ||
|
||
此帖出自NXP MCU论坛
点评 | ||
|
||
此帖出自NXP MCU论坛
| ||
|
||
此帖出自NXP MCU论坛
点评 | ||
|
||
此帖出自NXP MCU论坛
| ||
|
||
此帖出自NXP MCU论坛
| ||
|
||
曾经的版主且威望大于2000,或对EEWORLD论坛有突出贡献的坛友
EEWorld Datasheet 技术支持
EEWorld订阅号
EEWorld服务号
汽车开发圈