现象
***JLink Error: Could not start CPU core. (ErrorCode: -1)
**JLink Warning: CPU could not be halted
***JLink Error: Can not read register 15 (R15) while CPU is running
***JLink Error: Can not read register 16 (XPSR) while CPU is running
***JLink Error: Can not read register 0 (R0) while CPU is running
***JLink Error: Can not read register 1 (R1) while CPU is running
***JLink Error: Can not read register 2 (R2) while CPU is running
***JLink Error: Can not read register 3 (R3) while CPU is running
***JLink Error: Can not read register 4 (R4) while CPU is running
***JLink Error: Can not read register 5 (R5) while CPU is running
***JLink Error: Can not read register 6 (R6) while CPU is running
***JLink Error: Can not read register 7 (R7) while CPU is running
***JLink Error: Can not read register 8 (R8) while CPU is running
***JLink Error: Can not read register 9 (R9) while CPU is running
***JLink Error: Can not read register 10 (R10) while CPU is running
***JLink Error: Can not read register 11 (R11) while CPU is running
***JLink Error: Can not read register 12 (R12) while CPU is running
***JLink Error: Can not read register 13 (R13) while CPU is running
***JLink Error: Can not read register 14 (R14) while CPU is running
***JLink Error: Can not read register 15 (R15) while CPU is running
***JLink Error: Can not read register 16 (XPSR) while CPU is running
***JLink Error: Can not read register 17 (MSP) while CPU is running
***JLink Error: Can not read register 18 (PSP) while CPU is running
***JLink Error: Can not read register 20 (CFBP) while CPU is running
***JLink Error: Can not read register 32 (FPSCR) while CPU is running
***JLink Error: Can not read register 33 (FPS0) while CPU is running
***JLink Error: Can not read register 34 (FPS1) while CPU is running
***JLink Error: Can not read register 35 (FPS2) while CPU is running
***JLink Error: Can not read register 36 (FPS3) while CPU is running
***JLink Error: Can not read register 37 (FPS4) while CPU is running
***JLink Error: Can not read register 38 (FPS5) while CPU is running
***JLink Error: Can not read register 39 (FPS6) while CPU is running
***JLink Error: Can not read register 40 (FPS7) while CPU is running
***JLink Error: Can not read register 41 (FPS8) while CPU is running
***JLink Error: Can not read register 42 (FPS9) while CPU is running
***JLink Error: Can not read register 43 (FPS10) while CPU is running
***JLink Error: Can not read register 44 (FPS11) while CPU is running
***JLink Error: Can not read register 45 (FPS12) while CPU is running
***JLink Error: Can not read register 46 (FPS13) while CPU is running
***JLink Error: Can not read register 47 (FPS14) while CPU is running
***JLink Error: Can not read register 48 (FPS15) while CPU is running
***JLink Error: Can not read register 49 (FPS16) while CPU is running
***JLink Error: Can not read register 50 (FPS17) while CPU is running
***JLink Error: Can not read register 51 (FPS18) while CPU is running
***JLink Error: Can not read register 52 (FPS19) while CPU is running
***JLink Error: Can not read register 53 (FPS20) while CPU is running
***JLink Error: Can not read register 64 (FPS31) while CPU is running
***JLink Error: Can not read register 40 (FPS7) while CPU is running
***JLink Error: Can not read register 41 (FPS8) while CPU is running
***JLink Error: Can not read register 42 (FPS9) while CPU is running
***JLink Error: Can not read register 43 (FPS10) while CPU is running
***JLink Error: Can not read register 44 (FPS11) while CPU is running
***JLink Error: Can not read register 45 (FPS12) while CPU is running
***JLink Error: Can not read register 46 (FPS13) while CPU is running
***JLink Error: Can not read register 47 (FPS14) while CPU is running
***JLink Error: Can not read register 48 (FPS15) while CPU is running
***JLink Error: Can not read register 49 (FPS16) while CPU is running
解决
程序中出现代码:
// NOJTAG: JTAG-DP Disabled and SW-DP Enable
__HAL_AFIO_REMAP_SWJ_NOJTAG();
删除即可
原因
jlink被禁用了,这句代码一般是引脚资源不足时,才使用的。
相关博客
[J-Link] 不同引脚初始化导致大量错误JLink Error: Can not read register 15 (R15) while C