Hello,
I am trying to debug firmware for the Cortex-M33 on an i.MX93 using a Segger J-Link and gdb. I established an SWD connection using the patch from NXP for the J-Link software and can halt the processor, read the registers and memory and so on.
My problem is, that resetting the processor does not work. The content of the registers does not change so I assume the reset is ignored:
(gdb) monitor regs
R0 = 40D000C0, R1 = 2001EFE3, R2 = 40D000C0, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = FFFFFFFF, R7 = 2001EEE8
R8 = FFFFFFFF, R9 = FFFFFFFF, R10= 2000F000, R11= 00000000
R12= FFFFFFFF, R13= 2001EEE8, MSP= 2001EEE8, PSP= 00000000
R14(LR) = 0FFE219D, R15(PC) = 0FFE2248
XPSR 49000003, APSR 48000000, EPSR 01000000, IPSR 00000003
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Security extension regs:
MSP_S = 2001EEE8, MSPLIM_S = 00000000
PSP_S = 00000000, PSPLIM_S = 00000000
MSP_NS = 00000000, MSPLIM_NS = 00000000
PSP_NS = FFFFFFFC, PSPLIM_NS = 00000000
CONTROL_S 00, FAULTMASK_S 00, BASEPRI_S 00, PRIMASK_S 00
CONTROL_NS 00, FAULTMASK_NS 00, BASEPRI_NS 00, PRIMASK_NS 00
(gdb) monitor reset
Resetting target
(gdb) monitor regs
R0 = 40D000C0, R1 = 2001EFE3, R2 = 40D000C0, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = FFFFFFFF, R7 = 2001EEE8
R8 = FFFFFFFF, R9 = FFFFFFFF, R10= 2000F000, R11= 00000000
R12= FFFFFFFF, R13= 2001EEE8, MSP= 2001EEE8, PSP= 00000000
R14(LR) = 0FFE219D, R15(PC) = 0FFE2248
XPSR 49000003, APSR 48000000, EPSR 01000000, IPSR 00000003
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Security extension regs:
MSP_S = 2001EEE8, MSPLIM_S = 00000000
PSP_S = 00000000, PSPLIM_S = 00000000
MSP_NS = 00000000, MSPLIM_NS = 00000000
PSP_NS = FFFFFFFC, PSPLIM_NS = 00000000
CONTROL_S 00, FAULTMASK_S 00, BASEPRI_S 00, PRIMASK_S 00
CONTROL_NS 00, FAULTMASK_NS 00, BASEPRI_NS 00, PRIMASK_NS 00
The reset strategy from the J-Link is using SYSRESETREQ and not the reset signal since only the Cortex-M33 core is supposed to be reset. Is it possible that the debug controller does not have the necessary security privileges to write the SYSRESETREQ bit?
What is the correct way to perform a reset of the Cortex-M33 using a J-Link?
Regards,
Malte