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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,466 次查看
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 项奖励
回复
1 解答
1,409 次查看
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 项奖励
回复
2 回复数
1,410 次查看
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 项奖励
回复
1,395 次查看
vascofsantos
Contributor I

I confirm that this method works in VSCode.

Thank you @Gavin_Jia!

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1846022%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E4%BD%BF%E7%94%A8%20LinkServer%2FCMSIS-DAP%20%E5%9C%A8%20MIMXRT1060-EVKB%20%E4%B8%8A%E8%B0%83%E8%AF%95%E5%A4%A7%E4%BA%8E%20128%20KB%20%E7%9A%84%E7%A8%8B%E5%BA%8F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1846022%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20MCUXpresso%20%E8%BF%9B%E8%A1%8C%20VSCode%20%E5%B9%B6%E5%B0%9D%E8%AF%95%E5%9C%A8%20MIMXRT1060-EVKB%20%E6%9D%BF%E4%B8%8A%E8%B0%83%E8%AF%95%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E3%80%82%3C%2FP%3E%3CP%3E%E4%B8%80%E5%88%87%E8%BF%90%E8%A1%8C%E6%AD%A3%E5%B8%B8%EF%BC%8C%E7%9B%B4%E5%88%B0%E6%88%91%E7%9A%84%E7%A8%8B%E5%BA%8F%E5%A4%A7%E5%B0%8F%E4%BC%BC%E4%B9%8E%E8%B6%85%E8%BF%87%E4%BA%86%20128%20KB%20%E7%9A%84%E5%A4%A7%E5%B0%8F%E6%A0%87%E8%AE%B0%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E5%B7%B2%E5%B0%86%E9%93%BE%E6%8E%A5%E5%99%A8%E6%98%A0%E5%B0%84%E8%AE%BE%E7%BD%AE%E4%B8%BA%E4%BD%BF%E7%94%A8%200x00000000%20%E5%A4%84%E7%9A%84%E6%95%B4%E4%B8%AA%20512%20KB%20%E4%BD%9C%E4%B8%BA%20ITCM%EF%BC%8C%E5%9B%A0%E6%AD%A4%E5%AE%83%E5%BA%94%E8%AF%A5%E9%80%82%E5%90%88%E3%80%82%3C%2FP%3E%3CP%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E6%88%91%E6%94%B6%E5%88%B0%E4%B8%80%E4%B8%AA%E9%94%99%E8%AF%AF%E6%B6%88%E6%81%AF%E5%AF%B9%E8%AF%9D%E6%A1%86%EF%BC%8C%E5%85%B6%E4%B8%AD%E6%98%BE%E7%A4%BA%EF%BC%9A%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3E%E6%97%A0%E6%B3%95%E5%BC%80%E5%A7%8B%E8%B0%83%E8%AF%95%E3%80%82%E5%91%BD%E4%BB%A4%E2%80%9C-interpreter-exec%20console%E2%80%9Cload%E2%80%9D%E2%80%9D%E7%9A%84%20GDB%20%E8%BE%93%E5%87%BA%E6%84%8F%E5%A4%96%E3%80%82%E5%8A%A0%E8%BD%BD%E5%A4%B1%E8%B4%A5%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3E%E5%9C%A8%E6%B7%B1%E5%85%A5%E7%A0%94%E7%A9%B6%E8%B0%83%E8%AF%95%E6%8E%A7%E5%88%B6%E5%8F%B0%E6%97%A5%E5%BF%97%E4%B9%8B%E5%90%8E%EF%BC%8C%E6%88%91%E7%9C%8B%E5%88%B0%E4%BA%86%E4%BB%A5%E4%B8%8B%E5%86%85%E5%AE%B9%EF%BC%9A%3C%2FP%3E%3CBR%20%2F%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%20translate%3D%22no%22%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%3ELinkServer%20%E6%96%87%E4%BB%B6%E5%A4%B9%E4%B8%AD%E7%9A%84%E8%BF%99%E4%B8%AA%20RT1060_connect.scp%20%E8%84%9A%E6%9C%AC%E4%BC%BC%E4%B9%8E%E6%98%8E%E7%A1%AE%E9%85%8D%E7%BD%AE%E4%BA%86%20ITCM%20%E4%B8%8A%20RAM%20%E7%9A%84%20128%20KB%20%E9%99%90%E5%88%B6%E3%80%82%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%3E%E8%84%9A%E6%9C%AC%E6%9C%AC%E8%BA%AB%E7%9A%84%E8%BF%99%E4%B8%80%E9%83%A8%E5%88%86%E5%A6%82%E4%B8%8B%E6%89%80%E7%A4%BA%EF%BC%9A%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%20translate%3D%22no%22%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%3E%E5%9C%A8%E5%93%AA%E9%87%8C%E5%8F%AF%E4%BB%A5%E6%89%BE%E5%88%B0%E6%9C%89%E5%85%B3%E5%A6%82%E4%BD%95%E8%A6%86%E7%9B%96%2F%E5%AE%9A%E5%88%B6%E6%AD%A4%20FlexRAM%20%E8%AE%BE%E7%BD%AE%E4%BB%A5%E5%8C%B9%E9%85%8D%E6%88%91%E7%9A%84%E9%93%BE%E6%8E%A5%E5%99%A8%E6%96%87%E4%BB%B6%E5%86%85%E5%AE%B9%EF%BC%88%E6%88%96%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE%EF%BC%89%E7%9A%84%E4%BF%A1%E6%81%AF%EF%BC%9F%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%3E%E6%8F%90%E5%89%8D%E6%84%9F%E8%B0%A2%EF%BC%81%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%20%E4%BD%BF%E7%94%A8%20LinkServer%2FCMSIS-DAP%20%E5%9C%A8%20MIMXRT1060-EVKB%20%E4%B8%8A%E8%B0%83%E8%AF%95%E5%A4%A7%E4%BA%8E%20128%20KB%20%E7%9A%84%E7%A8%8B%E5%BA%8F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1848189%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E7%A1%AE%E8%AE%A4%E6%AD%A4%E6%96%B9%E6%B3%95%E5%9C%A8%20VSCode%20%E4%B8%AD%E6%9C%89%E6%95%88%E3%80%82%3C%2FP%3E%3CP%3E%E8%B0%A2%E8%B0%A2%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%20%EF%BC%81%3C%2FP%3E%3C%2FLINGO-BODY%3E