I am using the rt1064 EVK (SDK version 2.7) and debugging using MCUXpresso IDE v11.1.1. My group is working on an application that does some specialized flash management, and requires us to use the FlexSPI interface directly. Because of this, when our app is running we cannot have XIP going on. This requires us to develop and run our application while it is running in RAM.
I have everything set up... using a flash simulation stub of our own design, within the IDE I am able to successfully build, download, run, debug and test our application. But we need to start using the real flash now, which means linking and debugging our application in RAM.
To accomplish this, I did the following:
- Set up SRAM_OC to be the first RAM region listed in the memory configuration table (this region is large enough to hold our application... SRAM_ITC is not).
- Set up the BOARD_SDRAM to be operational and placed the heap there (in some forms our application needs to allocate significant amounts of memory). This is working fine.
- Set up the stack to be in SRAM_DTC.
- Checked the "Link application to RAM" checkbox in the managed linker script.
- In the LinkServer tab of the 'Edit Launch Configuration' dialog, set "reset handling" to "SOFT".
- I do not modify any other settings, including XIP.
When I try to download this through the debugger, the behavior is not stable. Sometimes it seems to work. Other times it seems to successfully download but crashes when I launch it. Other times it crashes during the download process. Once crashes start to happen, I can sometimes reduce them by cycling power on the target, but other times not even that works. When I revert to running XIP, I can get it working in a stable way again.
Using the debugger to change the application currently programmed into the flash seems to affect the behavior when I move to trying to link the application to RAM. It's almost as if the debugger is trying to start a debug session with the application in RAM, while at the same time the target is trying to run some other application previously programmed in flash, and the two conflict.
The question is, am I missing any settings? It seems to me that when told to link and debug an application in RAM, the IDE would tell the target not to run any code (other than the low-level stuff that gets run before "main()") not to run anything out of flash. How do I tell the target to ignore any applications stored in flash? Do I have to do something to explicitly disable XIP? Or, am I way out to lunch with that theory? I'm pretty new to the rt1064 and this IDE.