Debugging programs larger than 128 KB on the MIMXRT1060-EVKB with LinkServer/CMSIS-DAP

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

Debugging programs larger than 128 KB on the MIMXRT1060-EVKB with LinkServer/CMSIS-DAP

Jump to solution
1,462 Views
vascofsantos
Contributor I

I am using MCUXpresso for VSCode and trying to debug an application on an MIMXRT1060-EVKB board.

Everything works fine until my program size seemingly surpasses the 128 KB size mark.

I have my linker map set to use the whole 512 KB at 0x00000000 as ITCM, so it should fit.

However, I get an error message dialog window that says:

Unable to start debugging. Unexpected GDB output from command "-interpreter-exec console "load"". Load failed

After some digging into the debug console logs, I see this:

 

[Warning] 1: (6334) STDERR: Wc: ============= SCRIPT: RT1060_connect.scp =============
[Warning] 1: (6334) STDERR: Wc: RT1060 Connect Script
[Warning] 1: (6334) STDERR: Wc: DpID = 0BD11477
[Warning] 1: (6334) STDERR: Wc: APID = 0x04770041
[Warning] 1: (6334) STDERR: Wc: Disabling MPU
[Warning] 1: (6334) STDERR: Wc: Configure FlexRAM for 768KB OC RAM, 128KB I-TCM, 128KB D-TCM
[Warning] 1: (6334) STDERR: Wc: Finished
[Warning] 1: (6334) STDERR: Wc: ============= END SCRIPT =============================

 

This RT1060_connect.scp script in the LinkServer folder seems to explicitly configure RAM with a 128 KB limit on ITCM.

This part of the script itself looks like this:

 

360 REM ====== Configure FlexRAM ======
370 print "Configure FlexRAM for 768KB OC RAM, 128KB 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 256KB b01, I 128KB b11, D 128KB b10
410 Poke32 this 0x400AC044 0x5555FFAA
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 ===============================

 

Where can I find information on how to override/customize this FlexRAM setup into matching my linker file contents (or some other config)?
 
Thanks in advance!
0 Kudos
Reply
1 Solution
1,405 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @vascofsantos ,

Thanks for your interest in NXP MIMXRT series!

There is a detailed guidance document on this subject which is based on the MCUXpresso IDE. The VScode based operation is currently untried. Please check this article: Reallocating the FlexRAM - NXP Community

Also this error should be reported because the connection script has not made the corresponding changes, the idea on my side is to change the register values in it:

IOMUXC_GPR17 

 Here's a new connection script based on the RT1050 that modifies the original 128-128-256 ITCM/DTCM/OCRAM to 128-256-128 ITCM/DTCM/OCRAM

It looks to me like it simply modifies the value of IOMUXC_GPR17 to 0x5AAFFAA5. So you could try something along those lines. 

100 REM===============================
110 REM RT1050_connect.scp
120 REM
130 REM Copyright 2019 NXP
140 REM All rights reserved.
150 REM===============================
160 print "RT1050 ConnectScript"
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 andtrapping"
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 for128KB OC RAM, 128KB I-TCM, 256KB D-TCM"
380 REM TCM CTRL Poke 0x400B0000 - toforce RAM clocking and set wait states = b100
390 Poke32 this 0x400B0000 0x4
400 REM IOMUXC_GPR17 0x400AC044 - thissets bitfield allocation of FlexRAM 32KB banks to OC 256KB b01, I 128KB b11, D128KB b10
410 Poke32 this 0x400AC044 0x5AAFFAA5
420 REM IOMUXC_GPR16 0x400AC040 - thissets 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

 

Best regards,
Gavin

 

View solution in original post

0 Kudos
Reply
2 Replies
1,406 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @vascofsantos ,

Thanks for your interest in NXP MIMXRT series!

There is a detailed guidance document on this subject which is based on the MCUXpresso IDE. The VScode based operation is currently untried. Please check this article: Reallocating the FlexRAM - NXP Community

Also this error should be reported because the connection script has not made the corresponding changes, the idea on my side is to change the register values in it:

IOMUXC_GPR17 

 Here's a new connection script based on the RT1050 that modifies the original 128-128-256 ITCM/DTCM/OCRAM to 128-256-128 ITCM/DTCM/OCRAM

It looks to me like it simply modifies the value of IOMUXC_GPR17 to 0x5AAFFAA5. So you could try something along those lines. 

100 REM===============================
110 REM RT1050_connect.scp
120 REM
130 REM Copyright 2019 NXP
140 REM All rights reserved.
150 REM===============================
160 print "RT1050 ConnectScript"
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 andtrapping"
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 for128KB OC RAM, 128KB I-TCM, 256KB D-TCM"
380 REM TCM CTRL Poke 0x400B0000 - toforce RAM clocking and set wait states = b100
390 Poke32 this 0x400B0000 0x4
400 REM IOMUXC_GPR17 0x400AC044 - thissets bitfield allocation of FlexRAM 32KB banks to OC 256KB b01, I 128KB b11, D128KB b10
410 Poke32 this 0x400AC044 0x5AAFFAA5
420 REM IOMUXC_GPR16 0x400AC040 - thissets 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

 

Best regards,
Gavin

 

0 Kudos
Reply
1,391 Views
vascofsantos
Contributor I

I confirm that this method works in VSCode.

Thank you @Gavin_Jia!

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1846022%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EDebugging%20programs%20larger%20than%20128%20KB%20on%20the%20MIMXRT1060-EVKB%20with%20LinkServer%2FCMSIS-DAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1846022%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20using%20MCUXpresso%20for%20VSCode%20and%20trying%20to%20debug%20an%20application%20on%20an%20MIMXRT1060-EVKB%20board.%3C%2FP%3E%3CP%3EEverything%20works%20fine%20until%20my%20program%20size%20seemingly%20surpasses%20the%20128%20KB%20size%20mark.%3C%2FP%3E%3CP%3EI%20have%20my%20linker%20map%20set%20to%20use%20the%20whole%20512%20KB%20at%200x00000000%20as%20ITCM%2C%20so%20it%20should%20fit.%3C%2FP%3E%3CP%3EHowever%2C%20I%20get%20an%20error%20message%20dialog%20window%20that%20says%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3EUnable%20to%20start%20debugging.%20Unexpected%20GDB%20output%20from%20command%20%22-interpreter-exec%20console%20%22load%22%22.%20Load%20failed%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EAfter%20some%20digging%20into%20the%20debug%20console%20logs%2C%20I%20see%20this%3A%3C%2FP%3E%3CBR%20%2F%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%5BWarning%5D%201%3A%20(6334)%20STDERR%3A%20Wc%3A%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20SCRIPT%3A%20RT1060_connect.scp%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%5BWarning%5D%201%3A%20(6334)%20STDERR%3A%20Wc%3A%20RT1060%20Connect%20Script%0A%5BWarning%5D%201%3A%20(6334)%20STDERR%3A%20Wc%3A%20DpID%20%3D%200BD11477%0A%5BWarning%5D%201%3A%20(6334)%20STDERR%3A%20Wc%3A%20APID%20%3D%200x04770041%0A%5BWarning%5D%201%3A%20(6334)%20STDERR%3A%20Wc%3A%20Disabling%20MPU%0A%5BWarning%5D%201%3A%20(6334)%20STDERR%3A%20Wc%3A%20Configure%20FlexRAM%20for%20768KB%20OC%20RAM%2C%20128KB%20I-TCM%2C%20128KB%20D-TCM%0A%5BWarning%5D%201%3A%20(6334)%20STDERR%3A%20Wc%3A%20Finished%0A%5BWarning%5D%201%3A%20(6334)%20STDERR%3A%20Wc%3A%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20END%20SCRIPT%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EThis%20RT1060_connect.scp%20script%20in%20the%20LinkServer%20folder%20seems%20to%20explicitly%20configure%20RAM%20with%20a%20128%20KB%20limit%20on%20ITCM.%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22%22%3EThis%20part%20of%20the%20script%20itself%20looks%20like%20this%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E360%20REM%20%3D%3D%3D%3D%3D%3D%20Configure%20FlexRAM%20%3D%3D%3D%3D%3D%3D%0A370%20print%20%22Configure%20FlexRAM%20for%20768KB%20OC%20RAM%2C%20128KB%20I-TCM%2C%20128KB%20D-TCM%22%0A380%20REM%20TCM%20CTRL%20Poke%200x400B0000%20-%20to%20force%20RAM%20clocking%20and%20set%20wait%20states%20%3D%20b100%0A390%20Poke32%20this%200x400B0000%200x4%0A400%20REM%20IOMUXC_GPR17%200x400AC044%20-%20this%20sets%20bitfield%20allocation%20of%20FlexRAM%2032KB%20banks%20to%20OC%20256KB%20b01%2C%20I%20128KB%20b11%2C%20D%20128KB%20b10%0A410%20Poke32%20this%200x400AC044%200x5555FFAA%0A420%20REM%20IOMUXC_GPR16%200x400AC040%20-%20this%20sets%20enables%20for%20I%20and%20DTCM%20and%20the%20source%20of%20the%20TCM%20config%20%3D%200x200007%0A430%20Poke32%20this%200x400AC040%200x200007%0A440%20print%20%22Finished%22%0A450%20REM%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22%22%3EWhere%20can%20I%20find%20information%20on%20how%20to%20override%2Fcustomize%20this%20FlexRAM%20setup%20into%20matching%20my%20linker%20file%20contents%20(or%20some%20other%20config)%3F%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22%22%3EThanks%20in%20advance!%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1848189%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%20Debugging%20programs%20larger%20than%20128%20KB%20on%20the%20MIMXRT1060-EVKB%20with%20LinkServer%2FCMSIS-DAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1848189%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20confirm%20that%20this%20method%20works%20in%20VSCode.%3C%2FP%3E%3CP%3EThank%20you%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F203261%22%20target%3D%22_blank%22%3E%40Gavin_Jia%3C%2FA%3E!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1847830%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%20Debugging%20programs%20larger%20than%20128%20KB%20on%20the%20MIMXRT1060-EVKB%20with%20LinkServer%2FCMSIS-DAP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1847830%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F232142%22%20target%3D%22_blank%22%3E%40vascofsantos%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20interest%20in%20NXP%20MIMXRT%20series!%3C%2FP%3E%0A%3CP%3EThere%20is%20a%20detailed%20guidance%20document%20on%20this%20subject%20which%20is%20based%20on%20the%20MCUXpresso%20IDE.%20The%20VScode%20based%20operation%20is%20currently%20untried.%20Please%20check%20this%20article%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-RT-Knowledge-Base%2FReallocating-the-FlexRAM%2Fta-p%2F1117649%22%20target%3D%22_blank%22%3EReallocating%20the%20FlexRAM%20-%20NXP%20Community%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EAlso%20this%20error%20should%20be%20reported%20because%20the%20connection%20script%20has%20not%20made%20the%20corresponding%20changes%2C%20the%20idea%20on%20my%20side%20is%20to%20change%20the%20register%20values%20in%20it%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EIOMUXC_GPR17%20%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3CSPAN%3EHere's%20a%20new%20connection%20script%20based%20on%20the%20RT1050%20that%20modifies%20the%20original%20128-128-256%20ITCM%2FDTCM%2FOCRAM%20to%20128-256-128%20ITCM%2FDTCM%2FOCRAM%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIt%20looks%20to%20me%20like%20it%20simply%20modifies%20the%20value%20of%20IOMUXC_GPR17%20to%200x5AAFFAA5.%20So%20you%20could%20try%20something%20along%20those%20lines.%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E100%20REM%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A110%20REM%20RT1050_connect.scp%0A120%20REM%0A130%20REM%20Copyright%202019%20NXP%0A140%20REM%20All%20rights%20reserved.%0A150%20REM%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A160%20print%20%22RT1050%20ConnectScript%22%0A170%20REM%20probelist%0A180%20p%25%20%3D%20probefirstfound%0A190%20rem%20probeopenbyindex%20p%25%0A200%20wireswdconnect%20p%25%0A210%20selectprobecore%20p%25%200%0A220%20cminitapdp%20this%0A230%20cmhalt%20this%0A235%20goto%20320%0A240%20rem%20trap%20in%20bootrom%0A250%20cmwatchset%20this%200%200x400F8004%20RW%0A260%20cmresetvectorcatchclear%20this%0A270%20print%20%22Resetting%20andtrapping%22%0A280%20cmsysresetreq%20this%0A290%20print%20%22Back%20from%20reset%22%0A300%20cmresetvectorcatchset%20this%0A310%20cmwatchclear%20this%200%0A320%20print%20%22Disabling%20MPU%22%0A330%20s%25%20%3D%20Peek32%20this%200xE000ED94%0A340%20s%25%20%3D%20s%25%20%26amp%3B%200xFFFFFFFE%0A350%20Poke32%20this%200xE000ED94%20s%25%0A360%20REM%20%3D%3D%3D%3D%3D%3D%20Configure%20FlexRAM%3D%3D%3D%3D%3D%3D%0A370%20print%20%22Configure%20FlexRAM%20for128KB%20OC%20RAM%2C%20128KB%20I-TCM%2C%20256KB%20D-TCM%22%0A380%20REM%20TCM%20CTRL%20Poke%200x400B0000%20-%20toforce%20RAM%20clocking%20and%20set%20wait%20states%20%3D%20b100%0A390%20Poke32%20this%200x400B0000%200x4%0A400%20REM%20IOMUXC_GPR17%200x400AC044%20-%20thissets%20bitfield%20allocation%20of%20FlexRAM%2032KB%20banks%20to%20OC%20256KB%20b01%2C%20I%20128KB%20b11%2C%20D128KB%20b10%0A410%20Poke32%20this%200x400AC044%200x5AAFFAA5%0A420%20REM%20IOMUXC_GPR16%200x400AC040%20-%20thissets%20enables%20for%20I%20and%20DTCM%20and%20the%20source%20of%20the%20TCM%20config%20%3D%200x200007%0A430%20Poke32%20this%200x400AC040%200x200007%0A440%20print%20%22Finished%22%0A450%20REM%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A460%20end%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EGavin%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E