Dear all,
I have a custom board with an IMXRT1024 and an external RAM. I want to get rid of the external RAM since my software development is done and i have made some optimization. I need around 205kB of RAM for my application to run. Also note that my application run FreeRTOS (change value in FreeRTOSConfig.h to fit my need).
I know that the default FlexRAM configuration is 128kB OCRAM - 64kB ITCM - 64kB DTCM. I want to maximize RAM capacity for future needs, so i understood that i can configure FlexRAM to increase OCRAM to 256kB or DTCM to 256kB (and turn other RAM controller off). I followed all steps of this guide : Reallocating the FlexRAM - NXP Community
So i did :
- Add in ResetISR for OCRAM 256kB (I did not add the IOMUXC_GPR_GPR14 register modification since it's not the same for RT106x and RT1024) :
/* Reallocating the FlexRAM */
__asm (".syntax unified\n"
"LDR R0,=0x20001fff\n" //load initial value of stack pointer into R0
"MSR MSP,R0\n"//re-initialize stack pointer by new value
"LDR R0, =0x400ac044\n"//Address of register IOMUXC_GPR_GPR17
"LDR R1, =0xaaaa5555\n"//FlexRAM configuration DTC = 0KB, ITC = 0KB, OC = 256KB
"STR R1,[R0]\n"
"LDR R0,=0x400ac040\n"//Address of register IOMUXC_GPR_GPR16
"LDR R1,[R0]\n"
"ORR R1,R1,#4\n"//The 4 corresponds to setting the FLEXRAM_BANK_CFG_SEL bit in register IOMUXC_GPR_GPR16
"STR R1,[R0]\n"
#ifdef FLEXRAM_ITCM_ZERO_SIZE
"LDR R0,=0x400ac040\n"//Address of register IOMUXC_GPR_GPR16
"LDR R1,[R0]\n"
"AND R1,R1,#0xfffffffe\n"//Disabling SRAM_ITC in register IOMUXC_GPR_GPR16
"STR R1,[R0]\n"
#endif
#ifdef FLEXRAM_DTCM_ZERO_SIZE
"LDR R0,=0x400ac040\n"//Address of register IOMUXC_GPR_GPR16
"LDR R1,[R0]\n"
"AND R1,R1,#0xfffffffd\n"//Disabling SRAM_DTC in register IOMUXC_GPR_GPR16
"STR R1,[R0]\n"
#endif
".syntax divided\n");
- Modify the linker setting to match the new values
- Change BOARD_ConfigMPU function by comment region 5 and 6 (ITCM and DCTM) and change region 7 (OCRAM) size to ARM_MPU_REGION_SIZE_256KB
- Change the image entry address in fsl_flexspi_nor_boot.c
- In C/C++ Build --> Manage Linker Script, change stack location to start. Also, since i disable DTCM controller i though it won't be great for the stack to stay in SRAM_DTC region so i switch it for OCRAM.
After those modification, i tried to run a debug with my JLink probe but i got the deadbeee error in my MCUXpresso IDE. I've read a lot about flashdriver but don't seem to be the issue here since i can download the flash program.
This is no new topic, i've seen a lot of post about the FlexRAM configuration (FlexRAM Unexpected Behaviour - NXP Community, Solved: iMXRT1021 change FlexRAM size - NXP Community, etc...) and i knew it won't be simple.
My questions are :
- Is my configuration(s) possible ? (256kB OCRAM - 0kB ITCM - 0kB DTCM OR 0kB OCRAM - 0kB ITCM - 256kB DTCM)
- Am i doing it right with my modification compare to the guide based on IMXRT106x ?
Regards