I use S32K344HVS with Jlink SWD interface, connect four pin: GND, SWC, SWD, RESET.
Normally, the system is OK, and I can connect the Jlink CommanderV7.94 to the MCU. But, when it run a pure software algorithm for several hours, the MCU will crash (the led blink and the console uart is stop), and I cannot connect the MCU with the Jlink.
【THE JlinkCommander show the error info:】
SEGGER J-Link Commander V7.94
Firmware: J-Link V11 compiled Nov 22 2023 09:48:47
Hardware version: V11.00
J-Link>connect
Please specify device / core. <Default>: S32K344
Type '?' for selection dialog
Device>S32K344
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>1000
Device "S32K344" selected.
Connecting to target via SWD
ConfigTargetSettings() start
ConfigTargetSettings() end - Took 11us
InitTarget() start
SDA_AP detected
Checking if debug access is already enabled...
Debug access is not enabled yet. Performing enable debug access sequence...
Debug access enabled
Checking if HSE firmware is installed...
HSE firmware not installed
Lock step mode enabled
InitTarget() end - Took 4.10s
Found SW-DP with ID 0x6BA02477
Failed to power up DAP
ConfigTargetSettings() start
ConfigTargetSettings() end - Took 9us
InitTarget() start
Unknown SDA AP Id detected: 0xFFFFFFFF
InitTarget() end - Took 401ms
Cannot connect to target.
J-Link>
【The following is the information displayed by Jlink Commander during normal operation:】
SEGGER J-Link Commander V7.94
Firmware: J-Link V11 compiled Nov 22 2023 09:48:47
Hardware version: V11.00
J-Link>connect
Please specify device / core. <Default>: S32K344
Type '?' for selection dialog
Device>S32K344
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>1000
Device "S32K344" selected.
Connecting to target via SWD
ConfigTargetSettings() start
ConfigTargetSettings() end - Took 12us
InitTarget() start
SDA_AP detected
Checking if debug access is already enabled...
Debug access is not enabled yet. Performing enable debug access sequence...
Debug access enabled
Checking if HSE firmware is installed...
HSE firmware not installed
Lock step mode enabled
InitTarget() end - Took 27.8ms
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
CoreSight SoC-400 or earlier
AP map detection skipped. Manually configured AP map found.
AP[0]: MEM-AP (IDR: Not set)
AP[1]: APB-AP (IDR: Not set)
AP[2]: MEM-AP (IDR: Not set)
AP[3]: MEM-AP (IDR: Not set)
AP[4]: AHB-AP (IDR: Not set)
AP[5]: AHB-AP (IDR: Not set)
AP[6]: MEM-AP (IDR: Not set)
AP[7]: MEM-AP (IDR: Not set)
AP[4]: Skipped ROMBASE read. CoreBaseAddr manually set by user
AP[4]: Core found
CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
Cache: L1 I/D-cache present
Found Cortex-M7 r1p2, Little endian.
FPUnit: 8 code (BP) slots and 0 literal slots
ROM table scan skipped. CoreBaseAddr manually set by user: 0x40250400
I-Cache L1: 8 KB, 128 Sets, 32 Bytes/Line, 2-Way
D-Cache L1: 8 KB, 64 Sets, 32 Bytes/Line, 4-Way
SetupTarget() start
Initializing ECC RAM...
RAMCodeAddr: 0x20000000
RAMInitAddr: 0x20000010
RAMInitSize: 0x00007FF0
InitPattern: 0xDEADBEEF
ECC RAM initialized successfully
Initializing ECC RAM...
RAMCodeAddr: 0x20000000
RAMInitAddr: 0x20400000
RAMInitSize: 0x00004000
InitPattern: 0xDEADBEEF
ECC RAM initialized successfully
SetupTarget() end - Took 35.2ms
Memory zones:
Zone: "Default" Description: Default access mode
Cortex-M7 identified.
J-Link>
Solved! Go to Solution.
Hi @Fovery,
J-link commander would reset the MCU with the connect command.
Have you tried attaching it (without reset) in Ozone?
Regards,
Daniel
When the MCU crashes, it does not enter the error interrupt to print backtrace information, nor can it be connected by Jink, causing me to be unable to view the PC value and stack content at the time of the crash. Therefore, I have no way to investigate the cause of this issue. Sincerely request support, thanks!!!!!!
Hello @Fovery,
The LED that blinks is the reset LED, right?
Does the MCU work without debugger after power-on reset?
BR, Daniel
1. The LED is only a gpio output by a task to blink, not the reset LED.
2. Yes, the debuger is not connect, and the MCU still crash after hours. After the MCU crash, I connect the Jlink four pins (gnd,swc,swd,reset), but Jlink comander cannot "connect" to the MCU.
Hi @Fovery,
J-link commander would reset the MCU with the connect command.
Have you tried attaching it (without reset) in Ozone?
Regards,
Daniel
Finally, I found that when I enabled MPU (only open MPU_ENABLE macro definition), multiple boards ran for a week without any abnormalities. Therefore, I am very puzzled as to why there is a crash and inability to connect to Jlink, when I enable I/DCache without enabling MPU configuration. How to explain the reason for this problem? Could you please help me answer it? Thanks!!!!
Hi @Fovery,
It does not make much sense to me.
Have you found more information about the crash?
Is the stuck in a loop somewhere?
Do you have HardFault_Hnadler() inmplemented in the project?
Thanks,
BR, Daniel
Thanks!!!
Summarize the issues of this forum post:
[Problem phenomenon]
In the S32K344 project, I/DCache is enabled, but MPU_ENABLE is not defined. When running a pure algorithm (drone IMU algorithm, variables placed in SRAM) for about a few minutes to an hour, the MCU will enter an unknown crash state, as shown below: the LED light does not blink, Jlink cannot connect without hardware reset, and the MCU didn't entered NMI/MEM/Usage/Hardfaut interrupts (In these error interrupts will print backtrace info through the UART). At this crash status, only by resetting the MCU through the hardware reset pin, the MCU run again. But the problem site cannot be analyzed anymore. And the Ozone "Attach to Running Program" will retry to reset the MCU reset PIN to connect after it cannot connected to the MCU in the unknown crash state.
[Problem fixing]
Only by adding the MPU_ENABLE macro definition in the S32DS project settings, multiple boards were tested for a week, there were no abnormal resets or crashes.
[My Doubt]
How to explain the reason for this problem, that S32K344 enter the unknown crash status without MPU_ENABLE.
Hi @Fovery,
Refer to the Arm ® v7-M Architecture Reference Manual
B3.5.2 Behavior when the MPU is disabled.
And compare the default memory map and attributes to your MPU configuration.
BR, Daniel
Thanks!!!!
Using Ozone "Attach to Running Program", the MCU is connect and the ozone can display the current running status. I'll continue to analysis based on the Ozone.