Reallocation FlexRAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reallocation FlexRAM

540 Views
KhaledG
Contributor I

Hi
I'm trying to reallocate the FlexRam to be DTC = 128KB, ITC = 64KB, OC = 64KB on i.mxrt 1024
I did these changes 
 config.pngboard.pngboot.pngstartup2.png

I also modified the linker file to fit with these changes.
Now it works, but my question is about these two lines

"LDR R0, =0x20001fff\n" // load initial value of stack pointer into R0

"MSR MSP, R0\n" // Reinitialize stack pointer by new value

Why without these lines it doesn’t work even if I modified the linker so _vStackTop must be up to date!

Labels (1)
0 Kudos
Reply
1 Reply

476 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Please refer to this post for more details on why SP is reset: RT1176 ROM code does not set stack pointer correctly - NXP Community

BR,
Omar

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2195981%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EReallocation%20FlexRAM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2195981%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3CBR%20%2F%3EI'm%20trying%20to%20reallocate%20the%20FlexRam%20to%20be%26nbsp%3B%3CSPAN%3EDTC%20%3D%20128KB%2C%20ITC%20%3D%2064KB%2C%20OC%20%3D%2064KB%20on%20i.mxrt%201024%3C%2FSPAN%3E%3CBR%20%2F%3EI%20did%20these%20changes%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22config.png%22%20style%3D%22width%3A%20617px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22config.png%22%20style%3D%22width%3A%20617px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F363292i139C61900A5395AE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22config.png%22%20alt%3D%22config.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22board.png%22%20style%3D%22width%3A%20732px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22board.png%22%20style%3D%22width%3A%20732px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F363293iB164BC72A295D814%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22board.png%22%20alt%3D%22board.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22boot.png%22%20style%3D%22width%3A%20650px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22boot.png%22%20style%3D%22width%3A%20650px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F363295i1E05560DF4AAC2F2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22boot.png%22%20alt%3D%22boot.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22startup2.png%22%20style%3D%22width%3A%20831px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22startup2.png%22%20style%3D%22width%3A%20831px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F363294i771238FFFEF68CF6%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22startup2.png%22%20alt%3D%22startup2.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3EI%20also%20modified%20the%20linker%20file%20to%20fit%20with%20these%20changes.%3CBR%20%2F%3ENow%20it%20works%2C%20but%20my%20question%20is%20about%20these%20two%20lines%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%22LDR%20R0%2C%20%3D0x20001fff%5Cn%22%3C%2FSPAN%3E%20%3CSPAN%3E%2F%2F%20load%20initial%20value%20of%20stack%20pointer%20into%20R0%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%22MSR%20MSP%2C%20R0%5Cn%22%3C%2FSPAN%3E%20%3CSPAN%3E%2F%2F%20Reinitialize%20stack%20pointer%20by%20new%20value%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3EWhy%20without%20these%20lines%20it%20doesn%E2%80%99t%20work%20even%20if%20I%20modified%20the%20linker%20so%20_vStackTop%20must%20be%20up%20to%20date!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2195981%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MXRT%20102x%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2197751%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Reallocation%20FlexRAM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2197751%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPlease%20refer%20to%20this%20post%20for%20more%20details%20on%20why%20SP%20is%20reset%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-RT-Crossover-MCUs%2FRT1176-ROM-code-does-not-set-stack-pointer-correctly%2Fm-p%2F1388830%22%20target%3D%22_blank%22%3ERT1176%20ROM%20code%20does%20not%20set%20stack%20pointer%20correctly%20-%20NXP%20Community%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EBR%2C%3CBR%20%2F%3EOmar%3C%2FP%3E%3C%2FLINGO-BODY%3E