Dear all,
I have a trouble with FlexRAM resize.
Following reference Reallocating-the-FlexRAM , i can change IMXRT1021 ram size (ITC-OC-DTC) from default (64KB-128KB-64KB) to new value (64KB-64KB-128KB).
After flash program with Jlink, device can success boot up, run application without any problems.
When i call software reset (NVIC_SystemReset), device still booting up again and work fine.
But when i turnoff power source and turn on again, device never run to application success. Could you please give me your suggestion?
Thank you.
Edit1: With default RAM config, device can boot ok, booting problem only happen when i relocate FlexRAM
This is my configuration for relocate FlexRAM
1. Reset handler
void ResetISR(void) {
// Disable interrupts
__asm volatile ("cpsid i");
// For debug only
volatile unsigned int IOMUXC_GPR_GPR17_Reg = *((unsigned int *) 0x400ac044);
volatile unsigned int IOMUXC_GPR_GPR16_Reg = *((unsigned int *) 0x400ac040);
//
/* Reallocating the FlexRAM */
__asm (".syntax unified\n"
"LDR R0, =0x400ac044\n" //Address of register IOMUXC_GPR_GPR17
"LDR R1, =0x00005FAA\n" //FlexRAM configuration DTC = 128KB, ITC = 64KB, OC = 64KB
"STR R1,[R0]\n"
".syntax divided\n");
__asm volatile ("MSR MSP, %0" : : "r" (&_vStackTop) : );
...........
}
2. MPU config for new FlexRAM configuration
/* Region 4 setting: Memory with Device type, not shareable, non-cacheable. */
MPU->RBAR = ARM_MPU_RBAR(4, 0x00000000U);
MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1GB);
/* Region 5 setting: Memory with Normal type, not shareable, outer/inner write back */
MPU->RBAR = ARM_MPU_RBAR(5, 0x00000000U);
MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_64KB);
/* Region 6 setting: Memory with Normal type, not shareable, outer/inner write back */
MPU->RBAR = ARM_MPU_RBAR(6, 0x20000000U);
MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_128KB);
/* Region 7 setting: Memory with Normal type, not shareable, outer/inner write back */
MPU->RBAR = ARM_MPU_RBAR(7, 0x20200000U);
MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_64KB);
/* Region 8 setting: Memory with Normal type, not shareable, outer/inner write back */
MPU->RBAR = ARM_MPU_RBAR(8, 0x80000000U);
MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_32MB);
3. Linker option

4. XIP Nor option
