|
1. 下面这个汇编代码的配置有问题,暂时还没有解决,所以没有将这个程序加入配套例子中
__asm void mpu_cfg_copy(unsigned int src)
{
PUSH {R4-R9}
LDR R1, =0xE000ED9C // MPU->RBAR address
LDR R2, [R1,#-12] // Get MPU->TYPE
CMP R1, #0 // If zero
ITT EQ // If-Then
MOVSEQ R0, #1 // return 1
BEQ mpu_cfg_copy_end
DMB 0xF // Make sure outstanding transfers are done
MOVS R2, #0
STR R2, [R1, #-8] // MPU->CTRL = 0
LDMIA R0!, {R2-R9} // Read 8 words from table (base update)
STMIA R1, {R2-R9} // Write 8 words to MPU (no base update)
LDMIA R0!, {R2-R9} // Read 8 words from table (base update)
STMIA R1, {R2-R9} // Write 8 words to MPU (no base update)
DSB 0xF // Memory barriers to ensure subsequence data & instruction
ISB 0xF // transfers using updated MPU settings
MOVS R0, #0 // No error
mpu_cfg_copy_end
POP {R4-R9}
BX LR
ALIGN 4
}
2. 不知道怎么进入内存管理异常,现在老是进入硬件异常 |
|