Hi jtro 9,
So sorry for my later reply!
Today, I have found the time to test the MIMXRT1020 FlexRAM, your situation, totally the same as MIMXRT1050 operation.
Let's take the MIMXRT1020 SDK led_blinky as an example.
DTCM - 128KB ; ITCM - 64 KB; OCRAM - 64KB
Please note these points:
1. Modify the FlexRAM memory:

2. prepare the CMSIS DAP script
The content is :
100 REM ===============================
110 REM RT1020_connect.scp
120 REM
130 REM Copyright 2019 NXP
140 REM All rights reserved.
150 REM ===============================
160 print "RT10s0 Connect Script"
170 REM probelist
180 p% = probefirstfound
190 rem probeopenbyindex p%
200 wireswdconnect p%
210 selectprobecore p% 0
220 cminitapdp this
230 cmhalt this
235 goto 320
240 rem trap in bootrom
250 cmwatchset this 0 0x400F8004 RW
260 cmresetvectorcatchclear this
270 print "Resetting and trapping"
280 cmsysresetreq this
290 print "Back from reset"
300 cmresetvectorcatchset this
310 cmwatchclear this 0
320 print "Disabling MPU"
330 s% = Peek32 this 0xE000ED94
340 s% = s% & 0xFFFFFFFE
350 Poke32 this 0xE000ED94 s%
360 REM ====== Configure FlexRAM ======
370 print "Configure FlexRAM for 64KB OC RAM, 64KB I-TCM, 128KB D-TCM"
380 REM TCM CTRL Poke 0x400B0000 - to force RAM clocking and set wait states = b100
390 Poke32 this 0x400B0000 0x4
400 REM IOMUXC_GPR17 0x400AC044 - this sets bitfield allocation of FlexRAM 32KB banks to OC 64KB b01, I 64KB b11, D 128KB b10
410 Poke32 this 0x400AC044 0x0000FAA5
420 REM IOMUXC_GPR16 0x400AC040 - this sets enables for I and DTCM and the source of the TCM config = 0x200007
430 Poke32 this 0x400AC040 0x200007
440 print "Finished"
450 REM ===============================
460 end
Copy the script(RT1020_connect_64Kocram_64Kitcm_128Kdtcm.scp) to MCUXPresso IDE install path:
C:\nxp\MCUXpressoIDE_11.1.0_3209\ide\binaries\Scripts
3. Select the scp in the MCUXPresso IDE debug configuration

4. Add code in the ResetISR
FLEXRAM->TCM_CTRL = 4;
IOMUXC_GPR->GPR17 = 0x0000FAA5;
IOMUXC_GPR->GPR16 |= 0x7;
IOMUXC_GPR->GPR14 = (8<<20) | (7<<16) ;

5. Modify the stack location as start

Then build the project, and download it to your MIMXRT1020-EVK board, no matter debug or exit debug and repower on it, the led will blink.
I also attach my project for your reference.
Wish it helps you.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------