I am having an issue with configuring and using the FlexRAM on the iMXRT1061. I desire to configure the block to 128KB OCRAM at the start, 128KB D-TCM next, and 256KB I-TCM at the top, meaning all banks are used. I have reviewed the AN12077 as well as the informational 1117649 on this forum. Both of these notes raise an issue with registers and register fields that are accessed but are not documented in the RT106x TRM. Specifically, the usage of IOMUXC_GPR14 and IOMUXC_GPR16 for disabling the I/D-TCM operations.
My problem has to do with FlexRAM operations. During my intial debug, the FlexRAM was behaving erratically at best. Once I had disabled the D-Cache, the problem became much more obvious. Specifically, any FlexRAM bank that is configured as OCRAM is fully functional, but any FlexRAM bank that is configured as I- / D-TCM only reads back value 0. (Or, perhaps it only writes value 0; it is difficult to tell which.) I verified that the FlexRAM memory it self was OK by setting all banks to OCRAM and testing them. I also experimented with FLEXRAM->TCM_CTRL to set the clock always on and to change the read/write to 2 clocks, but this had no apparent effect. it is also not really clear when it would be desired to use the 2-clk setting, if ever. I also verified that the FlexRAM clock was enabled from CCM->CCGR3 with CG9_MASK set. I also have this:
MPU->RBAR = ARM_MPU_RBAR(8, 0x20280000U); // FlexRAM-OCRAM
MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_512KB);
My main question is what could be causing this non-responsiveness of the FlexRAM in TCM mode? If you could shed some light on this mystery, I would appreciate it.