What do you have to change to use IAR sdram_txt_debug configuration wit JLink on 1050-EVK?

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

What do you have to change to use IAR sdram_txt_debug configuration wit JLink on 1050-EVK?

945 次查看
imxrtuser
Senior Contributor I

Hello,

I have got a new IMXRT1050-EVK to verify that our SDRAM debugging problems on our custom IMXRT1052 hardware are not related to our code.

I created a new "hello world" example project for IAR EWARM, removed headers J47 and J48 from the EVK and changed the project settings to use a j-link plus debugger for the connection to the board.

To verify the connection to the processor with jlink i first tested the "debug" configuration which works as expected.

After that I tried the sdram_txt_debug configuration and I get a warning "Failed to read SP and PC from vector table at 0x8000'0000" in the Debug Log window of IAR and the program is not executing.

 

On our custom hardware with a custom macro file I addad a workaround which reads and sets SP and PC after a reset in the function "execUserReset()". With this it is possible to debug in external SDRAM if there is NO flash xip header available in the external qspi flash. After programming our XIP bootloader to flash, debugging in external SDRAM is no longer possible and EWARM hangs for a long time before getting some error messages.

I have tested it with EWARM v9.10 and v9.50 and Jlink v7.94i, Jlink v7.94a and Jlink v7.52d.

Does somebody know what you have to change to be able to run the hello world project with the sdram_txt_debug configuration on an original 1050-evk?

 

Kind regards,

Stefan

0 项奖励
回复
9 回复数

881 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @imxrtuser ,

Thanks for your interest in NXP MIMXRT series.

First, let's make sure that you are using the HelloWorld project from the official SDK right? Please do not modify any code or configuration. From your description, this issue is unlikely to happen.

Then, let's check if the configuration script for sdram_debug is missing, check this page:

Gavin_Jia_0-1709111881563.png

Make sure that the configuration of this page is the same and that sdram_init.mac is indeed stored in the corresponding folder.

 

Best regards,
Gavin

0 项奖励
回复

876 次查看
imxrtuser
Senior Contributor I

Hello Gavin,

yes I'm using the example project from the official SDK and I created the project with MCUXpresso Config Tools.

The configuration window looks like yours:

mitterha_0-1709123253730.png

and I can open the location with the three dots on the right side of the macro file and the file is there.

When I try to debug the project I get the following messages:

In the Debug Log window I can see the message "Wed Feb 28, 2024 13:19:41: Loaded macro file: C:...\hello_world1050evk/evkbimxrt1050/evkbimxrt1050_sdram_init.mac".

which also looks like it finds and uses the correct macro file.

 

Later after the debugger found the core I get the message

Wed Feb 28, 2024 13:19:46: Download completed and verification successful.

but then another reset is done and it fails to read SP and PC

Wed Feb 28, 2024 13:19:46: ResetTarget() start
Wed Feb 28, 2024 13:19:46: Core did not halt on flash image verification. Assuming faulty flash settings.
Wed Feb 28, 2024 13:19:46: Halting target manually.
Wed Feb 28, 2024 13:19:46: ResetTarget() end - Took 520ms
Wed Feb 28, 2024 13:19:46: AfterResetTarget() start
Wed Feb 28, 2024 13:19:46: AfterResetTarget() end - Took 977us
Wed Feb 28, 2024 13:19:46: Software reset was performed
Wed Feb 28, 2024 13:19:46: Failed to read SP and PC from vector table at 0x8000'0000

 

Be careful, you wrote "Then, let's check if the configuration script for sdram_debug is missing, check this page:". I'm talking about the configuration "sdram_txt_debug".

 

The configuration you mentioned "sdram_debug" is working as expected because here the interrupt vector table is located in internal ITCM and not in external SDRAM.

 

Did you test the configuration "sdram_txt_debug" on your 1050EVK?

 

Kind regards,

Stefan

0 项奖励
回复

858 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @imxrtuser ,

I tested it on my end and the original project is running fine. If you are still having problems, I suggest you go into serial download mode and reset the chip using MCUBootUtility before trying again.

Here are the test results from my side:

Gavin_Jia_0-1709611119315.png

 

Best regards,
Gavin

0 项奖励
回复

824 次查看
imxrtuser
Senior Contributor I

Hello Gavin,

I don't understand why it is not working on my side. Neither with two different original EVKs, nor with custom boards.

What do you mean with "reset the chip"? What will MCUBootUtilityTool do to the chip?

Which version of the JLINK debug probe and the JLINK DLL are you using?

Could you please send me a cspy log of the JLINK communication (configuration options > Debugger > J-Link/J-Trace > checkbox at "Log communication") and your test project so that I can compare them to my project and log file?

Kind regards,

Stefan

0 项奖励
回复

805 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @imxrtuser ,

Thanks for your feedback. 
1. Using MCUBootUtility's Reset Device will empty the Flash in serial download mode, generally used for chip error state recovery.

Gavin_Jia_0-1710225795630.png

2. Regarding the local tests, I used the RT1050-EVKB. RT1050-EVK is no longer sold on the official website a long time ago due to many known issue with the version of the chip used on it. I apologize for that.
Debugger: NXP MCU-Link Pro
Project: SDK 2.15.000 of RT1050EVKB 
The log file is attached below.

Best regards,
Gavin

0 项奖励
回复

801 次查看
imxrtuser
Senior Contributor I

Hello Gavin,

thank you for your answer. I have cleared the flash but the result is the same. I still get the error message "Failed to read SP and PC from vector table at 0x8000'0000". Additionally it should not matter if there is something in flash. It should be possible to use a custom hardware with firmware in flash and still be able to debug a new firmware in SDRAM before programming it to flash.

I have compared the cspycomm.log files and it looks like your debug probe behaves slightly different than mine. I can see a few different read/write commands.

I do not have a NXP MCU-Link Pro. Do you have a J-Link Plus or J-Link Plus Compact?

Kind regards,

Stefan

0 项奖励
回复

781 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @imxrtuser ,

Thanks for your patience! I have reproduced the issue using JLink Plus and encountered the same phenomenon as you.

I've submitted it for internal expert review and it should be a scripting issue. Your findings are much appreciated!

I'll keep you updated as everything new develops!

Thanks again and have a nice day.

 

Best regards,
Gavin

0 项奖励
回复

778 次查看
imxrtuser
Senior Contributor I

Hello Gavin,

thank you for the info! Good to hear that you could reproduce the issue.

Looking forward to a solution.

Kind regards,

Stefan

0 项奖励
回复

709 次查看
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @imxrtuser ,

Thanks for your patience. 
I got the solution to this issue from experts, please try it:

===========================================

Please make below change: 

1.Uncheck "Use macro file", this is for DAP link

Snipaste_2024-03-21_15-26-41.png

2.Check "Use command line options", and add below in box

--jlink_script_file=$PROJ_DIR$/../evkbimxrt1050_sdram_init.jlinkscript

Snipaste_2024-03-21_15-27-00.png

Then everything should be ok.

=====================================================

 

Best regards,
Gavin

0 项奖励
回复