Hi Markus,
Thanks for your reply. That application note is useful - it confirmed a number of things for me.
There is another aspect which is not covered, and that is the debugger.
The problem is that the J-Link download from the IAR tools uses a small ELF file (C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.2\arm\config\flashloader\NXP\FlashiMXRT1020_EVK_FlexSPI.out). This code assumes a certain configuration (the default) of FlexRAM. When the processor is reset via the debugger, it retains the FlexRAM configuration.
Therefore, if my code alters the FlexRAM configuration, the next time that I reset, the Debugger won't work. (It took me a while to figure this out!)
I believe the fix is to recompile the FlashIMXRT1050... project and use that, but I drew the line here at this point in time and decided to stick with the standard configuration.
This wasn't too hard because it turned out that the Linker configuration wasn't using the 128Kbyte of OCRAM. It set up 64K of D-TCM, and used that as the DATA segment. Nothing went into DATA2, so I just put some large buffers in there (e.g. Ethernet), which freed enough of the 64K to get me moving again.
Code:
SDK_ALIGN(uint8_t g_txDataBuff[ENET_TXBD_NUM][SDK_SIZEALIGN(ENET_TXBUFF_SIZE, APP_ENET_BUFF_ALIGNMENT)],
APP_ENET_BUFF_ALIGNMENT) @ "OCRAM";
Linker:
place in DATA2_region { section OCRAM };
(note I am using IAR tools)
Chris.