i.MX RT1170 EVBK: Upload / debug into SDRAM is a game of chance

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

i.MX RT1170 EVBK: Upload / debug into SDRAM is a game of chance

151 Views
rainerthaden
Contributor III

Hi there,

I'm using the

i.MX RT1170 EVBK board (unmodified) and the

Rocktech 5.5" TFT with

MCUXpresso IDE 11.9 and the

SDK 2.15.100

I'm trying to link a standard example

evkbmimxrt1170_lvgl_demo_benchmark_cm7

to SDRAM, upload and debug it via the USB debug connection and the

NXP Linkserver_1.4.85

The modifications that I made were:

in the memory map, I freed the first 8k

rainerthaden_0-1718201801010.png

in the linker settings, I chose "Link application to RAM"

rainerthaden_1-1718201928730.png

 

in the Debug settings, I added a Connect script to init the SDRAM (see attached, renamed to .txt)

rainerthaden_2-1718202034516.png

Linking works, everything is in its right place.

However, uploading, starting, debugging works only in about 1 out of 5 times.

In some cases, the app is uploaded but before it reaches main, it gets stuck in e.g.

UsageFault (invalid PC load by EXC_RETURN)

Forced Hard Fault

MemManage Fault (in the LCDIFV2 isr)

etc.

I attached the Link Server console output for a successful run FYI.

I compared these outputs for a successful run and all the ones that had some kind of error and I found only 2 lines that differed (blue colored text):

...
ROM 1 E0043000: CID B105900D PID 04001BB908 CSt CSTF type 0x12 Trace Link - Trace funnel/router
NXP: MIMXRT1176xxxxx
DAP stride is 1024 bytes (256 words)
( 65) Chip Setup Complete
Connected: was_reset=true. was_stopped=false
Awaiting telnet connection to port 3330 ...
...

 

The first line (65) Chip Setup Complete does not occur every time.

When the operation completed successfully, the second line reads Connected: was_reset=true. was_stopped=false

When the operation failed, I saw the following variants:

( 65) Chip Setup Complete

Connected: was_reset=true. was_stopped=false (same as with working example9

 

( 65) Chip Setup Complete
Connected: was_reset=false. was_stopped=false

 

The lase line of this console output for the successful run reads

Stopped: Breakpoint #1

 

In the unsuccessful cases it's e.g.:

 

Stopped: Breakpoint #1
Stopped: VectorCatch:UsageF (PC was 0x8006C9A0)

 

Stopped: VectorCatch:MemMan (PC was 0x80041D88)

 

What am I missing to get this right every time?

 

In general, I found a lot of questions dealing with these kind of problems and a lot of short answers, often referring to (rather) old posts that reference old IDE and SDK versions.
One has to pick a lot of tiny bits of information from a lot of different posts which is rather tedious.
 
Did I miss an application note describing the necessary steps for using SDRAM in the debugging process as well as for loading the firmware from flash into SDRAM (for 16 and 32 bit interfaces) in detail for a current IDE / SDK?
 
Best regards,
 
Rainer
0 Kudos
2 Replies

115 Views
rainerthaden
Contributor III

I found the Brief Overview document an hour ago on this page

https://community.nxp.com/t5/Blog/Overview-of-using-the-MIMXRT1170-EVK-with-MCUXpresso-IDE/ba-p/1241...

Very substantial with a lot of information that everybody having a problem with SDRAM would find helpful.

Best regards,

Rainer

0 Kudos

130 Views
rainerthaden
Contributor III

I found a remedy for this:

1. When I remove the reset script  in the link server configuration

rainerthaden_0-1718269682204.png

then, only a soft reset occurs after uploading.

The debug messages in the console then reads

NXP: MIMXRT1176xxxxx

DAP stride is 1024 bytes (256 words)

Connected: was_reset=false. was_stopped=false

Awaiting telnet connection to port 3330 ...

GDB nonstop mode enabled

FreeRTOS stack backtrace is disabled in Non-stop mode (use All-stop)

Starting execution using soft reset with PC 0x800024E9 SP 0x83000000 from load at 0x80002000

Stopped: Breakpoint #1

 

2.I make sure that the MCU is running in a normal condition before I try to upload to SDRAM. I have an application programmed to flash and make sure that it starts up by power-cycling the EVBK.

This results in almost 100% chance of uploading the app and starting it successfully.

I have questions on this:

1. is this normal behaviour? I.e. do I have to remove the reset script when uploading directly to SDRAM? Or is there something wrong with the reset script? Do I have to init SDRAM in the reset script?

2. Debugging is still not working. After stopping, I can step through the code a few times, then the debugger stays in the "running" state without actually running the program (I don't see any movement on the TFT). I can stop it again but then the debugger keeps staying at one program location. What I can do to prevent this?

 

Best regards,

Rainer

0 Kudos