RT1170_reset.scp invalid PC/SP with RT1170 Rev A

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

RT1170_reset.scp invalid PC/SP with RT1170 Rev A

Jump to solution
1,184 Views
ingdb
Contributor III

We're on MCU Expresso IDE 11.6, The RT1170 is Rev A

We have a custom board very close to the RT1170 EVK, everything is working fine when we link application to RAM

ingdb_0-1668413798075.png

 

But when using flash we see a problem in the RT1170_reset.scp script called when starting the debugging:

Sectors written: 0, unchanged: 1, total: 1
Erased/Wrote sector 0-0 with 35340 bytes in 26msec
Closing flash driver MIMXRT1170_SFDP_QSPI.cfx
RT1170_reset.scp invalid PC/SP with RT1170 REV A

Flash Write Done
Flash Program Summary: 35340 bytes in 0.03 seconds (1327.37 KB/sec)
============= SCRIPT: RT1170_reset.scp =============
Error: Line number 540 already exists
SYSTEM Reset
DpID = 6BA02477
TAP 0: 6BA02477 Core 0: M7 APID: 84770001 ROM Table: E00FD003*
TAP 0: 6BA02477 AP 1: APID: 24770011 ROM Table: E00FF003
TAP 0: 6BA02477 AP 2: APID: 54770002 ROM Table: 00000002
APID = 0x84770001
Setting M4 spin code
Setting M4 clock
Resetting M4 core
Releasing M4
View cores on the DAP AP
DpID = 6BA02477
TAP 0: 6BA02477 Core 0: M7 APID: 84770001 ROM Table: E00FD003*
TAP 0: 6BA02477 Core 1: M4 APID: 24770011 ROM Table: E00FF003
R15 = 0x00223104
REV A
Vector table SP/PC is the reset context.
PC = 0x00000000
SP = 0x00000040
XPSR = 0x01000000
VTOR = 0x30002000
Set DEMCR = 0x010007F1
============= END SCRIPT ===========================
Stopped: VectorCatch:UsageF (PC was 0x00000000)

The PC is invalid (0x00000000), seems as if the initialization of the reset context from the vector table is faulty. 

Any ideas?

 

Best regards

Matthias

Tags (1)
0 Kudos
1 Solution
1,091 Views
ingdb
Contributor III

Hi Jing,

we found the problem, quite simple, we made a mistake in the boot mode configuration, With boot mode "internal" everything is working.

Regards

Matthias

View solution in original post

0 Kudos
11 Replies
1,092 Views
ingdb
Contributor III

Hi Jing,

we found the problem, quite simple, we made a mistake in the boot mode configuration, With boot mode "internal" everything is working.

Regards

Matthias

0 Kudos
1,169 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @ingdb ,

Not only PC but also SP are incorrect. The script file read PC and SP from flash. The position is determined by BOOT_CFG2[3] which determines flexspi2 or flexspi1. If flexspi1, the position is 0x30002000. Then it read SP from 0x30002000 and PC from 0x30002004.

If the data is not correct, please check

1. Is the application image correct? IS PC and SP really there?

2. Is the image download to flash correctly?

The script file is readable.  Line 59 to 66 read PC/SP. You can take a look.

Regards,

Jing

0 Kudos
1,154 Views
ingdb
Contributor III

Hi Jing,

thanks for your help,

I programmed the flash with the GUI tool of MCU expresso, seemed to be successful:

ingdb_0-1668693300904.png

 

Then I started debugging, same problem, corrupted PC and SP

 

ingdb_1-1668693506254.png

here's the memory I see

ingdb_2-1668693540109.png

but after leaving debug mode and verifying flash content I still have the correct flash content. So its looks as if the flash reading in debug mode is my problem. But the program is not running when booting without debugger connected too. So its not related to the debug context. Any other idea?

best regards

Matthias

 

 

 

 

 

0 Kudos
1,152 Views
ingdb
Contributor III

could this be related to my boot mode configuration?

ingdb_0-1668698198647.png

I am not booting from NOR flash

 

0 Kudos
1,142 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @ingdb ,

Yes, you'd better set the boot mode to internal mode. But here if you just want to debug in ITCM, for example, it is no problem.

I know you want to save the code in flash but want the bootROM copy you code to RAM. That still need IVT and Flash config parameter header. MCUBootUtility or SPT will add the header for you automatically. But MCUXpresso won't. 

I'm confused by your screenshot. At 0x30002004, the data is 0x30002405. That is ResetISR() entry address. It's in FlexSPI1 address range, not a RAM address. But in another screenshot, you checked the "link to RAM". So, what did you do to memory configuration?

 

Regards,

Jing

0 Kudos
1,136 Views
ingdb
Contributor III

Hello Jing,

sorry for the confusion, but I want to get a program running in MCUExpresso. I need flash as my program is too big for the internal memory. For a quick test, I modified the program and tried the "link to RAM" option, which is basically working but that's not my use case.

Now I am trying to get the board running and as I said the flash content is written correctly (as I can verify with the GUI flash tool) but when connecting with the debugger to the board the flash content I see in the memory view is not correct and the RT1170_reset_M7.scp script is reading wrong values for PC and SP.

We configured the boot mode to internal but that doesn't make any difference.

So what prevents the RT1170_reset_M7.scp script to read the correct flash data and why is the memory view not working for the flash content in MCUExpresso.

Regards

Matthias

0 Kudos
1,132 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @ingdb ,

Most of the demos in SDK are flash base. Can they debug well on your board?

 

Regards,

Jing

0 Kudos
1,124 Views
ingdb
Contributor III

Hi Jing,

I am using the SDK demos, none of them is working when using FLASH.

 

Regards

Matthias

0 Kudos
1,121 Views
ingdb
Contributor III

Hello Jing,

we made a mistake, we're using the flash of the RT1020 EVK (IS25LP064D-JBLE) with our new RT1171  board. I replaced the files in the xip folder:

evkmimxrt1170_flexspi_nor_config.c => evkmimxrt1020_flexspi_nor_config.c

evkmimxrt1170_flexspi_nor_config.h => evkmimxrt1020_flexspi_nor_config.h

but no real success, I also tried to replace the flash driver MIMXRT1170_SFDP_QSPI.cfx with the MIMXRT1020_SFDP_QSPI.cfx but still the same, SP and PC are invalid.

Regards

Matthias

 

0 Kudos
1,112 Views
ingdb
Contributor III

and my apologies for not making it clear, we don't want to load flash content into RAM, we want to use the XIP feature for our program.

0 Kudos
1,096 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @ingdb ,

Of course you should use RT1170 SFDP driver. What's your SPI Flash? If it's a new flash, you'd better use the Flexspi_nor demo to debug. There are lots of parameters may need to be modified.

 

Regards,

Jing

0 Kudos