We have a custom IMXRT1170 board based on the EVK that works great when I use LPCLink / MCUXpresso to program the board for the first time. After programming them once with the LPCLink we can use either the LPCLink or JLINK programmers without issue. However, code will not execute using the JLINK programmer until they are programmed with the LPCLink programmer once. The registers look like this if after are programmed with the JLINK:
PC = 300024BC, CycleCnt = 0B04C872
R0 = 40CAC0B0, R1 = 0A000000, R2 = 80000000, R3 = 0000F000
R4 = E000ED00, R5 = 0022946D, R6 = 001640CD, R7 = 00207DC8
R8 = 2024AE80, R9 = 2024AE84, R10= 00211C0C, R11= 000000F0
R12= 00000000
SP(R13)= 82F80000, MSP= 82F80000, PSP= 00000000, R14(LR) = 002015F3
XPSR = 81000000: APSR = Nzcvq, EPSR = 01000000, IPSR = 000 (NoException)
CFBP = 00000001, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 01
FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000
FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000
FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000
FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= FFFFFFFF
FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000
FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000
FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000
FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= FFFFFFFF
FPSCR= 00000000
These look OK to me but code doesn't execute. Upon Reset:
PC = 00223104, CycleCnt = 9CDD4732
R0 = 40CAC0B0, R1 = 0A000000, R2 = 80000000, R3 = 0000F000
R4 = E000ED00, R5 = 0022946D, R6 = 001640CD, R7 = 00207DC8
R8 = 2024AE80, R9 = 2024AE84, R10= 00211C0C, R11= 000000F0
R12= 00000000
SP(R13)= 20241D98, MSP= 20241D98, PSP= 00000000, R14(LR) = 002015F3
XPSR = 81000000: APSR = Nzcvq, EPSR = 01000000, IPSR = 000 (NoException)
CFBP = 00000001, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 01
FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000
FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000
FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000
FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= FFFFFFFF
FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000
FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000
FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000
FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= FFFFFFFF
FPSCR= 00000000
I see from reading the example .scp files from NXP that PC = 00223104 indicates the processor is still in some sort of debug mode. Trying to follow the example from the connect m7 wake m4 and reset scp scripts, I am running the following commands in JLINK for the first execution:
device MIMXRT1176XXXA_M4
si SWD
speed 4000
connect
Halt
Write4 0x2021FF00 0xE7FEE7FE
Write4 0x2021FF04 0x2021FF01
Write4 0x40C0C000 0xFF00
Write4 0x40C0C004 0x2021
Write4 0x40CC0080 0x201
Reset
Go
Exit
Device MIMXRT1176XXXA_M7
si SWD
speed 4000
Connect
LoadFile hello.elf
WReg “R13 (SP)”, 0x82F80000
WReg “R15 (PC)”, 0x300024BD
WReg “XPSR”, 0x01000000
Write4 0x40C0C068 0x4200
Write4 0xE000EDFC 0x010007F1
Halt
Reset
Go
But I still get the same result. The register settings look correct after writing, but code doesn't execute, and upon reset I still get the PC = 00223104 issue. Our production stations use JLINK programmers and so we need to be able to start the boards up with them. What other registers or addresses do I need to be writing to get the rev B processor out of debug mode permenantly? Thank you.