Hi claude-david gaudreault
FlexRAM contains: OCARM, ITCM, DTCM, and share 128KB flash.
So, when you want to change it:
1. modify the memory map size
Change the OCRAM, ITCM, DTCM size in the following picture

2. Modify the flexRAM code in the reset :
Take an example, you need to check the register and modify it for your own size:
FLEXRAM->TCM_CTRL = 4;
IOMUXC_GPR->GPR17 = 0x5AAFFAA5;
IOMUXC_GPR->GPR16 |= 0x7;
IOMUXC_GPR->GPR14 = (9<<20) | (8<<16) ;
3. modify the .scp for your own memory size
You can find the .scp in folder:
C:\nxp\MCUXpressoIDE_11.1.0_3209\ide\binaries\Scripts
an exmaples for your, you still need to modify the related data
100 REM ===============================
110 REM RT1050_connect.scp
120 REM
130 REM Copyright 2019 NXP
140 REM All rights reserved.
150 REM ===============================
160 print "RT1050 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 128KB OC RAM, 128KB I-TCM, 256KB 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 256KB b01, I 128KB b11, D 128KB b10
5
410 Poke32 this 0x400AC044 0x5AAFFAA5
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
4. Modify the stack location from end to start
More details, you also can check this question post:
FlexRAM and Linker Problem
Wish it helps you!
If you still have questions about it, please kindly let me know.
Best Regards,
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.
-------------------------------------------------------------------------------