Hi Victor,
I implemented the additional changes to the fsl_flexspi_nor.c file, and also moved the assembly code within the Reset_Handler that configures the FlexRam (ITCM 256kB, DTCM 192kB, and OCRAM 64kB) to the section where the interrupts are disabled as suggested by AN12077.
Checking the .map file generated at run time, I see that 262142 bytes are placed in read only memory (text + data) which is 2 bytes short of the 262144 bytes representing 256kB. If I increase the size of data placed in read only memory beyond that, I get a linker error - which expect since this would try to allocate data past the boundary of ITCM. This shows that the ITCM memory was successfully expanded from the default 128kB to 256kB.
As I mentioned in an earlier post, I have fairly limited experience on this topic, so I would like to understand how this method of re-configuring the RAM is successful. In particular, can you explain where in the boot sequence the re-configuring of the RAM memory via the FlexRam process occurs? More concisely, when a runtime reconfiguration of RAM is performed to accommodate for the the size of an app image that exceeds the default RAM memory allocated, where in the startup sequence is the code from startup_MIMXRT1064.s performed in relation to copying the image over from flash to RAM? Is the FlexRam reconfiguration occurring before the image is loaded into RAM? Please feel free to provide an abundance of detail here since I'm still trying to piece together an overall understanding of this start up process in general.
Another behavior that I noticed is the debugger warning that it failed to verify the memory starting with address 0x00020000 when I try to load the app into flash after a HW reset. This also prevents the app from running - PC never hits main() at runtime. I attached a debug log in my previous post about that issue and mjbcswitzerland suggested that is an IAR bug with certain chips. I would like to get a better understanding about this behavior if anyone has had similar experiences before I reach out to IAR with the issue.
Why does a HW reset cause the debugger to be unable to verify the RAM memory in the RT1064 - rendering it inaccessible once the FlexRam default config has been modified?
FYI: If I reconfigure the RAM as you described in previous posts without a HW reset, the memory re-allocation is successful and the app runs (as described in the beginning of this post).
Thank you for your continued support!
Regards,
Alin