This misidentification of CPU - Identified core does not match configuration. (Found: Cortex-M0, Configured: Cortex-M4) - started happening recently to me, after I've been using the device with JTrace for about half a year. It seems random, it seems to appear when device is powered on for a while.
However the same device works fine with STLink.
Device: STM32F427VI
Once the misidentification happens, the device cannot be debugged or flashed via JTrace, Ozone won't work. Power cycling JTrace and device does not seem to change anything, but it will still be debuggable with STLink.
Output from the JLink commander when it happens:
Display All
This is the output from a while before when it worked fine:
Display All
This show the device works fine when debugged via STLink+openocd:
Display All
However the same device works fine with STLink.
Device: STM32F427VI
Once the misidentification happens, the device cannot be debugged or flashed via JTrace, Ozone won't work. Power cycling JTrace and device does not seem to change anything, but it will still be debuggable with STLink.
Output from the JLink commander when it happens:
Source Code
- % JLinkGDBServerCLExe -select USB -device STM32F427VI -endian little -if SWD -speed 2000 -ir -LocalhostOnly
- SEGGER J-Link GDB Server V6.62b Command Line Version
- JLinkARM.dll V6.62b (DLL compiled Feb 17 2020 18:42:57)
- Command line: -select USB -device STM32F427VI -endian little -if SWD -speed 2000 -ir -LocalhostOnly
- -----GDB Server start settings-----
- GDBInit file: none
- GDB Server Listening port: 2331
- SWO raw output listening port: 2332
- Terminal I/O port: 2333
- Accept remote connection: localhost only
- Generate logfile: off
- Verify download: off
- Init regs on start: on
- Silent mode: off
- Single run mode: off
- Target connection timeout: 0 ms
- ------J-Link related settings------
- J-Link Host interface: USB
- J-Link script: none
- J-Link settings file: none
- ------Target related settings------
- Target device: STM32F427VI
- Target interface: SWD
- Target interface speed: 2000kHz
- Target endian: little
- Connecting to J-Link...
- J-Link is connected.
- Firmware: J-Trace PRO V2 Cortex-M compiled Jan 7 2020 16:54:03
- Hardware: V2.00
- S/N: 752001121
- Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
- Checking target voltage...
- Target voltage: 3.31 V
- Listening on TCP/IP port 2331
- Connecting to target...
- WARNING: Identified core does not match configuration. (Found: Cortex-M0, Configured: Cortex-M4)
- WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
- Connected to target
- Waiting for GDB connection...
- WARNING: Target connection lost. Resetting server.
- ERROR: Failed to open remote socket. GDBServer will be closed.
- Restoring target state and closing J-Link connection...
- Shutting down...
- Remote connection failed.
This is the output from a while before when it worked fine:
Source Code
- % JLinkGDBServerCLExe -select USB -device STM32F427VI -endian little -if SWD -speed 2000 -ir -LocalhostOnly
- SEGGER J-Link GDB Server V6.62b Command Line Version
- JLinkARM.dll V6.62b (DLL compiled Feb 17 2020 18:42:57)
- Command line: -select USB -device STM32F427VI -endian little -if SWD -speed 2000 -ir -LocalhostOnly
- -----GDB Server start settings-----
- GDBInit file: none
- GDB Server Listening port: 2331
- SWO raw output listening port: 2332
- Terminal I/O port: 2333
- Accept remote connection: localhost only
- Generate logfile: off
- Verify download: off
- Init regs on start: on
- Silent mode: off
- Single run mode: off
- Target connection timeout: 0 ms
- ------J-Link related settings------
- J-Link Host interface: USB
- J-Link script: none
- J-Link settings file: none
- ------Target related settings------
- Target device: STM32F427VI
- Target interface: SWD
- Target interface speed: 2000kHz
- Target endian: little
- Connecting to J-Link...
- J-Link is connected.
- Firmware: J-Trace PRO V2 Cortex-M compiled Jan 7 2020 16:54:03
- Hardware: V2.00
- S/N: 752001121
- Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
- Checking target voltage...
- Target voltage: 3.31 V
- Listening on TCP/IP port 2331
- Connecting to target...
- Connected to target
- Waiting for GDB connection...Connected to 127.0.0.1
- Reading all registers
- Read 4 bytes @ address 0x00000000 (Data = 0x10010000)
- Read 2 bytes @ address 0x00000000 (Data = 0x0000)
- Read 4 bytes @ address 0x00000000 (Data = 0x10010000)
- Read 4 bytes @ address 0x00000000 (Data = 0x10010000)
- Reading 64 bytes @ address 0x00000000
- Reading register (MSP = 0x 0)
- Reading register (PSP = 0x 0)
- Reading register (PRIMASK = 0x 0)
- Reading register (BASEPRI = 0x 0)
- Reading register (FAULTMASK = 0x 0)
- Reading register (CONTROL = 0x 0)
- Reading register (FPSCR = 0x6765723C)
- Starting target CPU...
- Reading all registers
- Read 4 bytes @ address 0x00000000 (Data = 0x10010000)
- Read 2 bytes @ address 0x00000000 (Data = 0x0000)
- Read 4 bytes @ address 0x00000000 (Data = 0x10010000)
- Read 4 bytes @ address 0x00000000 (Data = 0x10010000)
- Reading register (MSP = 0x 0)
- Reading register (PSP = 0x 0)
- Reading register (PRIMASK = 0x 0)
- Reading register (BASEPRI = 0x 0)
- Reading register (FAULTMASK = 0x 0)
- Reading register (CONTROL = 0x 0)
- Reading register (FPSCR = 0x6765723C)
- Starting target CPU...
- Debugger requested to halt target...
- ...Target halted (PC = 0x08032530)
- [...]
This show the device works fine when debugged via STLink+openocd:
Source Code
- % ~/local/openocd-git/bin/openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg
- Open On-Chip Debugger 0.10.0+dev-00957-g9de7d9c (2019-11-16-23:13)
- Licensed under GNU GPL v2
- For bug reports, read
- http://openocd.org/doc/doxygen/bugs.html
- WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
- Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
- Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
- Info : Listening on port 6666 for tcl connections
- Info : Listening on port 4444 for telnet connections
- Info : clock speed 2000 kHz
- Info : STLINK V2J36S7 (API v2) VID:PID 0483:3748
- Info : Target voltage: 3.227261
- Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
- Info : Listening on port 3333 for gdb connections
- Info : accepting 'gdb' connection on tcp/3333
- target halted due to debug-request, current mode: Thread
- xPSR: 0x01000000 pc: 0x0802c94a msp: 0x1000fc88
- Info : device id = 0x20016419
- Info : flash size = 2048 kbytes
- Info : Dual Bank 2048 kiB STM32F42x/43x/469/479 found
- Info : flash size = 512 bytes
- Info : halted: PC: 0x0802c94c
- Info : halted: PC: 0x0802c94e
- Info : halted: PC: 0x0802c950
- Info : dropped 'gdb' connection