Part Number: TMS570LC4357
Hi,
On TMS570LC4357 at power-up, we are configuring PLL and MPU regions as per our memory requirements and we are able to successfully configure them. But when we jump from Boot to Application we have to re-configure the MPU as per the application requirements.
Below is the sequence of initialization in Boot:
- Core Register Initialization
- Initialize Stack Pointer
- Initialize L2 RAM
- System Initialization
- Configure IRQ offsets
- Initialize VIM table
- Initialize ESM group1
- SystemClock Initialization
- MPU Initialization
And below is the sample snippet code for configuring the MPU regions:
mpuInit_
; Disable mpu
mrc p15, #0, r0, c1, c0, #0
bic r0, r0, #1
dsb
mcr p15, #0, r0, c1, c0, #0
isb
; Disable background region
mrc p15, #0, r0, c1, c0, #0
bic r0, r0, #0x20000
mcr p15, #0, r0, c1, c0, #0
; Setup region 1
mov r0, #0
mcr p15, #0, r0, c6, c2, #0
ldr r0, r1Base
mcr p15, #0, r0, c6, c1, #0
mov r0, #0x0008
orr r0, r0, #0x1000
mcr p15, #0, r0, c6, c1, #4
movw r0, #((1 << 15) + (1 << 14) + (1 << 13) + (1 << 12) + (1 << 11) + (1 << 10) + (1 << 9) + (1 << 8) + (0x1F << 1) + (1))
mcr p15, #0, r0, c6, c1, #2
A similar sequence of StartUp initializations is followed when the application is launched. The boot is able to successfully configure the MPU and launch the application but, when the application starts initializing the MPU we are getting exceptions when the 'dsb' instruction is executed while disabling the MPU.
Please let me know if we are missing any requirements while initializing the MPU.
Thanks & Regards,
Parth
